ci: ensure each dataset don't exceed the max nb of lines#45
Conversation
This commit add a verification on the gh action, to ensure that each dataset respect the maximun number of lines. The objective is to facilitate the maintainability of theses files.
📝 WalkthroughWalkthroughThe CI workflow now validates that TOML files do not exceed 100,000 lines before running dependency installation, Rust toolchain/cache setup, and ChangesCI validation
Estimated code review effort: 2 (Simple) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/check.yml:
- Around line 33-36: Replace the archived actions-rs/toolchain step in the Rust
setup workflow with a maintained alternative such as dtolnay/rust-toolchain or
actions-rust-lang/setup-rust-toolchain, preserving the stable toolchain
configuration and existing rust-cache step.
- Around line 25-27: Move the “Ensure each file respect the max number of lines”
step to immediately after the checkout step in the workflow, before
cache-apt-pkgs-action and any apt-get install steps. Preserve its existing TOML
line-limit command and failure behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ff370ed4-0284-4796-ae26-dad547a34411
📒 Files selected for processing (1)
.github/workflows/check.yml
| - name: Ensure each file respect the max number of lines | ||
| run: | | ||
| find . -iname "*.toml" -exec awk 'FNR == 100001 { print "Error: " FILENAME " exceeds 100,000 lines, consider to split it!"; err=1; nextfile } END { exit err }' {} + |
There was a problem hiding this comment.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the workflow around the referenced lines.
sed -n '1,120p' .github/workflows/check.yml
# Show the exact changed lines with numbers.
nl -ba .github/workflows/check.yml | sed -n '1,120p'Repository: fodydev/afrim-data
Length of output: 1463
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find the workflow file if the path differs, then inspect it.
fd -a 'check.yml' .github . || trueRepository: fodydev/afrim-data
Length of output: 203
Move the line-limit check before APT setup.
Put it right after checkout so oversized TOML files fail before cache-apt-pkgs-action and the later apt-get install run.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/check.yml around lines 25 - 27, Move the “Ensure each file
respect the max number of lines” step to immediately after the checkout step in
the workflow, before cache-apt-pkgs-action and any apt-get install steps.
Preserve its existing TOML line-limit command and failure behavior.
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| - uses: Swatinem/rust-cache@v2 |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
curl -fsSL https://api.github.com/repos/actions-rs/toolchain |
jq -e '.archived == true'Repository: fodydev/afrim-data
Length of output: 205
🏁 Script executed:
#!/bin/bash
set -eu
printf '\n## Workflow excerpt\n'
nl -ba .github/workflows/check.yml | sed -n '1,80p'
printf '\n## Local references to actions-rs/toolchain\n'
rg -n "actions-rs/toolchain|Swatinem/rust-cache|rust-toolchain" .github/workflows . -g '!**/node_modules/**' || trueRepository: fodydev/afrim-data
Length of output: 395
🌐 Web query:
actions-rs/toolchain archived read-only maintained replacement rust toolchain action
💡 Result:
The actions-rs/toolchain GitHub Action is officially archived and read-only as of October 13, 2023 [1][2]. The entire actions-rs organization, which was previously a popular source for Rust-related GitHub Actions, has been unmaintained for some time [3][4]. There is no single official "blessed" replacement from the Rust project [3]. However, the community has largely standardized on alternative, actively maintained actions for managing Rust toolchains in CI/CD pipelines [4][5]. The most widely recommended replacements are: 1. dtolnay/rust-toolchain: This is the most popular community standard [4][5]. It is highly concise, reliable, and maintained by a well-known Rust developer [6][7]. It focuses on installing the toolchain with good defaults and is frequently cited as the primary replacement [4][5]. 2. actions-rust-lang/setup-rust-toolchain: This action is a more feature-rich alternative [8]. It is heavily inspired by dtolnay's action but extends it with additional capabilities, such as built-in caching for Rust tools and build artifacts, and automatic integration of problem matchers for better CI feedback [8]. If you are currently using actions-rs/toolchain, you should migrate to one of these alternatives as soon as possible, as the archived version is not being updated to support newer Node.js runtime requirements or other CI/CD platform changes [9][3].
Citations:
- 1: Project unmaintained actions-rs/toolchain#216
- 2: https://p.rst.im/q/GitHub.Com/actions-rs/toolchain
- 3: Agenda Item: UNOfficial Github Actions @actions-rs for Rust Community has been Archived rust-lang/infra-team#96
- 4: https://rustprojectprimer.com/ci/github.html
- 5: https://www.rustfaq.org/en/how-to-set-up-cicd-for-rust-projects-github-actions/
- 6: https://github.com/dtolnay/rust-toolchain/
- 7: Replace GitHub Actions actions-rs/toolchain Nitrokey/nethsm-sdk-rs#52
- 8: https://github.com/actions-rust-lang/setup-rust-toolchain
- 9:
set-outputcommand is deprecated actions-rs/toolchain#221
Replace the archived Rust toolchain action. actions-rs/toolchain is archived and read-only, so this workflow should switch to a maintained alternative such as dtolnay/rust-toolchain or actions-rust-lang/setup-rust-toolchain.
🧰 Tools
🪛 actionlint (1.7.12)
[error] 33-33: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 zizmor (1.26.1)
[error] 36-36: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[warning] 33-33: action or reusable workflow from archived repository (archived-uses): repository is archived
(archived-uses)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/check.yml around lines 33 - 36, Replace the archived
actions-rs/toolchain step in the Rust setup workflow with a maintained
alternative such as dtolnay/rust-toolchain or
actions-rust-lang/setup-rust-toolchain, preserving the stable toolchain
configuration and existing rust-cache step.
Source: Linters/SAST tools
Related issues
Change
Summary by CodeRabbit