-
Notifications
You must be signed in to change notification settings - Fork 117
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
chore: remove gov v1beta1 endpoints from docs #3589
base: develop
Are you sure you want to change the base?
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThe pull request updates the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant S as Script (protoc-gen-openapi.sh)
participant F as Swagger File
U->>S: Trigger script execution
S->>S: Set error handling with 'set -eo pipefail'
S->>F: Read merged Swagger file
F-->>S: Provide list of API keys/paths
S->>S: Loop through each key
S->>S: Check if key starts with /cosmos/gov/v1beta1
S->>S: Skip key if check passes, else proceed
S->>S: Evaluate if key is "base", "tx", or "upgrade"
S->>S: Retain endpoint if condition met
S->>U: Output refined OpenAPI documentation
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
scripts/protoc-gen-openapi.sh (1)
3-4
: Enhance Error Handling withset -eo pipefail
The addition ofset -eo pipefail
immediately after the shebang is a robust improvement that ensures the script exits on errors and that any failure in a pipe is detected. As a further enhancement, consider also usingset -u
to treat unset variables as errors, which would make the script even more resilient.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/protoc-gen-openapi.sh
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.sh`: Review the shell scripts, point out issues relati...
**/*.sh
: Review the shell scripts, point out issues relative to security, performance, and maintainability.
scripts/protoc-gen-openapi.sh
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: lint
- GitHub Check: build-zetanode
- GitHub Check: build-and-test
- GitHub Check: gosec
- GitHub Check: build
- GitHub Check: Analyze (go)
🔇 Additional comments (2)
scripts/protoc-gen-openapi.sh (2)
59-64
: Exclude Deprecated/cosmos/gov/v1beta1
Endpoints
The new conditional check effectively identifies and removes paths beginning with/cosmos/gov/v1beta1
, which satisfies the PR objective by eliminating non-functional endpoints from the generated documentation. The use ofyq
for in-place deletion is both concise and efficient.
70-73
: Retain the "upgrade" Endpoint for API Consistency
Expanding the retention logic to include the "upgrade" endpoint—along with "base" and "tx"—ensures that all relevant endpoints are preserved in the final OpenAPI documentation. This change aligns with the updated documentation requirements and the overall strategy for endpoint management.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3589 +/- ##
===========================================
+ Coverage 64.80% 64.85% +0.05%
===========================================
Files 462 462
Lines 31934 31938 +4
===========================================
+ Hits 20694 20713 +19
+ Misses 10332 10313 -19
- Partials 908 912 +4 |
91c4e7f
to
aee7a9f
Compare
aee7a9f
to
78cf71e
Compare
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
Remove all
/cosmos/gov/v1beta1/
endpoints from the openapi docs. These endpoints have been broken since the sdk v0.47 upgrade. Users should just use the/cosmos/gov/v1/
endpoints which actually work.Also restore missing upgrade module docs.
Also properly set deprecated option on proto RPCs. This required an upgrading
protoc-gen-openapiv2
.Also fully qualified naming (
openapi_naming_strategy=fqn
) so that models have the same naming style as the cosmos ones.Also enable inline model display via some
SwaggerUIBundle
options.Summary by CodeRabbit