Skip to content
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

[DDO-3219] Fix upsert API methods and add Swagger comment test #329

Merged
merged 5 commits into from
Oct 13, 2023

Conversation

jack-r-warren
Copy link
Contributor

There was a mismatch between what the router was configured for (PUT) and what the Swagger comments were building the client libraries to use (POST).

Tiny fix, but like #327, an easy mistake to make.

Testing

This PR adds an introspective test that mocks the router configuration to collect the API routes that the running server will end up supporting. With that list assembled, it will then iterate over the raw source code files to assert that each configured route is declared exactly once (and nothing else is declared).

This catches a wide variety of mismatches between the Swagger comments and the Gin configuration, including method mismatches like this one, route typos, or omitted Swagger documentation.

Risk

Very low

@jack-r-warren jack-r-warren requested a review from a team as a code owner October 13, 2023 18:56
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 111 Code Smells

No Coverage information No Coverage information
16.7% 16.7% Duplication

@github-actions
Copy link

What's New


PUT /api/app-versions/v3

Upsert a AppVersion

PUT /api/chart-versions/v3

Upsert a ChartVersion

What's Deleted


POST /api/app-versions/v3

Upsert a AppVersion

POST /api/chart-versions/v3

Upsert a ChartVersion

@github-actions
Copy link

Published image from 14e3314 (merge ede68ab):

us-central1-docker.pkg.dev/dsp-artifact-registry/sherlock/sherlock:v0.2.13-ede68ab

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #329 (14e3314) into main (7d0ff3a) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #329   +/-   ##
=======================================
  Coverage   63.23%   63.23%           
=======================================
  Files         147      147           
  Lines        8671     8671           
=======================================
  Hits         5483     5483           
  Misses       2813     2813           
  Partials      375      375           
Files Coverage Δ
...ock/internal/api/sherlock/app_version_v3_upsert.go 60.52% <ø> (ø)
...k/internal/api/sherlock/chart_version_v3_upsert.go 58.33% <ø> (ø)
sherlock/internal/api/sherlock/routes.go 100.00% <100.00%> (ø)
sherlock/internal/github/client.go 75.75% <ø> (ø)
sherlock/internal/slack/client.go 100.00% <ø> (ø)

@jack-r-warren jack-r-warren merged commit 192029f into main Oct 13, 2023
11 checks passed
@jack-r-warren jack-r-warren deleted the DDO-3219-methods branch October 13, 2023 19:03
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.

2 participants