Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction of mutable latest tag broke pre-commit auto-updates #170

Closed
ssbarnea opened this issue Jul 14, 2022 · 4 comments · Fixed by #171
Closed

Introduction of mutable latest tag broke pre-commit auto-updates #170

ssbarnea opened this issue Jul 14, 2022 · 4 comments · Fixed by #171

Comments

@ssbarnea
Copy link

ssbarnea commented Jul 14, 2022

Introduction of mutable latest tag broke pre-commit auto-updates because pre-commit will propose updating the version to latest and will no longer update it after that, even if the tag is moved to point to another commit.

That behavior is by design as pre-commit assumes that version tags are immutable or otherwise it will never be able to cache them.

[WARNING] The 'rev' field of repo 'https://github.com/streetsidesoftware/cspell-cli' appears to be a mutable reference (moving tag / branch). Mutable references are never updated after first install and are not supported. See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details. Hint: pre-commit autoupdate often fixes this.

There is a thread on https://twitter.com/sbarnea/status/1546778466821054465 related to this issue where the pre-commit author replied. Apparently there is something you can do to address the issue without having to remove the use of latest tag but that is really clear to me what needs to be done.

@Jason3S
Copy link
Contributor

Jason3S commented Jul 15, 2022

@ssbarnea,

It is common practice for GitHub Actions to publish (mutable) Major and Minor version tags in addition to the static full version tags. I was just following the same practice.

Apparently pre-commit cannot handle that and incorrectly offers latest.

I'm ok with removing the latest tag and no-longer updating the Major and Minor versions.

@Jason3S
Copy link
Contributor

Jason3S commented Jul 15, 2022

@ssbarnea,

The Major and Minor tags were added as a convenience for consumers, but since pre-commit cannot handle them, it doesn't make sense to keep updating them.

@ssbarnea
Copy link
Author

@Jason3S Thanks. To be honest, I had the same kind of problem with ansible-lint action and what I decided to do was to keep the github-action in a separated repository than the tool itself, so I can use latest there without adding it to the repository with hook definition.

Jason3S added a commit that referenced this issue Jul 15, 2022
@Jason3S
Copy link
Contributor

Jason3S commented Jul 15, 2022

@ssbarnea,

I have published v6.2.0. It should behave nicely with pre-commit.

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 a pull request may close this issue.

2 participants