Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Summary

  • extend the release version helper to ask the GitHub releases API for the latest tag
  • keep the existing fallbacks to workflow event tags, git tags, and the Maven POM

Testing

  • python3 scripts/developer-guide/determine_release_version.py

https://chatgpt.com/codex/tasks/task_e_6903a29e24f88331bad24d9934844874

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 32 to 50
def release_tag_from_event() -> str:
event_path = os.environ.get("GITHUB_EVENT_PATH")
if event_path:
event_file = Path(event_path)
if event_file.is_file():
try:
data = json.loads(event_file.read_text())
except json.JSONDecodeError:
data = {}
release = data.get("release") or {}
tag = release.get("tag_name") or release.get("target_commitish") or ""
if tag:
return _sanitize_tag(tag)
for key in ("GITHUB_REF_NAME", "GITHUB_REF"):
value = os.environ.get(key)
if value:
sanitized = _sanitize_tag(value)
if sanitized:
return sanitized

Choose a reason for hiding this comment

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

P1 Badge Ignore non-version refs when deriving release tag

The new release version helper takes the first non-empty value returned by release_tag_from_event(). That function now returns any GITHUB_REF_NAME/GITHUB_REF even if it is just a branch name such as main. In pull-request and workflow_dispatch runs this means the script prints main (or the current branch) and exits before calling latest_release_from_api(), so the documentation workflow publishes attributes like {cn1-plugin-release-version} as main instead of a numeric release tag. The generated Maven commands and version text become invalid on every non‑release run. release_tag_from_event() should only accept refs that look like a version tag (e.g. start with v or match \d+(\.\d+)*) and otherwise fall through to the API/git fallbacks.

Useful? React with 👍 / 👎.

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: 18742 alert(s) (2756 errors, 6357 warnings, 9629 suggestions) (exit code 1) (report)
  • Image references: No unused images detected (report)

@shai-almog shai-almog merged commit 793b58f into master Nov 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants