Skip to content

Conversation

@saini-prakhyat
Copy link

@saini-prakhyat saini-prakhyat commented May 17, 2025

For issue : #255

Overview
This PR finalizes the Project Groups API and test run status tracking, ensuring robust integration, clean routing, and comprehensive test coverage.

Key Changes

  • New Endpoint:
    • Added /api/testrun/project-groups with consistent route registration and validation in router tests.
    • Supports grouping of user projects with summaries (status, run counts, last run date, branch).
    • Allows filtering by group ID and Git branch.
  • Test Run Status Tracking:
    • Adds status column (ENUM: FAILED, SKIPPED, PASSED) to test_runs table via migration.
    • Automatically computes status from associated suite/spec results (case-insensitive handling).
  • Testing:
    • Added unit tests for grouping, filters, and status logic.
    • Verified route registration in router tests.
  • Migrations:
    • Includes up/down SQL migrations for status column and ENUM type.

@saini-prakhyat saini-prakhyat changed the title Updaetd test runs get api Feat : Updated test runs get api to consolidate based on projects May 17, 2025
@saini-prakhyat saini-prakhyat force-pushed the feat/test-run-filter branch from f347be7 to 6434569 Compare May 20, 2025 19:26
@saini-prakhyat saini-prakhyat changed the title Feat : Updated test runs get api to consolidate based on projects Feat: Updated test runs get api to consolidate based on projects May 20, 2025
@saini-prakhyat saini-prakhyat marked this pull request as ready for review May 20, 2025 19:54
@guidewire-oss guidewire-oss deleted a comment from cubic-dev-ai bot May 29, 2025
@anoop2811 anoop2811 requested a review from Copilot May 29, 2025 03:13
@anoop2811 anoop2811 changed the title Feat: Updated test runs get api to consolidate based on projects Feat: Enhance GET /api/testruns with filtering, sorting, field preloading, and status backfill May 29, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new status column to the test_runs table and wires it through the model, data migration, handlers, and tests to support filtering, sorting, and preloading in the GET /api/testruns endpoint.

  • Introduce status field in TestRun model along with a migration and backfill routine.
  • Enhance GET /api/testruns to support project_uuid, sort_by, order, and fields parameters.
  • Update handler logic, utilities, and tests to compute and include status values.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/models/types.go Added Status field to TestRun model
pkg/db/migrations/000009_alter_test_runs_table.up.sql Altered test_runs table to add status column
pkg/datamigrations/status_backfill.go Backfill script to compute and populate status for existing rows
pkg/api/handlers/handlers.go Compute status on create and extend GET /testruns handler for filters, sorting, and preloads
pkg/api/handlers/handlers_test.go Added tests for invalid parameters, project_uuid filter, sorting, preloading, and updated INSERT expectations
pkg/api/handlers/handler_utils.go Updated summary query to use case-insensitive status filters
main.go Kick off asynchronous BackfillTestRunStatus on startup
Comments suppressed due to low confidence (1)

pkg/api/handlers/handlers.go:175

  • You call log.Println() in the GET handler but log is not imported, causing a compile error. Please add import "log" at the top of the file.
log.Println()

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic found 6 issues across 7 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic found 5 issues across 7 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@anoop2811
Copy link
Contributor

@saini-prakhyat : was experimenting with multiple AI tools, so you would have got reviews from copilot and cubic. I believe both are valid

@kusari-inspector
Copy link

kusari-inspector bot commented Jun 8, 2025

Kusari Analysis Results

Analysis for commit: dd4e183, performed at: 2025-06-13T15:35:26Z

@kusari-inspector rerun - Trigger a re-analysis of this PR

@kusari-inspector feedback [your message] - Send feedback to our AI and team


Recommendation

✅ PROCEED with this Pull Request

Summary

No Flagged Issues Detected

All values appear to be within acceptable risk parameters.

No pinned version dependency changes, code issues or exposed secrets detected!

Found this helpful? Give it a 👍 or 👎 reaction!

@kusari-inspector
Copy link

Kusari PR Analysis rerun based on - 17d8b53 performed at: 2025-06-13T15:35:26Z - link to updated analysis

@saini-prakhyat saini-prakhyat changed the title Feat: Enhance GET /api/testruns with filtering, sorting, field preloading, and status backfill Feat: Refactor Preferred Projects to Project Groups API & Add Test Run Status Tracking Jun 13, 2025
@saini-prakhyat saini-prakhyat requested a review from bsekar as a code owner June 21, 2025 12:43
@kusari-inspector
Copy link

Kusari PR Analysis rerun based on - 0cf1cb0 performed at: 2025-06-21T12:43:57Z - link to updated analysis

@kusari-inspector
Copy link

Kusari PR Analysis rerun based on - 8985e06 performed at: 2025-06-22T14:49:02Z - link to updated analysis

@kusari-inspector
Copy link

Kusari PR Analysis rerun based on - 57eda5f performed at: 2025-06-22T17:00:17Z - link to updated analysis

@kusari-inspector
Copy link

Kusari PR Analysis rerun based on - 9880126 performed at: 2025-06-22T17:07:15Z - link to updated analysis

@saini-prakhyat saini-prakhyat changed the title Feat: Refactor Preferred Projects to Project Groups API & Add Test Run Status Tracking Feat: Added Project Groups API & Add Test Run Status Tracking Jun 22, 2025
@kusari-inspector
Copy link

Kusari PR Analysis rerun based on - dd4e183 performed at: 2025-06-28T08:37:24Z - link to updated analysis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants