Skip to content

feat: add label endpoint#369

Open
olblak wants to merge 6 commits intoupdatecli:mainfrom
olblak:add/label/endpoint
Open

feat: add label endpoint#369
olblak wants to merge 6 commits intoupdatecli:mainfrom
olblak:add/label/endpoint

Conversation

@olblak
Copy link
Member

@olblak olblak commented Mar 17, 2026

Add a new "label" table to store Updatecli report labels
Add a new endpoint /api/pipeline/labels to retrieve labels

Description

Test

To test this pull request, you can run the following commands:

make test

Additional Information

Tradeoff

Potential improvement

olblak added 2 commits March 17, 2026 20:32
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
@olblak olblak added the enhancement New feature or request label Mar 17, 2026
@olblak olblak requested a review from Copilot March 17, 2026 19:42
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Copy link
Contributor

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 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 labels table + migration, and add label_ids UUID[] to pipelineReports with a trigger to maintain labels.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.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants