Skip to content

Automatically generate release notes when creating new release#8567

Closed
sssd-bot wants to merge 4 commits intoSSSD:masterfrom
pbrezina:relnotes
Closed

Automatically generate release notes when creating new release#8567
sssd-bot wants to merge 4 commits intoSSSD:masterfrom
pbrezina:relnotes

Conversation

@sssd-bot
Copy link
Copy Markdown
Contributor

This will generate release notes and open a draft pull request against sssd.io

This will make the release process automated, after the workflow is run:

  • release notes should be reviewed, edited and pushed
  • release should be un-drafted and published

pbrezina and others added 4 commits March 30, 2026 12:39
Add a bash script to extract and list resolved GitHub issues from git commit
history. The script searches for "Resolves:" references in commit messages
between two git refs and outputs a formatted list of closed issues.

Features:
- Accepts --from <ref> (required) and --to <ref> (defaults to HEAD)
- Supports multiple output formats via --format: plain, rst, md
- Uses gh CLI to fetch issue details (number, title, state)
- Filters to only include closed issues
- Outputs formatted list with issue number, URL, and title

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Generate release notes from commit messages:
./scripts/generate-release-notes.py --from FROM --to TO --version VERSION --format md|rst

Co-Authored-By: Claude <noreply@anthropic.com>
This scripts prepares a release notes for sssd.io.
The release workflow is extended to automatically generate release
notes and open a draft pull request against sssd.io.
Copy link
Copy Markdown

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

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 comprehensive set of scripts to automate the SSSD release notes generation process, including tools for extracting fixed issues from git logs, parsing commit tags, and submitting documentation pull requests. The review feedback highlights several functional bugs, such as incorrect script references, undefined variables, and shell syntax errors. It also identifies a logic error in argument validation and a security concern regarding the handling of GitHub tokens in temporary files.

GROUP_END

GROUP_START "Generate release notes"
./scripts/full-release-notes.sh --from "$prev_version" --to HEAD --version "$version" > "/tmp/sssd-$version.rst"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The script name is incorrect. It should be generate-full-release-notes.sh to match the file added in this pull request.

Suggested change
./scripts/full-release-notes.sh --from "$prev_version" --to HEAD --version "$version" > "/tmp/sssd-$version.rst"
./scripts/generate-full-release-notes.sh --from "$prev_version" --to HEAD --version "$version" > "/tmp/sssd-$version.rst"

esac
done

notes=`$scriptdir/release-notes.py --from $FROM --to $TO --version $VERSION --format $FORMAT`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The script name is incorrect. It should be generate-release-notes.py to match the file added in this pull request.

Suggested change
notes=`$scriptdir/release-notes.py --from $FROM --to $TO --version $VERSION --format $FORMAT`
notes=`$scriptdir/generate-release-notes.py --from $FROM --to $TO --version $VERSION --format $FORMAT`

echo ""
echo ".. code-block:: release-notes-shortlog"
echo ""
echo " $ git shortlog --pretty=format:"%h %s" -w0,4 $FROM..$TO"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The double quotes inside the echo string are not escaped, which will cause a syntax error or unexpected output formatting in the generated release notes.

Suggested change
echo " $ git shortlog --pretty=format:"%h %s" -w0,4 $FROM..$TO"
echo " $ git shortlog --pretty=format:\"%h %s\" -w0,4 $FROM..$TO"

RN_BRANCH_NAME="$OWNER-$REPOSITORY-relnotes-$VERSION"

echo "GitHub Repository: $OWNER/$REPOSITORY"
echo "Target Branch: $TARGET_BRANCH"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The variable $TARGET_BRANCH is undefined in this script. It should be $TARGET as defined on line 27.

Suggested change
echo "Target Branch: $TARGET_BRANCH"
echo "Target Branch: $TARGET"

Comment on lines +15 to +16
if [ "$#" -ne 2 ] && [ "$#" -ne 5 ]; then
echo "Usage: $0 <branch> <version> <prev-version> [<github-repo> <git-remote>]" >&2
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The argument count check is inconsistent with the usage message. Since $prev_version is now required for release notes generation, the script should require at least 3 arguments to avoid passing an empty reference to the generation scripts.

Suggested change
if [ "$#" -ne 2 ] && [ "$#" -ne 5 ]; then
echo "Usage: $0 <branch> <version> <prev-version> [<github-repo> <git-remote>]" >&2
if [ "$#" -ne 3 ] && [ "$#" -ne 5 ]; then
echo "Usage: $0 <branch> <version> <prev-version> [<github-repo> <git-remote>]" >&2

Comment on lines +43 to +45
echo $FORK_TOKEN > .token
gh auth login --with-token < .token
rm -f .token
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-high high

Writing the GitHub token to a temporary file is a security risk. It is safer to pipe the token directly to the gh auth login command.

Suggested change
echo $FORK_TOKEN > .token
gh auth login --with-token < .token
rm -f .token
echo "$FORK_TOKEN" | gh auth login --with-token

@pbrezina pbrezina closed this Mar 31, 2026
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.

2 participants