-
-
Couldn't load subscription status.
- Fork 2
feat: support pipeline configuration queries #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Requires Updatecli v0.99.0
There was a problem hiding this 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 pull request introduces support for pipeline configuration queries by extending report insertion logic, adding new endpoints for retrieving configuration resources, and updating the database schema and model definitions.
- Extended report creation to include configuration IDs for sources, conditions, and targets.
- Added new REST endpoints to fetch configuration resources.
- Created database migration files to support hstore columns for configuration IDs.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/server/reportDBQuery.go | Extended report insertion logic with configuration queries. |
| pkg/server/main.go | Registered new endpoints for config source/condition/target. |
| pkg/server/configDBQuery.go | Added functions to insert, delete, and query config resources. |
| pkg/server/configDBHandler.go | Provided HTTP handlers for configuration resource endpoints. |
| pkg/model/pipelinereport.go | Updated the report model with new configuration ID mappings. |
| pkg/model/configResource.go | Defined models for config source, condition, and target. |
| pkg/database/migrations/000005_create_resourceConfig.up.sql | Added SQL migration to create config resource tables and columns. |
| pkg/database/migrations/000005_create_resourceConfig.down.sql | Added SQL migration rollback for config resource tables. |
| go.mod | Updated dependency versions to support new functionality. |
Comments suppressed due to low confidence (2)
pkg/server/configDBQuery.go:84
- Building SQL queries through string concatenation with unsanitized input can expose the application to SQL injection vulnerabilities. Consider using parameterized queries to safely construct the SQL statement.
query := "SELECT * FROM " + table + " WHERE ("
pkg/server/configDBHandler.go:102
- [nitpick] The function name 'DeleteTargetTarget' is inconsistent with the naming convention used for other configuration deletion functions. Renaming it to 'DeleteConfigTarget' would improve clarity and consistency.
func DeleteTargetTarget(c *gin.Context) {
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this 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 support for pipeline configuration queries and expands the API endpoints to manage source, condition, and target configurations. Key changes include new swagger documentation and endpoint handlers for configuration resources, updates to database query functions and migrations for configuration data, and adjustments to the server routing and response models.
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| updatecli/updatecli.d/swagger.yaml | Added new pipeline configuration report documentation. |
| updatecli-compose.yaml | Updated policies configuration to include new SCM values. |
| pkg/server/var.go | Reduced default monitoring duration from 30 to 7 days. |
| pkg/server/scmDBQuery.go | Replaced raw SQL with bob dialect–based dynamic query building. |
| pkg/server/scmDBHandler.go | Renamed and restructured SCM endpoint from FindSCM to ListSCMs with improved swagger annotations. |
| pkg/server/reportHandler.go | Refactored pipeline report endpoints with enhanced swagger documentation and response models. |
| pkg/server/main.go | Added swagger routing and updated API endpoint registrations for configuration queries. |
| pkg/server/configDBQuery.go & configDBHandler.go | Introduced new query functions and handlers for config sources, conditions, and targets. |
| pkg/model/pipelinereport.go & configResource.go | Extended models to handle configuration identifiers and resource configurations. |
| Migration and Makefile files | Added new migration files for configuration resources and updated Makefile targets. |
| README.adoc | Extended documentation and roadmap information. |
| .github/workflows/updatecli.yaml | Enhanced workflow with Swagger installation step. |
Comments suppressed due to low confidence (2)
pkg/server/reportHandler.go:205
- GET endpoints typically return a 200 OK status rather than a 201 Created. Consider updating the Status code for GetPipelineReportByID to 200.
c.JSON(http.StatusCreated, GetPipelineReportByIDResponse{
README.adoc:152
- Consider adding a space or punctuation between 'Support pagination' and the URL for improved readability.
- [ ] Support paginationhttps://meet.google.com/vnj-momt-brs?authuser=0
|
Until merged, the new Updatecli configuration can't work |
The purpose of this pull request is to allow retrieving pipeline reports based on source/condition/target configuration across git repositories
While working on this.
I also took the opportunity to improve the following topics
Description
Test
To test this pull request, you can run the following commands:
Additional Information
Tradeoff
Potential improvement