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

Docker latest_release is pointing to an alpha version #3453

Closed
babyhuey opened this issue Dec 19, 2022 · 10 comments · Fixed by #3461
Closed

Docker latest_release is pointing to an alpha version #3453

babyhuey opened this issue Dec 19, 2022 · 10 comments · Fixed by #3461
Assignees
Labels
C: integrations Editor plugins and other integrations C: maintenance Related to project maintenance, e.g. CI, testing, policy changes, releases C: packaging Installation and packaging of Black help wanted Extra attention is needed T: bug Something isn't working

Comments

@babyhuey
Copy link

The latest docker release on docker hub is pointing to an alpha version. I would have expected latest_release to be the latest release, and not the very latest on git.

Is there a way to fix this to go back to 22.12.0?

@babyhuey babyhuey added the T: bug Something isn't working label Dec 19, 2022
@matthewarmand
Copy link
Contributor

Yep seems busted, according to the docs for the official Docker image the latest_release tag should be:

tag created when a new version of Black is released. Recommended for users who want to use released versions of Black. It maps to the latest release of Black.

The latest release of black linked above is 22.12.0 at time of writing, and the latest_release Docker image gives:

$ docker pull pyfound/black:latest_release && docker run -it pyfound/black:latest_release black --version
black, 23.1a1 (compiled: no)
Python (CPython) 3.11.1   

@matthewarmand
Copy link
Contributor

I'm not an expert on Github Workflows, so I could very easily be wrong here, but it seems to me like the trigger line for this docker publish might be the problem.

        if: ${{ github.event_name == 'release' && github.event.action == 'published' }}

This will run on every published release, regardless of latest vs pre_release status, no? Does it also need to include something indicating pre_release == 'false' or something like that? Just going off the release API documentation

@matthewarmand
Copy link
Contributor

matthewarmand commented Dec 19, 2022

According to this support article, that line may need to change to something like:

        if: ${{ github.event_name == 'release' && github.event.action == 'published' && !github.event.release.prerelease }}

But then later on in the thread someone mentions a workflow they have that does not run on preleases, and gives the exact line that currently exists in Black's workflow. So maybe this was an accidental manual push? Or the behavior has changed potentially

@matthewarmand
Copy link
Contributor

Scratch the "manual push", this was clearly triggered by CI: https://github.com/psf/black/actions/runs/3725518068/jobs/6318369959#step:8:176. So seems to me the latest_release trigger in the docker workflow needs to change.

@JelleZijlstra
Copy link
Collaborator

@cooperlees do you know how to yank the docker release for 23.1a1? Or at least mark it as not the latest release.

@matthewarmand
Copy link
Contributor

(I'm not who you asked so sorry for the noise but since I'm here anyway) The easiest way is probably for someone on the project with Dockerhub access to re-push the 22.12.0 image to the latest_release tag.

@babyhuey babyhuey reopened this Dec 19, 2022
@cooperlees cooperlees self-assigned this Dec 19, 2022
@cooperlees
Copy link
Collaborator

cooperlees commented Dec 19, 2022

Reran the Docker action: https://github.com/psf/black/actions/runs/3658832710/jobs/6334595544

Unfortunately people will have to manually use 23.1a1 to test alpha, but not the worst scenario. I will try find time to cleanup the action for this new alpha workflow so we can't do this again.

PRs welcome if you have a potential fix too.

@ichard26 ichard26 added help wanted Extra attention is needed C: packaging Installation and packaging of Black C: maintenance Related to project maintenance, e.g. CI, testing, policy changes, releases C: integrations Editor plugins and other integrations labels Dec 19, 2022
@ichard26 ichard26 added this to the Release 23.1.0 milestone Dec 19, 2022
cooperlees added a commit that referenced this issue Dec 19, 2022
- When we do a pre-release lets not move the latest_release tag
  - This tag should only move on official real releases

Fixes #3453
cooperlees added a commit that referenced this issue Dec 20, 2022
* Do not move docker `latest_release` tag for Pre-Releases

- When we do a pre-release lets not move the latest_release tag
  - This tag should only move on official real releases

Fixes #3453

* Make it prettier - TIL we format our yaml
@matthewarmand
Copy link
Contributor

FYI @cooperlees if you wanted to add something to support the Alpha image workflow, given the behavior we've seen in this issue it might be as easy as adding another job to the docker workflow:

     - name: Build and push latest_alpha tag
        if:
          ${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease }}
        uses: docker/build-push-action@v3
        with:
          context: .
          platforms: linux/amd64,linux/arm64
          push: true
          tags: pyfound/black:latest_alpha

Could call it latest_alpha, latest_prerelease, whatever. Then a docs update too, etc

@cooperlees
Copy link
Collaborator

FYI @cooperlees if you wanted to add something to support the Alpha image workflow, given the behavior we've seen in this issue it might be as easy as adding another job to the docker workflow:

     - name: Build and push latest_alpha tag
        if:
          ${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease }}
        uses: docker/build-push-action@v3
        with:
          context: .
          platforms: linux/amd64,linux/arm64
          push: true
          tags: pyfound/black:latest_alpha

Could call it latest_alpha, latest_prerelease, whatever. Then a docs update too, etc

Thanks for the good ideas. Will take into consideration and probably implement! PR welcome. More tags won't hurt.

@matthewarmand
Copy link
Contributor

PR welcome. More tags won't hurt.

Have a gander: #3465

hugovk pushed a commit to hugovk/black that referenced this issue Jan 16, 2023
* Do not move docker `latest_release` tag for Pre-Releases

- When we do a pre-release lets not move the latest_release tag
  - This tag should only move on official real releases

Fixes psf#3453

* Make it prettier - TIL we format our yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: integrations Editor plugins and other integrations C: maintenance Related to project maintenance, e.g. CI, testing, policy changes, releases C: packaging Installation and packaging of Black help wanted Extra attention is needed T: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants