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

Chore: Define dedicated types for DBMode and RouterFlavor #5092

Merged
merged 8 commits into from
Nov 9, 2023

Conversation

randmonkey
Copy link
Contributor

What this PR does / why we need it:

Define dedicated types for DB mode and router flavor in util/dataplane for clarity and prevent definitions of constants everywhere.
Which issue this PR fixes:

fixes #5013

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@randmonkey randmonkey requested a review from a team as a code owner November 6, 2023 09:36
Copy link
Member

@programmer04 programmer04 left a comment

Choose a reason for hiding this comment

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

Check also

  • test/internal/testenv/testenv.go
  • internal/dataplane/synchronizer_test.go:25 (and more)
  • internal/clients/manager_test.go:228
  • internal/manager/utils/kongconfig/root_test.go
  • internal/dataplane/kong_client_test.go:684

I might miss something

internal/util/dataplane/mode.go Outdated Show resolved Hide resolved
internal/util/dataplane/mode.go Outdated Show resolved Hide resolved
internal/util/dataplane/mode.go Outdated Show resolved Hide resolved
internal/util/dataplane/mode.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (27c29b4) 75.6% compared to head (f0a811c) 75.5%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5092     +/-   ##
=======================================
- Coverage   75.6%   75.5%   -0.1%     
=======================================
  Files        167     168      +1     
  Lines      18906   18905      -1     
=======================================
- Hits       14295   14288      -7     
- Misses      3787    3791      +4     
- Partials     824     826      +2     
Files Coverage Δ
internal/clients/manager.go 96.2% <100.0%> (ø)
internal/dataplane/config/router.go 100.0% <100.0%> (ø)
internal/dataplane/kong_client.go 88.9% <100.0%> (ø)
internal/dataplane/synchronizer.go 93.5% <100.0%> (ø)
internal/dataplane/translator/translator.go 89.7% <100.0%> (-2.0%) ⬇️
internal/manager/run.go 55.4% <100.0%> (-0.2%) ⬇️
internal/manager/setup.go 77.1% <100.0%> (ø)
internal/manager/utils/kongconfig/root.go 51.3% <100.0%> (+0.6%) ⬆️
internal/dataplane/config/dbmode.go 90.9% <90.9%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pmalek
pmalek previously requested changes Nov 6, 2023
internal/util/dataplane/mode.go Outdated Show resolved Hide resolved
internal/util/dataplane/mode.go Outdated Show resolved Hide resolved
@randmonkey randmonkey force-pushed the chore/const_dbmode_router_flavor branch from e30abac to 572545e Compare November 8, 2023 03:16
@randmonkey randmonkey force-pushed the chore/const_dbmode_router_flavor branch from 572545e to 687e05e Compare November 8, 2023 03:24
@randmonkey randmonkey force-pushed the chore/const_dbmode_router_flavor branch from c8309aa to c715829 Compare November 8, 2023 09:59
@randmonkey randmonkey force-pushed the chore/const_dbmode_router_flavor branch from c715829 to f0a811c Compare November 8, 2023 10:11
@randmonkey randmonkey dismissed pmalek’s stale review November 8, 2023 15:59

Already fixed.

@randmonkey randmonkey merged commit 2cbf631 into main Nov 9, 2023
34 checks passed
@randmonkey randmonkey deleted the chore/const_dbmode_router_flavor branch November 9, 2023 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make DB-mode a strongly typed enum across the codebase
4 participants