GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add pre-commit.ci configurations to enable auto updates of hooks by seisman · Pull Request #3414 · GenericMappingTools/pygmt

Conversation

@seisman

@seisman seisman commented Aug 26, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Description of proposed changes

Run pre-commit autoupdate command in the Style Checks workflow, to check if there are new versions of pre-commit hooks. The workflow will fail if there are updates. Then we just need to open a PR to manually update the workflow.

Address #3374 (comment).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
seisman added 3 commits August 26, 2024 20:43
@seisman
Temporarily set pre-commit-hooks to old tag
9bcb445
@seisman
Autoupdate pre-commit hooks in the Style Checks workflow
24cc991
@seisman
Fail the workflow if there are newer hooks
657c50c
weiji14
weiji14 reviewed Aug 27, 2024
View reviewed changes
Comment thread .github/workflows/style_checks.yaml Outdated

- name: Check updates of pre-commit hooks
run: |
pre-commit autoupdate

@weiji14 weiji14 Aug 27, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Maybe run the autoupdate line only on cron jobs? So that PRs don't get slowed down by sudden Style Check changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@seisman seisman Aug 27, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

OK. I've added the if-condition so that the autoupdate command only runs on schedule or workflow_dispatch events. It means we have to check https://github.com/GenericMappingTools/pygmt/actions/workflows/style_checks.yaml to know if there are new versions for hooks. Maybe we should automatically open a PR if there are updates?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@weiji14 weiji14 Aug 27, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Maybe we should automatically open a PR if there are updates?

Maybe we could just use pre-commit.ci as was tried in #3283? The automation would require quite a bit of code to set up. Ideally we could use dependabot but looking at dependabot/dependabot-core#1524, it's still not working yet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@seisman seisman Aug 27, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm OK with enabling pre-commit.ci for auto update.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@weiji14 weiji14 Aug 27, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Ok, add these lines to .pre-commit-config.yaml :

# https://pre-commit.ci/#configuration
ci:
  autofix_prs: false
  autoupdate_schedule: quarterly

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@seisman seisman Aug 27, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The pre-commit.ci App is also installed https://github.com/GenericMappingTools/pygmt/settings/installations.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

weiji14 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
seisman added 6 commits August 27, 2024 15:39
@seisman
Add workflow_dispatch so the workflow can be triggered manually
4d2af04
@seisman
Enable the workflow in schedule or workflow_dispatch events
6458bb3
@seisman
Merge branch 'main' into ci/pre-commit
5dda2c2
@seisman
Revert changes in style checks workflow
359e1c9
@seisman
Revert temporary changes in .pre-commit-config.yaml
e789f55
@seisman
Add configurations for pre-commit.ci
6709bfa
@seisman seisman changed the title POC: CI: Update pre-commit hooks in the Style Checks workflow Add pre-commit.ci configurations to enable auto updates of hooks Aug 27, 2024
@seisman
seisman marked this pull request as ready for review August 27, 2024 09:30
@seisman seisman added the maintenance Boring but important stuff for the core devs label Aug 27, 2024
@seisman seisman added this to the 0.13.0 milestone Aug 27, 2024
weiji14
weiji14 approved these changes Aug 27, 2024
View reviewed changes
@seisman
seisman merged commit 9daa2cb into main Aug 27, 2024
@seisman
seisman deleted the ci/pre-commit branch August 27, 2024 09:36
@seisman

seisman commented Aug 27, 2024

Copy link
Copy Markdown
Member Author

pre-commit.ci fails in the main branch https://results.pre-commit.ci/run/github/85352251/1724751409.rGgeqA4fQ22hZH-xAZG-Nw, as mentioned in #3283 (comment).

It seems we can't change how files are cloned in pre-commit.ci and also can't disable pre-commit.ci in the main branch. I guess the only option is removing the chmod hook from .pre-commit-config.yaml and add it back to the style checks workflow.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman seisman mentioned this pull request Aug 27, 2024
CI: Skip the chmod hook in pre-commit.ci #3415
Merged
@weiji14 weiji14 mentioned this pull request Aug 27, 2024
Improve the release checklist based on experience with v0.13.0 release #3374
Merged
@weiji14 weiji14 mentioned this pull request Mar 3, 2026
Update .pre-commit-config.yaml hooks using dependabot #4435
Merged
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@weiji14 weiji14 weiji14 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

maintenance Boring but important stuff for the core devs

Projects

None yet

Milestone

0.13.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@seisman @weiji14
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.