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

feat(gov,cli): Create AddGovPropFlagsToCmd and ReadGovPropFlags. #14718

Merged
merged 6 commits into from
Jan 24, 2023

Conversation

SpicyLemon
Copy link
Collaborator

@SpicyLemon SpicyLemon commented Jan 20, 2023

Description

Closes: #14700

This PR:

  1. Un-deprecates the FlagTitle variable.
  2. Makes the FlagMetadata variable public.
  3. Creates a FlagSummary variable.
  4. Creates an AddGovPropFlagsToCmd func that adds FlagDeposit, FlagMetadata, FlagTitle, and FlagSummary to a cobra command.
  5. Creates a ReadGovPropFlags func that creates a MsgSubmitProposal pre-populated with provided flag values and proposer (from address).

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

…gSummary. Make FlagMetadata public. Undeprecate FlagTitle. Add unit tests on the new funcs.
@SpicyLemon SpicyLemon requested a review from a team as a code owner January 20, 2023 22:38
@github-prbot github-prbot requested review from a team, alexanderbez and julienrbrt and removed request for a team January 20, 2023 22:38
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

nice! lgtm.

@@ -613,7 +613,7 @@ func (s *CLITestSuite) msgSubmitLegacyProposal(clientCtx client.Context, from, t
}

args := append([]string{
fmt.Sprintf("--%s=%s", govcli.FlagTitle, title), //nolint:staticcheck // SA1019: govcli.FlagTitle is deprecated: use FlagTitle instead
fmt.Sprintf("--%s=%s", govcli.FlagTitle, title),
fmt.Sprintf("--%s=%s", govcli.FlagDescription, description), //nolint:staticcheck // SA1019: govcli.FlagDescription is deprecated: use FlagDescription instead
Copy link
Member

Choose a reason for hiding this comment

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

slightly unrelated but these comments are weird, there is nothing to use instead.

cmd.Flags().String(cli.FlagDescription, "", "description of proposal") //nolint:staticcheck // we are intentionally using a deprecated flag here.
cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal")
cmd.MarkFlagRequired(cli.FlagTitle) //nolint:staticcheck // we are intentionally using a deprecated flag here.
cmd.MarkFlagRequired(cli.FlagTitle)

Check warning

Code scanning / gosec

Errors unhandled.

Errors unhandled.
@julienrbrt julienrbrt enabled auto-merge (squash) January 24, 2023 08:51
@julienrbrt julienrbrt merged commit 6674402 into main Jan 24, 2023
@julienrbrt julienrbrt deleted the dwedul/14700-gov-prop-flags branch January 24, 2023 09:23
@robert-zaremba
Copy link
Collaborator

Upgrade notes should be updated.

@SpicyLemon
Copy link
Collaborator Author

SpicyLemon commented Jan 24, 2023

Upgrade notes should be updated.

I was looking around for a place in the documentation discussing how to design/implement gov v1 proposal messages/endpoints/cli/etc. but couldn't find anything.

I will add this to UPGRADING.md in release/v0.47.x though.

@julienrbrt
Copy link
Member

julienrbrt commented Jan 24, 2023

I will add this to UPGRADING.md in release/v0.47.x though.

As this getting in a point release, I can ping you when we backport this 👍🏾

@tac0turtle
Copy link
Member

@Mergifyio backport release/v0.47.x

@mergify
Copy link
Contributor

mergify bot commented Mar 20, 2023

backport release/v0.47.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Mar 20, 2023
)

(cherry picked from commit 6674402)

# Conflicts:
#	CHANGELOG.md
#	x/feegrant/client/cli/tx_test.go
#	x/upgrade/client/cli/parse_test.go
julienrbrt added a commit that referenced this pull request Mar 20, 2023
…kport #14718) (#15471)

Co-authored-by: Daniel Wedul <github@wedul.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
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.

CLI flags and helpers for governance proposals
4 participants