Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements a new dashboard statistics API for tracking ADR (Architectuur en Ontwerpregels) adoption metrics. It removes the deprecated ListLintResults functionality and replaces it with a comprehensive set of statistics endpoints that provide insights into API compliance over time.
Changes:
- Added four new statistics endpoints for ADR adoption metrics: summary, rules, timeline, and APIs listing
- Removed unused
ListLintResultsendpoint and related code across multiple files - Introduced new adoption service, repository, and handler layers with SQL-based analytics
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/api_client/services/adoption_service.go | New service implementing business logic for adoption statistics with date parsing, pagination, and rate calculations |
| pkg/api_client/repositories/adoption_repository.go | New repository with complex SQL queries using CTEs for point-in-time adoption analytics |
| pkg/api_client/models/adoption.go | New models for statistics requests and responses including summary, rules, timeline, and API adoption data |
| pkg/api_client/handler/statistics_handler.go | New HTTP handler controller for statistics endpoints |
| pkg/api_client/routers.go | Added four new statistics endpoint routes and updated router signature to accept statistics controller |
| cmd/main.go | Wired up adoption repository, service, and controller in dependency injection |
| pkg/api_client/integration_test.go | Updated integration test setup to include new statistics controller |
| pkg/api_client/services/api_service.go | Removed deprecated ListLintResults method |
| pkg/api_client/services/api_service_test.go | Removed ListLintResults stub implementation |
| pkg/api_client/services/api_service_oas_test.go | Removed ListLintResults stub implementation |
| pkg/api_client/repositories/api_repositorie.go | Removed ListLintResults interface method and implementation |
| pkg/api_client/handler/api_handler.go | Removed ListLintResults handler method |
| pkg/api_client/handler/api_handler_test.go | Removed ListLintResults test stub |
| adr-adoption-plan.md | Added comprehensive implementation plan documentation (715 lines) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…dation - Updated openapi.json to include security requirements for multiple API endpoints. - Modified parseDateRange function to validate that the start date is not after the end date and adjusted the end date to be an exclusive upper bound. - Added unit tests for date range validation to ensure correct behavior.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
pkg/api_client/routers.go:53
- CORS is configured to only expose the "API-Version" header, but the APIs endpoint and the new /v1/statistics/apis endpoint set pagination headers (Total-Count, Total-Pages, Per-Page, Current-Page, Link). In browser clients, these headers won’t be readable unless they’re included in
config.ExposeHeaders, which will break dashboard pagination.
Consider adding the pagination-related headers (and Link) to the exposed headers list alongside API-Version.
func NewRouter(apiVersion string, controller *handler.APIsAPIController, statsController *handler.StatisticsController) *fizz.Fizz {
//gin.SetMode(gin.ReleaseMode)
g := gin.Default()
// Configure CORS to allow access from everywhere
config := cors.DefaultConfig()
config.AllowAllOrigins = true
config.AllowMethods = []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"}
config.AllowHeaders = []string{"Origin", "Content-Length", "Content-Type", "Authorization", "API-Version"}
config.ExposeHeaders = []string{"API-Version"}
g.Use(cors.New(config))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dvh
left a comment
There was a problem hiding this comment.
Er zijn geen responses gedefinieerd in de OAS; deze verwijzen naar niet-bestaande schemas.
No description provided.