Skip to content

Conversation

banesullivan
Copy link
Contributor

Same as pyOpenSci/pyopensci.github.io#603

This opts into automatically fixing PRs with pre-commit CI and removes pre-commit/action from the GitHub Actions workflows

  • The pre-commit/action GitHub Action is in maintenance only mode and they recommend swithing to pre-commit CI
  • We previously used pre-commit/action to automatically reformat the YAML data files generated during the automated data update jobs.
  • This PR will instead have those jobs automatically update the data, then pre-commit will automatically fix the formatting as a second commit.

This will remove the confusing error annotation we're seeing on the data update CI jobs since the pre-commit check technically fails since it reformats the YAML data files after they are generated

Copy link

codecov bot commented Mar 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.22%. Comparing base (8192230) to head (fa82593).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #273   +/-   ##
=======================================
  Coverage   80.22%   80.22%           
=======================================
  Files          10       10           
  Lines         713      713           
  Branches       92       92           
=======================================
  Hits          572      572           
  Misses        131      131           
  Partials       10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@willingc willingc requested review from Copilot and willingc March 30, 2025 22:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR opts into automatically fixing pull requests using pre-commit CI and removes the usage of the now-maintenance-only pre-commit/action GitHub Action from the workflows.

  • Enables autofix PRs and adds a custom commit message in the pre-commit configuration.
  • Removes the pre-commit/action step from the test-update-contribs workflow.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.pre-commit-config.yaml Updates CI settings to enable autofixing with a custom commit message.
.github/workflows/test-update-contribs.yml Removes the pre-commit/action step as part of the migration to pre-commit CI.

Copy link
Collaborator

@willingc willingc left a comment

Choose a reason for hiding this comment

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

Thanks @banesullivan

@willingc willingc merged commit 208cb80 into pyOpenSci:main Mar 30, 2025
4 checks passed
@lwasser
Copy link
Member

lwasser commented Mar 31, 2025

hey @banesullivan we intentionally don't use the autofix pr's for pre-commit CI because in our experience, they cause contributor problems. If the pr is fixed but we review a pr and contributors need to make changes, they need to know to force push to overwrite the PR OR to pull things down.

i'm happy to autoimplement pre-commit ci for the contributor pr's but i think it's not a good idea for the rest of the website as we've run into too many issues with it. is there a way to only run pre-commit ci on specific pr's triggered by CI?

@banesullivan
Copy link
Contributor Author

precommit CI's docs have:

(optional, default: true) whether to autofix pull requests. when disabled, comment / label "pre-commit.ci autofix" to a pull request to manually trigger auto-fixing.

So if we have the CI job that creates the PR also apply the `"pre-commit.ci autofix" label or comment that, then we could just do it for these PRs

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.

3 participants