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

chore: migrate a few diagrams to mermaid #20473

Merged
merged 1 commit into from
May 29, 2024
Merged

chore: migrate a few diagrams to mermaid #20473

merged 1 commit into from
May 29, 2024

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented May 28, 2024

Description

this pr migrates a few diagrams to mermaid to be consistent with the direction we are going with diagraming


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
    • Replaced ASCII art with Mermaid flowchart representations for better visualization in the "Building Modules" and "Advanced Store" sections.

Copy link
Contributor

coderabbitai bot commented May 28, 2024

Walkthrough

Walkthrough

The recent changes involve transitioning from ASCII art to Mermaid flowchart representations for visualizing application flow and store structures within the Cosmos SDK documentation. This update enhances clarity and visual appeal, making the documentation more user-friendly and easier to understand.

Changes

File Path Change Summary
docs/build/building-modules/00-intro.md Replaced ASCII art with a Mermaid flowchart for visualizing the application flow within the Cosmos SDK architecture.
docs/learn/advanced/04-store.md Replaced textual representation of key-value stores with a Mermaid flowchart, illustrating the main multistore and its relationship with individual key-value stores managed by module keepers.

Sequence Diagram(s) (Beta)

No sequence diagrams are needed for these changes as they primarily involve updates to documentation visualization.


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 full the review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@tac0turtle tac0turtle marked this pull request as ready for review May 28, 2024 20:10
@tac0turtle tac0turtle requested a review from a team as a code owner May 28, 2024 20:10
@tac0turtle
Copy link
Member Author

added support for mermaid here cosmos/cosmos-sdk-docs#145

Copy link
Contributor

@cool-develope cool-develope left a comment

Choose a reason for hiding this comment

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

LGTM

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: 1

Outside diff range and nitpick comments (5)
docs/build/building-modules/00-intro.md (3)

Line range hint 51-51: Add a comma after "malicious" for better readability.

- ...some modules to be malicious. That is why module developers need to carefully think...
+ ...some modules to be malicious, That is why module developers need to carefully think...

Line range hint 51-51: Consider using "grant" instead of "give" to enhance the formality of the text.

- ...but also about how to give access to the module's store(s).
+ ...but also about how to grant access to the module's store(s).

Line range hint 62-62: Consider a more concise alternative to "in order to".

- ...interface in order to be managed by the [`module manager`](./01-module-manager.md).
+ ...interface to be managed by the [`module manager`](./01-module-manager.md).
docs/learn/advanced/04-store.md (2)

Line range hint 104-104: Add a comma after "Moreover" for better readability.

- ...ructor and hold them in `Store.stores`. Moreover caches all read queries.
+ ...ructor and hold them in `Store.stores`, Moreover caches all read queries.

Line range hint 218-218: Add a comma after "Otherwise" for better readability.

- ...thKVGasConfig` method of the `context`. Otherwise it uses the following default:
+ ...thKVGasConfig` method of the `context`, Otherwise it uses the following default:
Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between dac569c and 3c519f8.
Files selected for processing (2)
  • docs/build/building-modules/00-intro.md (1 hunks)
  • docs/learn/advanced/04-store.md (1 hunks)
Additional Context Used
LanguageTool (9)
docs/build/building-modules/00-intro.md (4)

Near line 43: There seems to be a noun/verb agreement error. Did you mean “does not” or “did not”?
Context: ...needed for their specific use case that do not exist yet, and will use existing module...
Rule ID: SINGULAR_NOUN_AGREEMENT_WHO_DO_NOT


Near line 51: Possible missing comma found.
Context: ...r some modules to be malicious. That is why module developers need to carefully thi...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA


Near line 51: Try using a synonym here to strengthen your writing.
Context: ...th other modules, but also about how to give access to the module's store(s). The Co...
Rule ID: GIVE_PROVIDE


Near line 62: Consider a shorter alternative to avoid wordiness.
Context: ...les implement the AppModule interface in order to be managed by the [module manager](./...
Rule ID: IN_ORDER_TO_PREMIUM

docs/learn/advanced/04-store.md (5)

Near line 104: A comma may be missing after the conjunctive/linking adverb ‘Moreover’.
Context: ...ructor and hold them in Store.stores. Moreover caches all read queries. `Store.GetKVSt...
Rule ID: SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA


Near line 188: Possible missing comma found.
Context: ...rted later). #### Get Store.Get() firstly checks if Store.cache has an associat...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA


Near line 192: Possible missing comma found.
Context: ...re.cache. cValue` has the field dirty bool which indicates whether the cached valu...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA


Near line 192: Possible missing comma found.
Context: ...s set true so when Store.Write() is called it can be written to the underlying sto...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA


Near line 218: A comma may be missing after the conjunctive/linking adverb ‘Otherwise’.
Context: ...thKVGasConfigmethod of thecontext`. Otherwise it uses the following default: ```go r...
Rule ID: SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA

Markdownlint (1)
docs/learn/advanced/04-store.md (1)

152: Expected: 0 or 2; Actual: 1
Trailing spaces

Path-based Instructions (2)
docs/build/building-modules/00-intro.md (1)

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

docs/learn/advanced/04-store.md (1)

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

Additional comments not posted (2)
docs/build/building-modules/00-intro.md (1)

26-40: The Mermaid diagram provides a clear and visually appealing representation of the transaction flow within a Cosmos SDK application. Great addition for enhancing understanding!

docs/learn/advanced/04-store.md (1)

21-31: The Mermaid diagram effectively illustrates the structure of the main multistore and its relationship with individual key-value stores. This is a significant improvement over the previous textual representation.

E --> I
F --> I
G --> I
I --> J["Return result to the underlying consensus engine (e.g. CometBFT) (0=Ok, 1=Err)"]
```

As a result of this architecture, building a Cosmos SDK application usually revolves around writing modules to implement the specialized logic of the application and composing them with existing modules to complete the application. Developers will generally work on modules that implement logic needed for their specific use case that do not exist yet, and will use existing modules for more generic functionalities like staking, accounts, or token management.
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider revising to "that does not exist yet" for correct noun-verb agreement.

- that do not exist yet
+ that does not exist yet

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
As a result of this architecture, building a Cosmos SDK application usually revolves around writing modules to implement the specialized logic of the application and composing them with existing modules to complete the application. Developers will generally work on modules that implement logic needed for their specific use case that do not exist yet, and will use existing modules for more generic functionalities like staking, accounts, or token management.
As a result of this architecture, building a Cosmos SDK application usually revolves around writing modules to implement the specialized logic of the application and composing them with existing modules to complete the application. Developers will generally work on modules that implement logic needed for their specific use case that does not exist yet, and will use existing modules for more generic functionalities like staking, accounts, or token management.

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.

does it render well in docusaurus?

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.

Ah, I see this PR now cosmos/cosmos-sdk-docs#145

@tac0turtle tac0turtle added this pull request to the merge queue May 29, 2024
Merged via the queue into main with commit 2141ddb May 29, 2024
61 of 62 checks passed
@tac0turtle tac0turtle deleted the marko/mermaid branch May 29, 2024 04:47
alpe added a commit that referenced this pull request May 31, 2024
* main: (120 commits)
  chore: update protoc-gen-swagger to protoc-gen-openapiv2 (#20448)
  ci: Add GitHub Action for go mod tidy and mocks (#20501)
  chore: Address linter issues (#20486)
  fix: wrap errors in auto CLI service registration (#20493)
  chore: fix comment (#20498)
  chore: fix the note box syntax error (#20499)
  feat(server/v2): introduce cometbft v2 (#20483)
  refactor(x/upgrade): migrate to appmodule.VersionMap (#20485)
  docs: code guidelines changes (#20482)
  feat(cosmovisor): load cosmovisor configuration from toml file (#19995)
  perf(math): Significantly speedup Dec quo truncate and quo Roundup (#20034)
  fix: Bump CometBFT versions (#20481)
  refactor(core): remove redundant ExecMode (#20322)
  feat(store/v2): pruning manager (#20430)
  chore: force reload sonar cloud  (#20480)
  refactor(x/accounts): reuse calculated sum in `func safeAdd` (#20458)
  refactor: remove `defer` in loop (#20223)
  ci: remove livness test (#20474)
  build(deps): Bump bufbuild/buf-setup-action from 1.32.1 to 1.32.2 (#20477)
  chore: migrate a few diagrams to mermaid (#20473)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants