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

How do I match GitHub action with stability policy? #3264

Closed
lofidevops opened this issue Sep 8, 2022 · 8 comments
Closed

How do I match GitHub action with stability policy? #3264

lofidevops opened this issue Sep 8, 2022 · 8 comments
Labels
T: documentation Improvements to the docs (e.g. new topic, correction, etc)

Comments

@lofidevops
Copy link

Is this related to a problem? Please describe.

The pages on stability policy and GitHub Actions are very clear. However, I don't think it's possible to enforce stability with GitHub actions.

Describe the solution you'd like

I would like to add uses: psf/black@2022 in my GitHub action, and have this be equivalent to black ~= 22.0 (or black < 23) in the developer toolchain. I believe this would require adding a 2022 tag, updating it on every release, then adding a 2023 tag for the first 23.x release.

Describe alternatives you've considered

  • Pin specific version in GitHub action, leave toolchain at ~= 22.0. When developer toolchain is updated to ~= 23.0, re-pin in GitHub action. Downside: chance of discrepancy between 22.x (GitHub) and 22.y (toolchain).
  • Similar options (e.g. switch toolchain to --preview in November/December) require even more coordination.
  • Do not pin GitHub action or toolchain. Downside: defeats the point of stability policy, which I assume is to prevent scrambling in early 2023.
  • Pin specific version of GitHub Action and toolchain. Dowside: must update for every single release.

Additional context

This is a professional team, so the goal is to eliminate non-critical technical alerts. It could be that the final alternative is the only viable solution. Or there's a simple solution I have missed :D

@lofidevops lofidevops added the T: documentation Improvements to the docs (e.g. new topic, correction, etc) label Sep 8, 2022
@Jackenmen
Copy link
Contributor

You can just set version argument in the action to <23. The stability policy only applies to the code style so what matters is Black version, not the action version.

@lofidevops
Copy link
Author

@jack1142 Ok, so this example adapted from the docs would work. Thanks!

- uses: psf/black@stable
  with:
    options: "--check --verbose"
    src: "./src"
    version: "<23"

@ichard26
Copy link
Collaborator

ichard26 commented Sep 8, 2022

I don't believe that will work right now since if the version option is provided == is simply prefixed, breaking version ranges. I'd be happy to change the action to be smarter (defaulting to == but instead adds nothing if there's a version specifier type marker).

@cooperlees
Copy link
Collaborator

@jack1142 Ok, so this example adapted from the docs would work. Thanks!

- uses: psf/black@stable
  with:
    options: "--check --verbose"
    src: "./src"
    version: "<23"

Can we add anything to our docs to make the clearer? If so PR will be accepted.

@Jackenmen
Copy link
Contributor

I don't believe that will work right now since if the version option is provided == is simply prefixed, breaking version ranges. I'd be happy to change the action to be smarter (defaulting to == but instead adds nothing if there's a version specifier type marker).

I assumed that it works based on the documentation in action.yml which says it uses PEP 440 version specifier, my bad for not checking the code :-)

@ichard26
Copy link
Collaborator

ichard26 commented Sep 8, 2022

Ugh that's unfortunate. Can't really break the pre-existing usages of the action though, the default has to be included.

@lofidevops
Copy link
Author

Reopened pending #3265

@lofidevops lofidevops reopened this Sep 9, 2022
@aaossa
Copy link
Contributor

aaossa commented Sep 23, 2022

I think this issue can be closed since the PR was merged recently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: documentation Improvements to the docs (e.g. new topic, correction, etc)
Projects
None yet
Development

No branches or pull requests

5 participants