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

Add latest tag and make image name variable #39

Closed
wants to merge 1 commit into from
Closed

Add latest tag and make image name variable #39

wants to merge 1 commit into from

Conversation

wuast94
Copy link

@wuast94 wuast94 commented Oct 3, 2023

Just added a latest tag for atomatic updates and changed the static dockerhub name to a variable

Copy link
Owner

@jgosmann jgosmann left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. It is possible to invoke the docker-publish workflow for any version published to PyPI. Thus, I think the latest tag should only be assigned if the workflow has been invoked for the latest version.

The following approach could be taken to determine whether a specific version is the latest version:

  1. Do a GET request against https://pypi.org/simple/dmarc-metrics-exporter with an Accept: application/vnd.pypi.simple.v1+json header. (Cp. PEP 691)
  2. Extract the versions key from the JSON. (Cp. PEP 700)
  3. Determine the latest version from the extracted list. As we only need to handle version formats used in this project, the version numbers can be assumed to be semantic versioning for the most part. There is the version 0.5.1.dev0 which is a prerelease, but does not follow the semantic versioning convention to mark pre-releases (it should be 0.5.1-dev0.
  4. Only tag the the Docker image with latest if it has been built for the latest version.

@wuast94 wuast94 closed this by deleting the head repository Oct 12, 2023
@jgosmann
Copy link
Owner

This has now been implemented: 36defc5 and 6b6683e

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 this pull request may close these issues.

2 participants