Open
Conversation
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces first-class support for storing and querying Updatecli report labels by adding a new labels table, wiring label IDs into pipelineReports, and exposing a new read/search API under the pipeline routes.
Changes:
- Add
labelstable + migration, and addlabel_ids UUID[]topipelineReportswith a trigger to maintainlabels.last_pipeline_report_at. - Add
/api/pipeline/labels(GET) and/api/pipeline/labels/search(POST) handlers and route registrations. - Update report insertion to initialize labels and persist
label_ids; add endpoint tests for the new labels endpoint.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/server/labeldb_handlers.go | Adds list/search HTTP handlers for labels with optional filtering and “key-only” mode. |
| pkg/server/endpoints.go | Registers the new labels routes under /api/pipeline. |
| pkg/server/endpoints_test.go | Adds integration tests for GET /api/pipeline/labels and cleanup helper. |
| pkg/model/label.go | Introduces the Label model used by DB queries and API responses. |
| pkg/model/pipelinereport.go | Adds LabelIDs field to represent label relationships on reports. |
| pkg/database/label.go | Adds label CRUD/query helpers + label initialization logic. |
| pkg/database/report.go | Persists label_ids when inserting reports. |
| pkg/database/time_utils.go | Generalizes the date-range helper to accept a column name. |
| pkg/database/migrations/000007_create_labels_tables.*.sql | Creates/drops the labels table and indexes. |
| pkg/database/migrations/000008_alter_pipelineReports_tables.up.sql | Adds label_ids + trigger to sync last_pipeline_report_at. |
| pkg/database/migrations/000008_alter_pipelineReports_labels.down.sql | Drops the trigger/function and removes label_ids. |
| go.mod / go.sum | Bumps Go version and updates dependencies; adds a replace for yaml-jsonpath. |
| docker-compose.yaml | Removes deprecated compose version field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new "label" table to store Updatecli report labels
Add a new endpoint
/api/pipeline/labelsto retrieve labelsDescription
Test
To test this pull request, you can run the following commands:
make testAdditional Information
Tradeoff
Potential improvement