Skip to content

Conversation

@Xeratec
Copy link
Member

@Xeratec Xeratec commented Feb 5, 2026

This PR unifies the linting and formatting with pre-commit. Before, we used a mixture of pre-commit and custom-installed tools. However, this could lead to version inconsistencies between different users and the CI.

I suggest to only look at 563138b. The other commit just reformatted all the files.

Changed

  • Switch CI to use pre-commit for linting
  • Update contributing guide
  • Adjust Make targets
  • Formatted all files

Fixed

  • Fix missing dependency in pre-commit-config

PR Merge Checklist

  1. The PR is rebased on the latest devel commit and pointing to devel.
  2. Your PR reviewed and approved.
  3. All checks are passing.
  4. The CHANGELOG.md file has been updated.
  5. If the docker was modified, change back its link after review.

@Xeratec Xeratec added this to the Release 0.2.2 milestone Feb 5, 2026
@Xeratec Xeratec self-assigned this Feb 5, 2026
@Xeratec Xeratec requested a review from Victor-Jung as a code owner February 5, 2026 09:46
@Xeratec Xeratec added this to Deeploy Feb 5, 2026
@Xeratec Xeratec added the Feature Addition of new features label Feb 5, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Warning

Rate limit exceeded

@Xeratec has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 55 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Replaces matrix/concurrency CI lint workflow with a single ubuntu-latest job running pre-commit; pins reuse==6.2.0 for the reuse pre-commit hook; updates Makefile and CONTRIBUTING to use pre-commit; plus minor formatting and docstring edits across templates, tests, and configs.

Changes

Cohort / File(s) Summary
CI / Workflow
​.github/workflows/ci-lint.yml
Removed inputs and concurrency; removed select-env job and matrix; added a single ubuntu-latest job that sets up Python 3.11, installs pre-commit, runs pre-commit --all-files --show-diff-on-failure, and adds a git-status debug step.
Pre-commit config
.pre-commit-config.yaml
Added additional_dependencies: ["reuse==6.2.0"] to the local reuse hook entry.
Makefile & CONTRIBUTING
Makefile, CONTRIBUTING.md
Removed lint target and per-tool formatting commands; format now delegates to pre-commit; CONTRIBUTING rewritten to document pre-commit setup and hook management.
Templates / Codegen
Deeploy/Targets/PULPOpen/Templates/FloatLayernormTemplate.py, Deeploy/Targets/PULPOpen/Templates/SGDTemplate.py
FloatLayernormTemplate: adjusted chunk-size calculation to include remainder when seq_length isn't divisible by NUM_CORES. SGDTemplate: whitespace-only formatting change.
Tests & Test utils
DeeployTest/testUtils/..., DeeployTest/test_dmas.py, DeeployTest/test_platforms.py
Whitespace and docstring formatting changes across multiple test utilities and tests; no behavioral changes.
Developer tooling & configs
.vscode/launch.json, pytest.ini, Container/Dockerfile.deeploy, CHANGELOG.md
Minor formatting/whitespace edits (JSON spacing, pytest addopts, removed trailing space in Dockerfile ENV). CHANGELOG updated to note pre-commit CI change.

Sequence Diagram(s)

sequenceDiagram
    actor Developer
    participant GHA as GitHub Actions
    participant Runner as CI Runner
    participant PC as Pre-commit
    participant Hooks as Hook Tools

    Developer->>GHA: Push / Open PR
    GHA->>Runner: Start job (ubuntu-latest)
    Runner->>Runner: Checkout code
    Runner->>Runner: Setup Python 3.11
    Runner->>Runner: pip install --upgrade pip pre-commit
    Runner->>PC: Run pre-commit --all-files --show-diff-on-failure
    activate PC
    PC->>Hooks: Invoke configured hooks (reuse, formatters, linters)
    activate Hooks
    Hooks-->>PC: Return results (pass/fail, diffs)
    deactivate Hooks
    PC-->>Runner: Exit status and diffs
    deactivate PC
    Runner->>Runner: git status (debug)
    alt All hooks pass
        Runner-->>GHA: Job succeeds
        GHA-->>Developer: CI success
    else Hooks found issues
        Runner-->>GHA: Job fails with diff output
        GHA-->>Developer: CI failed (diff)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • lukamac
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Use Pre-Commit in CI' directly reflects the main objective of the PR: switching CI to use pre-commit for linting instead of custom tools.
Description check ✅ Passed The description clearly explains the purpose (unifying linting with pre-commit), the changes made, and issues fixed, all directly related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

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

Copy link
Contributor

@diaconuccalin diaconuccalin left a comment

Choose a reason for hiding this comment

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

The branch needs to be rebased to the newest devel. Otherwise, LGTM, useful little feature, thanks!

@Xeratec Xeratec force-pushed the pr/pre-commit-ci branch 2 times, most recently from 2cfc54f to a89d008 Compare February 6, 2026 14:37
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

🤖 Fix all issues with AI agents
In @.github/workflows/ci-lint.yml:
- Around line 28-30: Replace the workflow step referencing "uses:
actions/setup-python@v4" with the v5 version: update the action invocation to
"actions/setup-python@v5" so the workflow uses Node.js 20; locate the step that
currently says uses: actions/setup-python@v4 in the CI workflow and change it to
`@v5`, then run or validate the workflow lint to ensure no other inputs need
adjustment for the newer action.
🧹 Nitpick comments (2)
.github/workflows/ci-lint.yml (2)

25-25: fetch-depth: 0 is unnecessary for pre-commit run --all-files.

Pre-commit with --all-files operates on the working tree, not git history. A shallow clone (the default fetch-depth: 1) is sufficient and faster. Full history cloning adds CI time for no benefit here.

Proposed fix
       - name: Checkout Repo
         uses: actions/checkout@v4
-        with:
-          fetch-depth: 0

32-35: Consider pinning pre-commit version and caching hook environments.

Neither the pre-commit CLI version nor the hook virtual environments are pinned or cached. This can cause non-reproducible CI runs and slower execution.

Example: pin version and add caching
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          pip install pre-commit
+          pip install pre-commit==4.1.0

+      - name: Cache pre-commit hooks
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/pre-commit
+          key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

@Xeratec Xeratec moved this to Need Reviewer in Deeploy Feb 6, 2026
Copy link
Member

@Victor-Jung Victor-Jung left a comment

Choose a reason for hiding this comment

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

LGTM just one small question for you.

- Switch CI to use pre-commit for linting
- Add missing dependency in pre-commit-config
- Update contributing guide
- Adjust Make targets
@Xeratec Xeratec moved this from Need Reviewer to Ready for Merge in Deeploy Feb 6, 2026
@Xeratec Xeratec merged commit 8595539 into pulp-platform:devel Feb 6, 2026
47 checks passed
@Xeratec Xeratec deleted the pr/pre-commit-ci branch February 6, 2026 21:26
@github-project-automation github-project-automation bot moved this from Ready for Merge to Done in Deeploy Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Addition of new features

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants