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

fix: Fix http basic flag. #240

Merged
merged 1 commit into from
Jun 27, 2022
Merged

fix: Fix http basic flag. #240

merged 1 commit into from
Jun 27, 2022

Conversation

gfyrag
Copy link
Contributor

@gfyrag gfyrag commented Jun 27, 2022

fix: Fix http basic flag

It seems viper function RegisterAlias() does not works as expected, the GetStringSlice() function does not returns anything for any flag (the aliased as well as the alias).
So the fix consist of not using RegisterAlias() and simply handle both flags.
Also the PR move some bootstrap code from cmd/container.go and cmd/root.go inside package cmd/internal.
Now, all code related to http basic feature is located there.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring / Technical debt

What parts of the code are impacted ?

  • cmd/container.go

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@gfyrag gfyrag requested a review from a team as a code owner June 27, 2022 09:28
@codecov
Copy link

codecov bot commented Jun 27, 2022

Codecov Report

Merging #240 (dfb864e) into main (b11fa82) will increase coverage by 2.32%.
The diff coverage is 89.67%.

❗ Current head dfb864e differs from pull request most recent head 6ad8354. Consider uploading reports for the commit 6ad8354 to get more accurate results

@@            Coverage Diff             @@
##             main     #240      +/-   ##
==========================================
+ Coverage   67.16%   69.48%   +2.32%     
==========================================
  Files          72       75       +3     
  Lines        3816     3936     +120     
==========================================
+ Hits         2563     2735     +172     
+ Misses       1001      960      -41     
+ Partials      252      241      -11     
Impacted Files Coverage Δ
cmd/container.go 58.20% <0.00%> (+1.56%) ⬆️
cmd/doc.go 30.00% <0.00%> (ø)
pkg/bus/monitor.go 72.91% <0.00%> (-1.56%) ⬇️
pkg/core/posting.go 76.00% <ø> (ø)
pkg/opentelemetry/opentelemetrytraces/storage.go 49.65% <56.25%> (ø)
pkg/storage/storage.go 58.73% <63.63%> (ø)
pkg/ledger/ledger.go 70.94% <81.25%> (-6.03%) ⬇️
pkg/ledger/process.go 84.21% <84.21%> (ø)
pkg/storage/transactions.go 86.66% <86.66%> (ø)
pkg/storage/accounts.go 88.23% <88.23%> (ø)
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a28df34...6ad8354. Read the comment docs.

@gfyrag gfyrag force-pushed the fix/http-basic-flag branch 3 times, most recently from 71b12fa to 8271c69 Compare June 27, 2022 11:23
antoinegelloz
antoinegelloz previously approved these changes Jun 27, 2022
expectedValue: "foo:bar",
},
{
name: "using credentials flag",
Copy link
Member

Choose a reason for hiding this comment

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

Should this be authBasicCredentialsFlag ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exact!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

jdupas22
jdupas22 previously approved these changes Jun 27, 2022
altitude
altitude previously approved these changes Jun 27, 2022
@gfyrag gfyrag dismissed stale reviews from altitude and jdupas22 via 5e41b21 June 27, 2022 14:33
It seems viper function RegisterAlias() does not works as expected, the GetStringSlice() function does not returns anything for any flag (the aliased as well as the alias).
So the fix consist of not using RegisterAlias() and simply handle both flags.
Also the PR move some bootstrap code from cmd/container.go and cmd/root.go inside package cmd/internal/http_basic.go.
Now, all code related to http basic feature is located there.
@gfyrag gfyrag merged commit aa4e4ba into main Jun 27, 2022
@gfyrag gfyrag deleted the fix/http-basic-flag branch June 27, 2022 14:39
flemzord pushed a commit that referenced this pull request Jun 7, 2023
flemzord pushed a commit that referenced this pull request Sep 20, 2023
flemzord pushed a commit that referenced this pull request Dec 4, 2023
flemzord pushed a commit that referenced this pull request Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants