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

Improve Docker tag selection #4

Open
1 task done
Supereg opened this issue Aug 31, 2023 · 1 comment
Open
1 task done

Improve Docker tag selection #4

Supereg opened this issue Aug 31, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Supereg
Copy link
Member

Supereg commented Aug 31, 2023

Problem

Currently, we always pull the latest docker image for SwiftLint. This might cause unwanted breaking changes, as the Docker image is based on the latest changes in the main branch.
We choose this way originally to not have an action that you always have to manually upgrade, even for minor versions, but that automatically updates to the latest release of SwiftLint. This becomes a problem though with the latest tag if the "latest version" isn't even available and you fail to locally reproduce the issue.

Solution

Use a tagged image as available on GitHub: https://github.com/realm/SwiftLint/pkgs/container/swiftlint.
Ideally, we can automatically determine the latest tag. At the same time we could aim for customizability to set a certain major or minor version limit or even force a specific SwiftLint version.

Additional context

SwiftLint is using semantic versioning. They also publish prerelease version tagged like 0.51.0-rc.2. It would make sense to employ a library like semver to allow for flawless computation of version labels.

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@Supereg Supereg added the enhancement New feature or request label Aug 31, 2023
@PSchmiedmayer
Copy link
Member

As the docker builds are currently failing, as reported by @vishnuravi:

I think that the actual solution would be fixing this in the SwiftLint repo: https://github.com/realm/SwiftLint/blob/main/.github/workflows/docker.yml. The latest tag should be only applied if it is an actual release, and if not, it should just use, e.g., a main tag or something like that.

You can pass multiple tags into the GitHub action that pushed the image as documented here: https://docs.docker.com/build/ci/github-actions/manage-tags-labels/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants