[ISSUE #5990]🔨Add CI workflow for RocketMQ Dashboard with checks, formatting, and testing#5991
Conversation
|
🔊@mxsm 🚀Thanks for your contribution🎉! 💡CodeRabbit(AI) will review your code first🔥! Note 🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥. |
WalkthroughThese changes establish a comprehensive GitHub Actions CI pipeline for the RocketMQ Dashboard project and resolve dependency version conflicts by pinning specific core-graphics packages to a consistent git source. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/dashboard-ci.yml:
- Around line 6-13: The workflow's path filters ('paths' entries under push and
pull_request) restrict runs to 'rocketmq-dashboard/**' and the workflow file,
which can miss changes in shared workspace crates; update the 'paths' for both
push and pull_request to also include shared workspace files (e.g.,
'Cargo.toml', 'Cargo.lock', and any shared crate paths) or remove the path
filters entirely so the dashboard CI triggers on changes to root workspace
manifests and shared crates; ensure you update both the push and pull_request
sections in .github/workflows/dashboard-ci.yml where the 'paths' arrays are
defined.
| paths: | ||
| - 'rocketmq-dashboard/**' | ||
| - '.github/workflows/dashboard-ci.yml' | ||
| pull_request: | ||
| branches: [ main, rocketmq-*-dev ] | ||
| paths: | ||
| - 'rocketmq-dashboard/**' | ||
| - '.github/workflows/dashboard-ci.yml' |
There was a problem hiding this comment.
Path filters may skip dashboard CI when shared workspace crates change.
If the dashboard depends on crates outside rocketmq-dashboard/**, changes there won’t trigger this workflow. Consider expanding the path filters to include shared workspace files (e.g., root Cargo.toml/Cargo.lock or other shared crate paths) or remove the filter to avoid missing regressions.
🔧 Example adjustment
push:
branches: [ main, rocketmq-*-dev ]
paths:
- 'rocketmq-dashboard/**'
+ - 'Cargo.toml'
+ - 'Cargo.lock'
- '.github/workflows/dashboard-ci.yml'
pull_request:
branches: [ main, rocketmq-*-dev ]
paths:
- 'rocketmq-dashboard/**'
+ - 'Cargo.toml'
+ - 'Cargo.lock'
- '.github/workflows/dashboard-ci.yml'📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.
| paths: | |
| - 'rocketmq-dashboard/**' | |
| - '.github/workflows/dashboard-ci.yml' | |
| pull_request: | |
| branches: [ main, rocketmq-*-dev ] | |
| paths: | |
| - 'rocketmq-dashboard/**' | |
| - '.github/workflows/dashboard-ci.yml' | |
| paths: | |
| - 'rocketmq-dashboard/**' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - '.github/workflows/dashboard-ci.yml' | |
| pull_request: | |
| branches: [ main, rocketmq-*-dev ] | |
| paths: | |
| - 'rocketmq-dashboard/**' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - '.github/workflows/dashboard-ci.yml' |
🤖 Prompt for AI Agents
In @.github/workflows/dashboard-ci.yml around lines 6 - 13, The workflow's path
filters ('paths' entries under push and pull_request) restrict runs to
'rocketmq-dashboard/**' and the workflow file, which can miss changes in shared
workspace crates; update the 'paths' for both push and pull_request to also
include shared workspace files (e.g., 'Cargo.toml', 'Cargo.lock', and any shared
crate paths) or remove the path filters entirely so the dashboard CI triggers on
changes to root workspace manifests and shared crates; ensure you update both
the push and pull_request sections in .github/workflows/dashboard-ci.yml where
the 'paths' arrays are defined.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5991 +/- ##
==========================================
- Coverage 40.63% 40.63% -0.01%
==========================================
Files 870 870
Lines 121650 121650
==========================================
- Hits 49436 49433 -3
- Misses 72214 72217 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rocketmq-rust-bot
left a comment
There was a problem hiding this comment.
LGTM - All CI checks passed ✅
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/dashboard-ci.yml:
- Around line 45-48: Change the floating nightly channel in rust-toolchain.toml
to a pinned date format (e.g., channel = "nightly-YYYY-MM-DD") so CI and local
dev use the same known-good toolchain; then in the GitHub Actions workflow
ensure both rust-toolchain steps include the components by adding a with: block
listing components: rustfmt, clippy (the existing step at lines ~45–48 already
has this, so add the same with: components to the later step around lines
~101–103) so clippy/rustfmt are installed in all CI jobs.
| - name: Set up Rust nightly | ||
| uses: dtolnay/rust-toolchain@nightly | ||
| with: | ||
| components: rustfmt, clippy |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
dtolnay rust-toolchain action nightly pinning best practices
💡 Result:
Best practices for nightly pinning with dtolnay/rust-toolchain (GitHub Actions)
-
Pin nightly by date for reproducibility
- Put a pinned toolchain in repo (recommended):
rust-toolchain.tomlwithchannel = "nightly-YYYY-MM-DD"(pluscomponents/targetsas needed). This makes local dev + CI consistent. [2] - Rust toolchain names officially support
nightly-YYYY-MM-DDarchive dates. [3]
- Put a pinned toolchain in repo (recommended):
-
Don’t use floating
nightlyunless you want daily changesuses: dtolnay/rust-toolchain@nightlyintentionally tracks “current nightly” (can break any day). The action chooses the Rust toolchain based on the action’s@rev. [1]
-
If you need a pinned nightly in CI, use
@master+toolchain:- When you pass an explicit
toolchain:input (likenightly-2025-01-01), the project recommends usingdtolnay/rust-toolchain@masteras the action revision. [1] - Example:
- uses: dtolnay/rust-toolchain@master with: toolchain: nightly-2025-01-01 components: clippy, rustfmt targets: wasm32-unknown-unknown
- When you pass an explicit
-
Pin the action itself for supply-chain safety
- Best practice is to pin GitHub Actions by full commit SHA;
dtolnay/rust-toolchainnotes that the SHA must be from the history ofmaster(otherwise it may be garbage-collected and your workflow can break). [1]
- Best practice is to pin GitHub Actions by full commit SHA;
-
Automate upgrades of your pinned toolchain
- Dependabot can now open PRs for toolchain bumps when you define versions in
rust-toolchain.toml/rust-toolchain. [4]
- Dependabot can now open PRs for toolchain bumps when you define versions in
Rule of thumb: pin nightly by date for reliability; update it intentionally (manually or via Dependabot), and keep “floating nightly” only for an extra CI job that’s allowed to fail.
Sources: [1] [2] [3] [4]
🏁 Script executed:
# Read the workflow file to inspect lines 45-48 and 101-103
fd "dashboard-ci.yml" --type f | head -5Repository: mxsm/rocketmq-rust
Length of output: 44
🏁 Script executed:
cat -n .github/workflows/dashboard-ci.yml | sed -n '40,55p; 96,108p'Repository: mxsm/rocketmq-rust
Length of output: 1133
🏁 Script executed:
find . -name "rust-toolchain.toml" -o -name "rust-toolchain" | head -10Repository: mxsm/rocketmq-rust
Length of output: 83
🏁 Script executed:
cat -n rust-toolchain.tomlRepository: mxsm/rocketmq-rust
Length of output: 107
Pin Rust nightly to a known-good date to stabilize CI across local development and workflows.
The repo already has a rust-toolchain.toml with channel = "nightly" (floating). Instead of pinning in the GitHub Action, update rust-toolchain.toml to channel = "nightly-YYYY-MM-DD" with a specific date. This keeps dev and CI consistent and allows Dependabot to automate updates.
Also, lines 101–103 are missing a with: block to include the same components (rustfmt, clippy) as lines 45–48.
🤖 Prompt for AI Agents
In @.github/workflows/dashboard-ci.yml around lines 45 - 48, Change the floating
nightly channel in rust-toolchain.toml to a pinned date format (e.g., channel =
"nightly-YYYY-MM-DD") so CI and local dev use the same known-good toolchain;
then in the GitHub Actions workflow ensure both rust-toolchain steps include the
components by adding a with: block listing components: rustfmt, clippy (the
existing step at lines ~45–48 already has this, so add the same with: components
to the later step around lines ~101–103) so clippy/rustfmt are installed in all
CI jobs.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@rocketmq-dashboard/Cargo.toml`:
- Around line 48-52: The current [patch.crates-io] block is invalid because it
points to crates.io versions; remove the core-graphics/core-graphics-types
entries from the [patch.crates-io] section and instead unify versions by adding
them under the workspace (e.g., add a [workspace.dependencies] block with
core-graphics = "0.25" and core-graphics-types = "0.2"), then update member
Cargo.toml files that depend on these crates to use core-graphics = { workspace
= true } and core-graphics-types = { workspace = true }; if you truly need a
fork, replace the entries in [patch.crates-io] with a git/path source (e.g.,
core-graphics = { git = "..." }) instead of a plain version.
Which Issue(s) This PR Fixes(Closes)
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.