Release workflow: tags v0.10.0–v0.11.2 point to main, not to the commit that the release was built from

オープン 初心者向け
#3,452 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
git, github-actions, java
領域
ci-cd, release

調査の方向性

ワークフローが gh release create を実行する .github/workflows/release.yml の70行目あたりを読んでください。ワークフローがリリース成果物のビルドに使用したコミットをどのように特定するかを確認し、リリースタグがそのコミットを指すようにしてください。コマンドがビルドに使われたコミットでリリースを作成し、結果のタグがJARの SCM-Revision と一致すれば完了です。既存のタグを移動するかどうかはメンテナーの判断です。

索引モデルが issue の本文から書いたものです。

説明

tests

Description

The release tags v0.10.0, v0.11.0, v0.11.1 and v0.11.2 do not point to the source of the released artifacts. Each tag points to the main commit at the time of the release, but the Release workflow ran on a release branch and built the jars from that branch. The SCM-Revision in the manifest of each published jar names the release-branch commit:

Release Tag points to SCM-Revision of the client-v2 jar on Maven Central
v0.11.2 a00a479b8 (main) c3b63dafc (branch v0.11.0)
v0.11.1 dd7b8765b (main) 3a7dff39d (branch v0.11.0)
v0.11.0 7f2cb5787 (main) c1834d085 (branch v0.11.0)
v0.10.0 6b9cb69f3 (main) 57aacb139 (branch v0.10.0)
v0.9.9 (contrast) 2ac7e110f 2ac7e110f

Effects:

  • git checkout v0.11.2 and the "Source code" archives of the GitHub release give main source (VERSION is 0.12.0-rc1). It differs from the released 0.11.2 source in 170 files.
  • git tag --contains <commit> gives wrong answers in both directions: a change that is only on main shows as released, and a fix that is only on the release branch is in no tag.
Steps to reproduce
  1. In a clone of this repository: git fetch origin --tags.
  2. Download the released jar: curl -sLO https://repo1.maven.org/maven2/com/clickhouse/client-v2/0.11.2/client-v2-0.11.2.jar.
  3. Run the commands of the log below.
Error Log or Exception StackTrace
$ git rev-parse --short=10 'v0.11.2^{commit}'
a00a479b8b
$ git show v0.11.2:VERSION
0.12.0-rc1
$ unzip -p client-v2-0.11.2.jar META-INF/MANIFEST.MF | grep SCM-Revision
SCM-Revision: c3b63dafc2a81c233ff6899109b97911ec9b98ab
$ git show c3b63dafc2a8:VERSION
0.11.2
$ git tag --contains 69c9b36c7   # merge of #3266 (Client.setNetworkTimeout), not in the 0.11.1 or 0.11.2 jars
v0.11.1
v0.11.2
$ git tag --contains cd6b74cc6   # "Fixed transaction compatibility of V1 ...", in the 0.11.1 and 0.11.2 jars
$ gh api repos/ClickHouse/clickhouse-java/releases/tags/v0.11.2 --jq .target_commitish
main
Expected Behaviour

Each tag vX.Y.Z points to the commit that the Release workflow built for X.Y.Z (the SCM-Revision of its jars), as v0.9.9 does.

Root cause: .github/workflows/release.yml:70 (the same line is on the release branches) runs gh release create "v${version}" with no --target. When the tag does not exist, gh creates it "from the latest state of the default branch" (gh release create --help), not at the commit that the workflow checked out.

The fix is one option on that call. To move the four existing tags, or not, is a maintainer decision.

Polyglot AI can open a fix PR if a maintainer assigns this issue to @polyglotAI-bot.

Code Example
// No Java code: the commands are in the log above.
Configuration
Client Configuration
// Not applicable (release process).
Environment
  • Cloud
  • Client version: releases 0.10.0, 0.11.0, 0.11.1, 0.11.2 (checked at main 8480ca001)
  • Language version: not applicable
  • OS: not applicable
ClickHouse Server
  • ClickHouse Server version: not applicable (no server is involved)
  • ClickHouse Server non-default settings, if any: none
  • CREATE TABLE statements for tables involved: none
  • Sample data for all these tables: none

Classification: impact: none · area: Docs & project (release process)


Found by automated analysis (Polyglot AI) while working on #3241. Verified against the published artifacts on Maven Central.

主要言語
Java
スター
1.6k
フォーク
657
平均マージ
2日 6時間
マージ済み PR(30日)
36

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ClickHouse/clickhouse-java のほかの issue

ClickHouse/clickhouse-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。