Skip to content

ci test: use latest tag instead of version tag#74

Merged
kou merged 3 commits intopgroonga:mainfrom
otegami:ci-test-use-latest-tag
Oct 4, 2025
Merged

ci test: use latest tag instead of version tag#74
kou merged 3 commits intopgroonga:mainfrom
otegami:ci-test-use-latest-tag

Conversation

@otegami
Copy link
Contributor

@otegami otegami commented Oct 2, 2025

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
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.

## 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.
@komainu8
Copy link
Member

komainu8 commented Oct 3, 2025

Can we remove the "Detect the latest release" job?
Because we don't use LATEST_VERSION as docker images's tag by this modification.

PGPASSWORD: pgroonga
run: |
tag="${LATEST_VERSION}-${{ matrix.id }}"
tag="latest-${{ matrix.id }}"
Copy link
Member

Choose a reason for hiding this comment

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

Can we detect PGroonga is released but Docker image release is forgotten by this?

Copy link
Contributor Author

@otegami otegami Oct 3, 2025

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

The build workflow does not execute periodically.
So, we don't detect Docker image release is forgotten probably.

Copy link
Member

Choose a reason for hiding this comment

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

build.ymlはcronで動いていないから関係ないんじゃない?

このワークフローはPGroongaをリリースしたけどDockerイメージはリリースし忘れていることを検出するために追加されました。
#18

たとえば、今は、PGroonga 4.0.4をリリースしたけど、4.0.4用のDockerイメージはリリースしていないですよね?そういうときにエラーになってDockerイメージのリリース忘れを気づけるという寸法です。このワークフローが定期実行されているのはそのためです。

schedule:
- cron: |
0 0 * * *

もし、ここで4.0.4-XXXタグじゃなくて常にlatest-XXXタグを使うと、4.0.4のDockerイメージをリリースしていないことを気づけなくなりますよね。それはこのワークフローをグリーンにするでしょうが、本来確認したかったことを確認できなくなっていませんか?

Copy link
Member

Choose a reason for hiding this comment

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

やるなら、scheduleのときは常に4.0.4-XXXで、push/pull_requestのときはlatest-XXXも許容するとかじゃない?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

すみません。
次のように認識していて、完全に勘違いしていました。

  • pgroonga/dockerのリリースはしたが、対象のイメージをリリースできていないことを検知したい

そうではなくて確認したいのは、次である。

  • pgroonga/dockerをリリースできていないことを検知したい。

Copy link
Member

Choose a reason for hiding this comment

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

「pgroonga/dockerのリリース」と「対象のイメージをリリース」って何が違うの?

Copy link
Member

Choose a reason for hiding this comment

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

私はタグを打つことがpgroonga/dockerのリリースで、タグを打ったらDockerイメージもリリースされるようになっているので、違いがないように感じます。

Copy link
Contributor Author

@otegami otegami Oct 3, 2025

Choose a reason for hiding this comment

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

はい。今は違いはない認識です。
私の読解力の問題で、「タグを打ったがDockerイメージがリリースされていない」のを検知したいのかなと捉えてしまっていました。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix: d8142ec schedule実行のときは、"4.0.4-XXX"のイメージを確認し、
そうでないときは、"latest"をみるように変更してみました。

@otegami
Copy link
Contributor Author

otegami commented Oct 3, 2025

Can we remove the "Detect the latest release" job?
Because we don't use LATEST_VERSION as docker images's tag by this modification.

We still use it to check the PGroonga version at the last step.

[ "${LATEST_VERSION}" = "${pgroonga_version}" ]

@otegami otegami force-pushed the ci-test-use-latest-tag branch from 608cfdc to 978bdc9 Compare October 3, 2025 02:22
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.
@otegami otegami force-pushed the ci-test-use-latest-tag branch from 978bdc9 to d8142ec Compare October 3, 2025 02:23
PGPASSWORD: pgroonga
run: |
tag="${LATEST_VERSION}-${{ matrix.id }}"
if [ ${{ github.event_name }} = "schedule" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

We should use environment variable as much possible to reduce evaluation timing:

Suggested change
if [ ${{ github.event_name }} = "schedule" ]; then
if [ ${GITHUB_EVENT_NAME} = "schedule" ]; then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's because we should keep the evaluation phase short
and write minimal code.
@kou kou merged commit 6429424 into pgroonga:main Oct 4, 2025
39 of 54 checks passed
@otegami otegami deleted the ci-test-use-latest-tag branch October 5, 2025 03:40
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.

3 participants