-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
refactor: add title and summary to groups proposal #14465
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I'll try it locally after the nits.
other nits: the same can be done in group prompt.go that what you've done in gov prompt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just have a question about max length
string title = 6; | ||
|
||
// summary is the summary of the proposal. | ||
string summary = 7; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add a char limit to these 2 fields? IIRC we had that set to 10000 chars
(same q for gov)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of reusing the same max length as metadata. I did the check on summary but can add to title. Went with metadata length because it shouldn't be long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went with metadata length because it shouldn't be long
I think I didn't follow the whole conversation for these changes, so if there was already consensus on this, then I can approve.
But my concern is: summary
is not the long description, right? Where would summary be shown/used btw? Also, iiuc the initial problem was that without these 2 news fields, it breaks explorers (for gov). But if we introduce a summary
with a 255-char lenghth, it still break explorers, right? e.g. https://www.mintscan.io/cosmos/proposals/93, the "Details" field would still need to be resolved with IPFS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can rename it description to not break, that would be better. The character limit is there to ask people to only write a short description/summary, but not the entire one. Its kind of a middle ground to storing it off chain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, talked offline, let's keep title+summary.
Can we add the max length check to title too? To keep the same behavior as before. (and to gov too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything lgtm, not really needed but you can add more testcases to msgs_test.go
with empty title and summary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small nit
Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com>
[Cosmos SDK] Kudos, SonarCloud Quality Gate passed! |
@@ -31,15 +31,18 @@ type proposalType struct { | |||
|
|||
// Prompt the proposal type values and return the proposal and its metadata. | |||
func (p *proposalType) Prompt(cdc codec.Codec) (*Proposal, govtypes.ProposalMetadata, error) { | |||
proposal := &Proposal{} | |||
|
|||
// set metadata | |||
metadata, err := govcli.Prompt(govtypes.ProposalMetadata{}, "proposal") | |||
if err != nil { | |||
return nil, metadata, fmt.Errorf("failed to set proposal metadata: %w", err) | |||
} | |||
// the metadata must be saved on IPFS, set placeholder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// the metadata must be saved on IPFS, set placeholder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do in as follow-up as I need to touch this file for supporting slice in prompts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
(cherry picked from commit 7b12333)
Description
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change