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

cli: refactor flag reading #6884

Merged
merged 17 commits into from
Jul 30, 2020
Merged

cli: refactor flag reading #6884

merged 17 commits into from
Jul 30, 2020

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Jul 29, 2020

Description

Cleaner and consistent flag reading in ALL CLI auxiliary functions for client.Context building.

  1. client.Context field not pre-populated & flag not set -> uses default flag value ✅
  2. client.Context field not pre-populated & flag set -> uses set flag value ✅
  3. client.Context field pre-populated & flag not set -> uses pre-populated value ✅
  4. client.Context field pre-populated & flag set -> uses set flag value ✅

Checking clientCtx allows us to cover cases 1-3 and checking flagSet.Changed allows us to handle case 4.

ref: #6717 (comment)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@alexanderbez alexanderbez mentioned this pull request Jul 29, 2020
9 tasks
@codecov
Copy link

codecov bot commented Jul 29, 2020

Codecov Report

Merging #6884 into master will increase coverage by 0.02%.
The diff coverage is 72.72%.

@@            Coverage Diff             @@
##           master    #6884      +/-   ##
==========================================
+ Coverage   61.40%   61.42%   +0.02%     
==========================================
  Files         517      517              
  Lines       32050    32059       +9     
==========================================
+ Hits        19679    19692      +13     
+ Misses      10802    10799       -3     
+ Partials     1569     1568       -1     

@alexanderbez alexanderbez marked this pull request as ready for review July 29, 2020 20:36
@alexanderbez alexanderbez added A:automerge Automatically merge PR once all prerequisites pass. C:CLI Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. labels Jul 29, 2020
client/cmd.go Show resolved Hide resolved
@aaronc aaronc removed the A:automerge Automatically merge PR once all prerequisites pass. label Jul 30, 2020
@aaronc
Copy link
Member

aaronc commented Jul 30, 2020

ACK'ed but removed automerge. I'd leave it up to you how best to manage these flags.

@alexanderbez alexanderbez added the A:automerge Automatically merge PR once all prerequisites pass. label Jul 30, 2020
@mergify mergify bot merged commit 9ccec07 into master Jul 30, 2020
@mergify mergify bot deleted the bez/refactor-cmd-flags-helpers branch July 30, 2020 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:CLI Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants