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

refactor(textual): Update Spec to have shorter Any header screen #14117

Merged
merged 6 commits into from
Dec 6, 2022

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Dec 1, 2022

Description

This is a proposal for spec update on Any value renderers to remove the Object: prefix on its header screen. I found out in #13600 that they "object" word came up unnecessarily too often:

{ "text": "This transaction has 1 Message" },
- { "text": "Message (1/1): Object: /cosmos.bank.v1beta1.MsgSend" },
+ { "text": "Message (1/1): /cosmos.bank.v1beta1.MsgSend" },
{ "text": "MsgSend object" },
{ "text": "From address: cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs" },
... // indentation omitted

An Any can only pack a protobuf message, so it's always going to be Object. That's why I propose to omit it.


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)

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 1, 2022

[Cosmos SDK Core] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@amaury1093 amaury1093 marked this pull request as ready for review December 1, 2022 10:59
@amaury1093 amaury1093 requested a review from a team as a code owner December 1, 2022 10:59
@amaury1093
Copy link
Contributor Author

Thanks for the reviews! I would also like someone from the Textual WG to approve this before merging.

Comment on lines +54 to +55
{"text": "/google.protobuf.Any"},
{"text": "/Foo", "indent": 1},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only weird output would be this.

The first line will have, in a message context, a field name:

<Field>: /google.protobuf.Any

But the 2nd line will be a naked /Foo. I think it's fine, because nested packed Anys should be extremely rare.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 2, 2022

[Cosmos SDK] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@@ -4,7 +4,7 @@
"@type": "/Foo"
},
"screens": [
{"text": "Object: /Foo"},
{"text": "/Foo"},
{"text": "Foo object", "indent": 1}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we still say Foo object after /Foo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We touched on this in yesterday's call, but didn't come to a unanimous conclusion, so here's an issue to discuss more: #14170

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 6, 2022

[Cosmos SDK - Tx] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@amaury1093 amaury1093 enabled auto-merge (squash) December 6, 2022 10:03
@amaury1093 amaury1093 merged commit 4a7e3f0 into main Dec 6, 2022
@amaury1093 amaury1093 deleted the am/textual-any branch December 6, 2022 10:45
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.

6 participants