Skip to content

fix(release): handle missing release tags gracefully in release-note-generation#13795

Draft
jinseopkim0 wants to merge 2 commits into
mainfrom
fix/release-note-gen-missing-tag
Draft

fix(release): handle missing release tags gracefully in release-note-generation#13795
jinseopkim0 wants to merge 2 commits into
mainfrom
fix/release-note-gen-missing-tag

Conversation

@jinseopkim0

@jinseopkim0 jinseopkim0 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This PR updates the release note generation tool to:

  1. Handle missing release tags gracefully by dynamically appending library suffixes (e.g. v1.88.1-dataproc) for partial releases to avoid broken links.
  2. Fix process stdout buffer blocking and deadlock/timeout hang risks during command execution.

Tested manually with -Dlibraries-bom.version=26.85.1 -Dgoogle-cloud-java.version=1.88.1 (verified correct tag fallback output in release_note.md).

Fixes b/535634855

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a mechanism to verify the existence of monorepo releases using the GitHub CLI, allowing for dynamic construction of release URLs. The code review identified potential issues with process stream management and improper handling of InterruptedException. I have kept the comments regarding the need to consume process streams to prevent blocking and the correct handling of thread interruption, as well as the suggestion to capture the error stream when a command fails to provide more meaningful diagnostic information.

@jinseopkim0

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a check to verify if a monorepo release exists using the GitHub CLI (gh) and adjusts the release URL format accordingly. It also refactors fetchReleaseNote to redirect process output to a temporary file and handle command failures gracefully. The review feedback suggests adding a timeout to the process execution in releaseExists to prevent potential indefinite blocking, and cleaning up the temporary file in fetchReleaseNote immediately within a finally block rather than relying on deleteOnExit().

@jinseopkim0
jinseopkim0 force-pushed the fix/release-note-gen-missing-tag branch from d9c0b6a to ca2b1ff Compare July 17, 2026 01:46
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a check to verify if a monorepo release exists using the GitHub CLI, dynamically adjusting the release URL format based on the result. It also refactors fetchReleaseNote to redirect process output to a temporary file to prevent potential blocking and handles command failures gracefully. The review feedback highlights potential process leaks in both releaseExists and fetchReleaseNote if the threads are interrupted while waiting for the subprocesses to finish, and suggests wrapping the process execution in try-finally blocks to ensure the subprocesses are forcibly destroyed if they remain alive.

@jinseopkim0
jinseopkim0 force-pushed the fix/release-note-gen-missing-tag branch from ca2b1ff to 2737d53 Compare July 17, 2026 01:52
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates ReleaseNoteGeneration.java to dynamically check for the existence of monorepo releases using the GitHub CLI (gh) and adjusts release URLs accordingly. It also refactors fetchReleaseNote to redirect command output to a temporary file and handle failures gracefully. Feedback on this PR highlights that silently returning an empty string on any command failure in fetchReleaseNote could mask critical issues like authentication or network errors; it is recommended to only ignore "not found" errors and throw an exception for other failures.

@jinseopkim0
jinseopkim0 force-pushed the fix/release-note-gen-missing-tag branch from 2737d53 to dbef66b Compare July 17, 2026 01:58
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a check to verify if a monorepo release exists using the GitHub CLI (gh), dynamically formatting the release URL based on the result. It also refactors fetchReleaseNote to use a temporary file for output and gracefully handle missing releases. The feedback suggests propagating IOException in releaseExists to avoid masking environment issues (such as a missing gh CLI) and waiting for the process to fully terminate after calling destroyForcibly() to ensure the temporary file is reliably deleted.

@jinseopkim0

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds a check to verify if a monorepo release exists using the GitHub CLI and dynamically formats the release URL based on its existence. It also refactors fetchReleaseNote to write output to a temporary file and handle missing releases gracefully. The review feedback recommends using java.nio.file.Files.createTempFile instead of File.createTempFile to ensure secure file permissions on POSIX-compliant systems.

@jinseopkim0
jinseopkim0 force-pushed the fix/release-note-gen-missing-tag branch from dbef66b to 0bae71c Compare July 17, 2026 02:06
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates ReleaseNoteGeneration.java to check if a monorepo release exists using the GitHub CLI (gh) and adjusts the generated release URLs accordingly. It also updates fetchReleaseNote to handle missing releases gracefully. A review comment points out that ProcessBuilder.Redirect.DISCARD is used in releaseExists, which requires Java 9+, whereas the project targets Java 8 compatibility. It suggests redirecting output to a temporary file instead.

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.

1 participant