Skip to content

Dashboard stats#59

Draft
pasibun wants to merge 16 commits intomainfrom
dashboard-stats
Draft

Dashboard stats#59
pasibun wants to merge 16 commits intomainfrom
dashboard-stats

Conversation

@pasibun
Copy link
Copy Markdown
Contributor

@pasibun pasibun commented Feb 24, 2026

No description provided.

Copy link
Copy Markdown
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 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 ListLintResults endpoint 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.

Copy link
Copy Markdown
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

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.

pasibun and others added 2 commits February 24, 2026 20:34
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.
Copy link
Copy Markdown
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

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>
Copy link
Copy Markdown

Copilot AI commented Feb 24, 2026

@pasibun I've opened a new pull request, #60, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
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

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.

Copy link
Copy Markdown
Contributor

@dvh dvh left a comment

Choose a reason for hiding this comment

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

Er zijn geen responses gedefinieerd in de OAS; deze verwijzen naar niet-bestaande schemas.

@pasibun pasibun marked this pull request as draft February 25, 2026 10:20
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.

4 participants