ci: Plugin Portal の公開済み判定を版ページで行う - #84
Merged
Merged
Conversation
Portal の m2 は未公開の版でも Maven Central へ転送し、plugin marker は Central にも公開されるため、そのパスでは Portal 上の公開の有無を判定できない。公開済みと 判定されると publishPlugins が飛ばされ、Portal に版が載らないまま公開が成功する。 判定には Portal 上の版ページ(公開済みなら 200・無ければ 400)を使う。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gradle Plugin Portal への公開が、公開済みと誤判定されて飛ばされる不具合を直す。
不具合
2.4.20-0.1.3 のリリースで、
plugin-portalジョブが2.4.20-0.1.3 is already on the Gradle Plugin Portalの notice を出してpublishPluginsを実行しなかった。Portal のプラグインページは 2.4.10-0.1.3 が最新のままになっている。判定に使っていた
plugins.gradle.org/m2/...の plugin marker は、Portal に無い版でも Maven Central へ 303 で転送される。marker は Central にも公開されるため、転送先で 200 が返る。この URL では Portal 上の公開の有無を判定できない。利用者への影響は Portal のカタログ表示(プラグインページ・バッジ)に限られる。プラグインの解決自体は Central 経由で成立することを実測で確認した(
gradlePluginPortal()だけを宣言したプロジェクトで 2.4.20-0.1.3 を解決・適用し、@Enumizeを含むコードのコンパイルまで成功)。変更
判定を Portal 上の版ページ
https://plugins.gradle.org/plugin/<plugin id>/<版>に替える。公開済みなら 200、無ければ 400 を返すため、既存のガード(curl -f)のまま区別できる。検証
2.4.10-0.1.3(Portal にある)→ 公開済みとして skip2.4.20-0.1.3(Portal に無い)→ 未公開としてpublishPluginsを実行9.9.9-0.0.0(存在しない)→ 未公開としてpublishPluginsを実行マージ後の復旧手順
workflow_runで起動するワークフローは既定ブランチのファイルで走るため、本 PR をマージしてから下記を再実行すれば、修正後の判定で Portal への公開だけが実行される。Merge pull request #82・head は タグv2.4.20-0.1.3が指す 238cc2d)を Re-run all jobs するpublish (auto)が改めて起動する。各ジョブの判定は次のとおりprepare: タグは同じコミットを指すため、付け直さずに続行maven-central: Central に公開済みのため skipplugin-portal: Central 到達の確認は即座に通り、Portal へ公開github-release: Release があるため skipdocs: 再生成して掲載(保管済みのため gh-pages へのコミットは出ない)next-version: 既定ブランチが開発版のため skip🤖 Generated with Claude Code