Skip to content

ci: ensure each dataset don't exceed the max nb of lines#45

Merged
pythonbrad merged 1 commit into
masterfrom
patch_ci
Jul 24, 2026
Merged

ci: ensure each dataset don't exceed the max nb of lines#45
pythonbrad merged 1 commit into
masterfrom
patch_ci

Conversation

@pythonbrad

@pythonbrad pythonbrad commented Jul 24, 2026

Copy link
Copy Markdown
Member

Related issues

Change

  • add a verification on the GH action, to enforce the maximum number of lines restriction.

Summary by CodeRabbit

  • Chores
    • Added an automated validation check to ensure TOML configuration files remain within the supported size limit.
    • Updated the continuous integration workflow so this validation runs before dependency and toolchain setup.
    • Builds now fail early when a TOML file exceeds 100,000 lines, providing faster and clearer feedback.

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.
@pythonbrad pythonbrad self-assigned this Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The CI workflow now validates that TOML files do not exceed 100,000 lines before running dependency installation, Rust toolchain/cache setup, and afrim installation.

Changes

CI validation

Layer / File(s) Summary
TOML line-count validation and setup ordering
.github/workflows/check.yml
Adds a TOML file size check that fails above 100,000 lines and moves dependency, Rust, and afrim setup steps after it.

Estimated code review effort: 2 (Simple) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adding a CI check to enforce a maximum line count for datasets/files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch patch_ci

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3e5ec7b and 4b42ed5.

📒 Files selected for processing (1)
  • .github/workflows/check.yml

Comment on lines +25 to +27
- 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 }' {} +

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚀 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 . || true

Repository: 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.

Comment on lines 33 to 36
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 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/**' || true

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


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

@pythonbrad
pythonbrad merged commit 6f0176f into master Jul 24, 2026
2 checks passed
@pythonbrad
pythonbrad deleted the patch_ci branch July 24, 2026 20:08
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.

1 participant