pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

Multiple Tags keeps pre-commit-ci switching between them #119

Closed feluelle closed 2 years ago

feluelle commented 2 years ago

Hey,

I am having the following issue with pre-commit hook of https://github.com/crate-ci/typos (I believe) due to multiple tags. Every release two (or more) new tags get created e.g. typos-v0.9.1 and v1.7.1. Pre-commit-ci keeps switching between these tags.

An example can be found here.

asottile commented 2 years ago

hmmm so the logic for this did change recently so perhaps that's what's responsible for the flip -- though it should be constant -- is it continually changing?

asottile commented 2 years ago

pre-commit 2.18.0 changed the autoupdate tag selection to be more deterministic: https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md#2180---2022-04-02

feluelle commented 2 years ago

Could be that this fixed it, indeed. The newer PR makes sense so far. I will report back when I see it again.

asottile commented 2 years ago

alrighty -- let me know if you see it being problematic!

feluelle commented 2 years ago

Hey @asottile,

https://github.com/crate-ci/typos made a new release but with several different tags. Can we tell pre-commit.ci to only consider specific tags? Like ^v for example? Or (even better?) only consider tags that are part of a release like https://github.com/crate-ci/typos/releases/tag/v1.7.3 ?

Another example I faced, it does not downgrade, but it doesn't use the tag I like it to use.

How about an option like

released: true
asottile commented 2 years ago

there's nothing special about pre-commit.ci, it just does what pre-commit does

feluelle commented 2 years ago

But that's not true. Pre-commit.ci is the one that does update the tag and I want it to not update to a different tag.

In pre-commit I set the tag myself.

Edit: Sorry I mean the revision.

asottile commented 2 years ago

pre-commit.ci just does what pre-commit autoupdate does

feluelle commented 2 years ago

Nice, thanks 🙏 I didn't know that existed. Do you think it make sense to add another option to be able to control better which Tag to choose?

If you think it makes sense, I can reopen it in the other repo. 😊

asottile commented 2 years ago

"auto" means no options -- what you're suggesting also doesn't make sense there's no concept of a "release" in git -- you can see the previous discussion caused by this same typos repo here: https://github.com/pre-commit/pre-commit/issues/2366

feluelle commented 2 years ago

I mean tags that got created on GitHub release or are associated with a release.

asottile commented 2 years ago

yes, there's no such thing in "git" -- github is a hosted service that provides git, pre-commit does not care

feluelle commented 2 years ago

But yeah if you only use git functionality, release would not work. But how about the other suggestion? Sth like ^v and have include/exclude mechanism?

asottile commented 2 years ago

Sth?

asottile commented 2 years ago

and no, autoupdate is "go to the latest tag" not "filter around for tags"

feluelle commented 2 years ago

It can be the latest but with applying a filter. The filter is optional.