ci test: use latest tag instead of version tag#74
Conversation
## Issue
The following error is raised when we want to test
no-release images as follows.
```
tag="${LATEST_VERSION}-debian-17"
docker_image="groonga/pgroonga:${tag}"
docker run \
-d \
-e POSTGRES_DB=pgroonga \
-e POSTGRES_PASSWORD=${PGPASSWORD} \
-e POSTGRES_USER=pgroonga \
-p 127.0.0.1:5432:5432 \
${docker_image}
shell: /usr/bin/bash -e {0}
env:
LATEST_VERSION: 4.0.4
PGPASSWORD: pgroonga
Unable to find image 'groonga/pgroonga:4.0.4-debian-17' locally
docker: Error response from daemon: manifest for groonga/pgroonga:4.0.4-debian-17 not found: manifest unknown: manifest unknown
Run 'docker run --help' for more information
Error: Process completed with exit code 125.
```
ref: https://github.com/pgroonga/docker/actions/runs/18187593348/job/51775157123
## Cause
The version specific tag (e.g., 4.0.4-debian-16)
doesn't exist until after release, but the latest tag
is available when testing.
ref: https://github.com/pgroonga/docker/blob/main/.github/workflows/build.yml#L63-L76
## Fix
We will use the latest tag instead of tag from this PR.
And then, we can release the latest image even before
releasing the new Docker image version.
|
Can we remove the "Detect the latest release" job? |
.github/workflows/test.yml
Outdated
| PGPASSWORD: pgroonga | ||
| run: | | ||
| tag="${LATEST_VERSION}-${{ matrix.id }}" | ||
| tag="latest-${{ matrix.id }}" |
There was a problem hiding this comment.
Can we detect PGroonga is released but Docker image release is forgotten by this?
There was a problem hiding this comment.
I think we can detect this case at the build workflow because it uses the released Docker image.
If we added this change, we cannot check version specific tag (like 4.0.4-debian-17) after releasing it because its tag might be different from the latest one.
https://github.com/pgroonga/docker/blob/main/.github/workflows/build.yml
There was a problem hiding this comment.
The build workflow does not execute periodically.
So, we don't detect Docker image release is forgotten probably.
There was a problem hiding this comment.
build.ymlはcronで動いていないから関係ないんじゃない?
このワークフローはPGroongaをリリースしたけどDockerイメージはリリースし忘れていることを検出するために追加されました。
#18
たとえば、今は、PGroonga 4.0.4をリリースしたけど、4.0.4用のDockerイメージはリリースしていないですよね?そういうときにエラーになってDockerイメージのリリース忘れを気づけるという寸法です。このワークフローが定期実行されているのはそのためです。
docker/.github/workflows/test.yml
Lines 9 to 11 in df4ef88
もし、ここで4.0.4-XXXタグじゃなくて常にlatest-XXXタグを使うと、4.0.4のDockerイメージをリリースしていないことを気づけなくなりますよね。それはこのワークフローをグリーンにするでしょうが、本来確認したかったことを確認できなくなっていませんか?
There was a problem hiding this comment.
やるなら、scheduleのときは常に4.0.4-XXXで、push/pull_requestのときはlatest-XXXも許容するとかじゃない?
There was a problem hiding this comment.
すみません。
次のように認識していて、完全に勘違いしていました。
- pgroonga/dockerのリリースはしたが、対象のイメージをリリースできていないことを検知したい
そうではなくて確認したいのは、次である。
- pgroonga/dockerをリリースできていないことを検知したい。
There was a problem hiding this comment.
「pgroonga/dockerのリリース」と「対象のイメージをリリース」って何が違うの?
There was a problem hiding this comment.
私はタグを打つことがpgroonga/dockerのリリースで、タグを打ったらDockerイメージもリリースされるようになっているので、違いがないように感じます。
There was a problem hiding this comment.
はい。今は違いはない認識です。
私の読解力の問題で、「タグを打ったがDockerイメージがリリースされていない」のを検知したいのかなと捉えてしまっていました。
There was a problem hiding this comment.
fix: d8142ec schedule実行のときは、"4.0.4-XXX"のイメージを確認し、
そうでないときは、"latest"をみるように変更してみました。
We still use it to check the PGroonga version at the last step. docker/.github/workflows/test.yml Line 97 in df4ef88 |
608cfdc to
978bdc9
Compare
On scheduled runs (daily cron), use version-specific tag to verify the released version works correctly. On push/PR runs, use latest tag since the version-specific tag doesn't exist yet before release.
978bdc9 to
d8142ec
Compare
.github/workflows/test.yml
Outdated
| PGPASSWORD: pgroonga | ||
| run: | | ||
| tag="${LATEST_VERSION}-${{ matrix.id }}" | ||
| if [ ${{ github.event_name }} = "schedule" ]; then |
There was a problem hiding this comment.
We should use environment variable as much possible to reduce evaluation timing:
| if [ ${{ github.event_name }} = "schedule" ]; then | |
| if [ ${GITHUB_EVENT_NAME} = "schedule" ]; then |
There was a problem hiding this comment.
fix: [2bcf376] (2bcf376) Thank you so much.
ref: https://docs.github.com/ja/actions/reference/workflows-and-actions/variables
ref: groonga/groonga#2277 (comment)
It's because we should keep the evaluation phase short and write minimal code.
Issue
The following error is raised when we want to test no-release images as follows.
ref: https://github.com/pgroonga/docker/actions/runs/18187593348/job/51775157123
Cause
The version specific tag (e.g., 4.0.4-debian-16)
doesn't exist until after release, but the latest tag is available when testing.
ref: https://github.com/pgroonga/docker/blob/main/.github/workflows/build.yml#L63-L76
ref: https://hub.docker.com/r/groonga/pgroonga/tags
Fix
We will use the latest tag instead of tag from this PR. And then, we can release the latest image even before releasing the new Docker image version.