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

fix(ci): Correctly match and tag containers #252

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

karlskewes
Copy link
Contributor

Release tags have been vM.m which wasn't being matched by the GHA docker/metadata-action@v3 due to the v prefix.
v prefix is common in many projects though.

Warning: v1.2 is not a valid semver. More info: https://semver.org/

See: https://github.com/docker/metadata-action#typesemver

I don't think a vM tag is useful so removed it.
This GHA only runs on tag or master branch push so generating a PR tag is unnecessary. Removed.

GHA log for v1.2 tag push: https://github.com/salesforce/sloop/actions/runs/3651605823/jobs/6169012887

Closes #164

Part of #245 "On git tag creation"

@karlskewes
Copy link
Contributor Author

karlskewes commented Jan 30, 2023

Push event payload (testing git tag vM.m):

$ cat event.json 
{
  "ref": "refs/tags/v1.3"
}

Run act local testing (on fork, hence GHCR repository):

$ act -j publish --eventpath event.json -s GITHUB_TOKEN="$GITHUB_TOKEN"
<snip>

[Publish/publish]   ❓  ::group::JSON output
| {
|   "tags": [
|     "ghcr.io/karlskewes/sloop:v1.3",
|     "ghcr.io/karlskewes/sloop:sha-f38697c",
|     "ghcr.io/karlskewes/sloop:latest"
|   ],
|   "labels": {
|     "org.opencontainers.image.title": "sloop",
|     "org.opencontainers.image.description": "Kubernetes History Visualization",
|     "org.opencontainers.image.url": "https://github.com/karlskewes/sloop",
|     "org.opencontainers.image.source": "https://github.com/karlskewes/sloop",
|     "org.opencontainers.image.version": "v1.3",
|     "org.opencontainers.image.created": "2023-01-30T09:27:27.619Z",
|     "org.opencontainers.image.revision": "f38697cfc8b33851a166b69624038fc8ddb03e01",
|     "org.opencontainers.image.licenses": "BSD-3-Clause"
|   }
| }

Release tags have been `vM.m` which wasn't being matched by the GHA
`docker/metadata-action@v3` due to the `v` prefix.
`v` prefix is common in many projects though.
```
Warning: v1.2 is not a valid semver. More info: https://semver.org/
```
See: https://github.com/docker/metadata-action#typesemver

I don't think a `vM` tag is useful so removed it.
This GHA only runs on tag or master branch push so generating a PR tag is unnecessary. Removed.

GHA log for `v1.2` tag push: https://github.com/salesforce/sloop/actions/runs/3651605823/jobs/6169012887
@@ -28,10 +28,7 @@ jobs:
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we please fix annotation checks too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry which ones?

Unchanged files with check annotations

These? If so I think separate PR using go 1.16+ stdlib..

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see some files under the heading "Unchanged files with check annotations".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Righto, yes those are unrelated to this PR and started showing as warnings (not CI failure) when we added go vet checker.
See:

- name: Run go vet
# TODO: Enforce when possible.
run: |
go vet ./... || true

We chose not to enforce a clean go vet until someone got around to fixing the issues raised.

It would be simplest to fix the warnings but I was thinking it might be possible to drop the Afero dependency for the standard library embed package.
Maybe I do this as a separate PR when have time (probably soon 😅)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good. Lets fix them in a separate PR.

@sana-jawad sana-jawad merged commit 47a6e08 into salesforce:master Jan 30, 2023
@karlskewes karlskewes deleted the fix-gha-container branch January 30, 2023 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should we also release docker images with sloop release, would be easier for folks to deploy on docker
2 participants