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

docs: runtime docs #22816

Merged
merged 3 commits into from
Dec 11, 2024
Merged

docs: runtime docs #22816

merged 3 commits into from
Dec 11, 2024

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Dec 10, 2024

Description

Closes: #21429

I think we can consider the last part of the documentation update for v0.52.
Putting runtime as the preferred way to build an app. It will help to explain the migration to v2 as it will be runtime -> runtime/v2


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, you can find examples of the prefixes below:
  • confirmed ! in 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
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • 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.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • Documentation
    • Enhanced documentation for the depinject framework, including a beta disclaimer and expanded usage examples.
    • Updated and clarified the runtime package documentation, emphasizing its role in managing blockchain applications.
    • Restructured content in 01-app-go-di.md to align with the latest Cosmos SDK version, focusing on module configuration and wiring.
    • Updated version references and links in 12-simulation.md to reflect the latest changes in the SimApp class.
    • Minor comment updates in runtime/v2/app.go for improved clarity on example setups.
    • Significant revisions to 00-app-anatomy.md to enhance clarity on application structure and module integration.

@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Dec 10, 2024
Copy link
Contributor

coderabbitai bot commented Dec 10, 2024

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • simapp/v2/app.go

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces extensive documentation updates across multiple files related to the Cosmos SDK, focusing on the depinject dependency injection framework and the runtime package. Enhancements include clarifications on usage, configuration, and debugging techniques, as well as updates to version references and links. The changes aim to provide clearer guidance for developers working with blockchain applications, particularly in relation to the Cosmos SDK's modular architecture.

Changes

File Path Change Summary
depinject/README.md Added disclaimer about beta status, expanded overview, detailed usage of Configuration API, added debugging section.
docs/build/building-apps/00-runtime.md Rephrased introduction, renamed sections, added details on core components and configuration, reorganized key features.
docs/build/building-apps/01-app-go-di.md Updated references to runtime, restructured configuration content, clarified module wiring, added YAML/JSON examples.
docs/learn/advanced/12-simulation.md Updated version references for SimApp, adjusted links to flags.go, no new functionalities introduced.
runtime/v2/app.go Updated comment to reflect new example setup path, no functionality changes.

Assessment against linked issues

Objective Addressed Explanation
Update documentation to match v0.52 (21429)
Description of app module environment (21429)
Introduction to core and core services (21429)
How to write a system tests (21429) No mention of system tests in the documentation updates.
Baseapp architecture content to rewrite (21429) No updates made regarding Baseapp architecture.

Possibly related PRs

Suggested reviewers

  • akhilkumarpilli
  • sontrinh16

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Outside diff range and nitpick comments (6)
docs/build/building-apps/01-app-go-di.md (2)

9-9: Enhance the introduction with more context.

While the introduction correctly emphasizes the runtime package, it would be helpful to briefly explain why the runtime package makes wiring easier.

Consider expanding the introduction:

-The Cosmos SDK allows much easier wiring of an `app.go` thanks to [runtime](./00-runtime.md) and app wiring.
+The Cosmos SDK allows much easier wiring of an `app.go` thanks to [runtime](./00-runtime.md) and app wiring, which provides a declarative approach to configure and manage blockchain applications.

Line range hint 50-106: Great addition of alternative configuration formats.

The new section about alternative formats (YAML/JSON) is valuable, but the example path could be more generic.

Consider updating the example path reference:

-A more complete example of `app.yaml` can be found [here](https://github.com/cosmosregistry/chain-minimal/blob/mini-v050.2/app/app.yaml).
+A more complete example of `app.yaml` can be found in the [chain-minimal repository](https://github.com/cosmosregistry/chain-minimal/blob/mini-v050.2/app/app.yaml).
docs/build/building-apps/00-runtime.md (3)

42-48: Fix punctuation in the configuration list.

The list of key settings needs consistent punctuation.

Apply this formatting:

-* `app_name`: The name of the application
-* `begin_blockers`: List of module names to call during BeginBlock
-* `end_blockers`: List of module names to call during EndBlock
-* `init_genesis`: Order of module initialization during genesis
-* `export_genesis`: Order for exporting module genesis data
-* `pre_blockers`: Modules to execute before block processing
+* `app_name`: The name of the application.
+* `begin_blockers`: List of module names to call during BeginBlock.
+* `end_blockers`: List of module names to call during EndBlock.
+* `init_genesis`: Order of module initialization during genesis.
+* `export_genesis`: Order for exporting module genesis data.
+* `pre_blockers`: Modules to execute before block processing.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~42-~42: Loose punctuation mark.
Context: ...he following key settings: * app_name: The name of the application * `begin_bl...

(UNLIKELY_OPENING_PUNCTUATION)


53-54: Fix missing comma after conjunctive adverb.

-By default, the runtime module uses the module name as the store key. However it provides a flexible store key configuration through:
+By default, the runtime module uses the module name as the store key. However, it provides a flexible store key configuration through:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~53-~53: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ... uses the module name as the store key. However it provides a flexible store key config...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)


97-99: Great addition of core services documentation.

The explanation of core services is clear and well-structured. Consider adding links to the service interfaces for better reference.

-Runtime registers all [core services](../../learn/advanced/02-core.md) required by modules.
-These services include the `store`, the `event manager`, the `context`, and the `logger`.
+Runtime registers all [core services](../../learn/advanced/02-core.md) required by modules.
+These services include the [`store`](https://pkg.go.dev/cosmossdk.io/store), the [`event manager`](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/types#EventManager), the [`context`](https://pkg.go.dev/context), and the [`logger`](https://pkg.go.dev/cosmossdk.io/log).
depinject/README.md (1)

180-180: Update code reference version.

The code reference looks good, but consider adding a note about version compatibility.

Add a version compatibility note before the code reference:

+:::note
+This example uses Cosmos SDK v0.52.0-beta.2. Ensure you're using a compatible version for your application.
+:::
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e07fee5 and 64a3c83.

📒 Files selected for processing (5)
  • depinject/README.md (1 hunks)
  • docs/build/building-apps/00-runtime.md (1 hunks)
  • docs/build/building-apps/01-app-go-di.md (5 hunks)
  • docs/learn/advanced/12-simulation.md (1 hunks)
  • runtime/v2/app.go (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • runtime/v2/app.go
  • docs/learn/advanced/12-simulation.md
🧰 Additional context used
📓 Path-based instructions (3)
depinject/README.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

docs/build/building-apps/00-runtime.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

docs/build/building-apps/01-app-go-di.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

🪛 LanguageTool
docs/build/building-apps/00-runtime.md

[uncategorized] ~42-~42: Loose punctuation mark.
Context: ...he following key settings: * app_name: The name of the application * `begin_bl...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~53-~53: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ... uses the module name as the store key. However it provides a flexible store key config...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)


[uncategorized] ~56-~56: Loose punctuation mark.
Context: ...ration through: * override_store_keys: Allows customizing module store keys * ...

(UNLIKELY_OPENING_PUNCTUATION)

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Outside diff range and nitpick comments (1)
docs/learn/beginner/00-app-anatomy.md (1)

66-66: Consider simplifying the wording

Consider replacing "in order to" with "to" for better conciseness:

-The application's `appCodec` is used to serialize and deserialize data structures in order to store them
+The application's `appCodec` is used to serialize and deserialize data structures to store them
🧰 Tools
🪛 LanguageTool

[style] ~66-~66: Consider a shorter alternative to avoid wordiness.
Context: ...rialize and deserialize data structures in order to store them, as stores can only persist ...

(IN_ORDER_TO_PREMIUM)

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 64a3c83 and 852b698.

📒 Files selected for processing (1)
  • docs/learn/beginner/00-app-anatomy.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/learn/beginner/00-app-anatomy.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

🪛 LanguageTool
docs/learn/beginner/00-app-anatomy.md

[style] ~66-~66: Consider a shorter alternative to avoid wordiness.
Context: ...rialize and deserialize data structures in order to store them, as stores can only persist ...

(IN_ORDER_TO_PREMIUM)

🔇 Additional comments (1)
docs/learn/beginner/00-app-anatomy.md (1)

Line range hint 1-24: LGTM! Documentation accurately reflects the current architecture

The documentation provides a clear and accurate explanation of the Cosmos SDK application anatomy, particularly the new runtime package and dependency injection changes.

Also applies to: 60-73

🧰 Tools
🪛 LanguageTool

[style] ~66-~66: Consider a shorter alternative to avoid wordiness.
Context: ...rialize and deserialize data structures in order to store them, as stores can only persist ...

(IN_ORDER_TO_PREMIUM)

@julienrbrt julienrbrt enabled auto-merge December 10, 2024 20:08
@julienrbrt julienrbrt disabled auto-merge December 11, 2024 06:52
@julienrbrt julienrbrt enabled auto-merge December 11, 2024 07:56
@julienrbrt julienrbrt added this pull request to the merge queue Dec 11, 2024
Merged via the queue into main with commit aa8266e Dec 11, 2024
73 of 75 checks passed
@julienrbrt julienrbrt deleted the julien/docs-run branch December 11, 2024 08:19
@julienrbrt
Copy link
Member Author

@Mergifyio backport release/v0.52.x

Copy link
Contributor

mergify bot commented Dec 11, 2024

backport release/v0.52.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Dec 11, 2024
(cherry picked from commit aa8266e)

# Conflicts:
#	depinject/README.md
#	runtime/v2/app.go
#	simapp/app.go
#	simapp/simd/cmd/root.go
@mergify mergify bot mentioned this pull request Dec 11, 2024
12 tasks
julienrbrt added a commit that referenced this pull request Dec 11, 2024
mergify bot pushed a commit that referenced this pull request Dec 11, 2024
(cherry picked from commit aa8266e)

# Conflicts:
#	depinject/README.md
#	runtime/v2/app.go
#	simapp/app.go
#	simapp/simd/cmd/root.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v0.52 Documentation
7 participants