Skip to content

Add github release logic when creating a release#3523

Open
richardwerkman wants to merge 3 commits intomasterfrom
feature/github-releases
Open

Add github release logic when creating a release#3523
richardwerkman wants to merge 3 commits intomasterfrom
feature/github-releases

Conversation

@richardwerkman
Copy link
Copy Markdown
Member

Addresses #3494

I haven't tested this yet, because I can only really test this during a real release... However I know the creating of the releases works because I added a lot of releases by accident during developing.

My only concern is that the release notes will not be inserted at the right location in CHANGELOG.md

Copilot AI review requested due to automatic review settings April 4, 2026 14:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds automation to the release preparation workflow so that creating a new version also creates a corresponding GitHub Release, and it updates documentation to reflect a move toward a consolidated root CHANGELOG.md.

Changes:

  • Update prepare-release.js to generate release notes, create an annotated Git tag containing those notes, and create a GitHub Release via the gh CLI.
  • Adjust release procedure docs to mention automatic GitHub Release creation.
  • Update the root CHANGELOG.md introduction to position it as the consolidated changelog going forward.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
stryker-net.code-workspace Minor formatting/structure fix.
RELEASING.md Documents the new release automation behavior.
prepare-release.js Adds changelog generation, annotated tagging, and GitHub Release creation logic.
CHANGELOG.md Rewords intro to a consolidated changelog with links to historical per-package changelogs.
.github/copilot-instructions.md Formatting tweaks and removal of mutator-specific section.

if (!versionSuffix) {
console.log(`Updating changelog`);
commitMessageLines.push(`- dotnet-stryker@${newVersionNumber}`);
releaseNotes = execSync(`npx conventional-changelog-cli -p angular --tag-prefix "dotnet-stryker@"`, { encoding: 'utf8' }).trim();
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

releaseNotes is captured by running conventional-changelog-cli without limiting the output, which typically prints the entire changelog history to stdout. That means the annotated tag message (and therefore gh release ... --notes-from-tag) can become huge/incorrect (entire history instead of just this release) and may even fail due to execSync maxBuffer. Consider generating only the latest release section (e.g., --release-count 1 / -r 1) and ensure the options match whatever you write into CHANGELOG.md so the tag notes and file contents stay consistent.

Suggested change
releaseNotes = execSync(`npx conventional-changelog-cli -p angular --tag-prefix "dotnet-stryker@"`, { encoding: 'utf8' }).trim();
const changelogCommand = 'npx conventional-changelog-cli -p angular --tag-prefix "dotnet-stryker@" --release-count 1';
releaseNotes = execSync(changelogCommand, { encoding: 'utf8' }).trim();

Copilot uses AI. Check for mistakes.
Comment on lines 67 to 70
console.log('Updating azure-pipelines.yml');
replaceVersionNumber('./azure-pipelines.yml', `VersionBuildNumber: $[counter('${oldVersion}', 1)]`, `VersionBuildNumber: $[counter('${versionPrefix}', 1)]`);
replaceVersionNumber('./azure-pipelines.yml', `PackageVersion: '${oldVersion}'`, `PackageVersion: '${versionPrefix}'`);

Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The temp file .release-notes.md is deleted only if git tag succeeds; if git tag throws, the file is left behind in the repo root. Using a try/finally cleanup (and ideally a unique temp file location such as os.tmpdir()/fs.mkdtemp) would prevent leftover files and avoid collisions if the script is re-run.

Copilot uses AI. Check for mistakes.
Comment on lines 79 to 83
@@ -71,6 +82,15 @@ rl.question('What should the new package version be? ', (newVersionNumber) => {

console.log(`Pushing commit ${versionSuffix?'':' and tags'}`);
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

newVersionNumber is interpolated into shell commands (git tag ...${newVersionNumber}... and gh release create ...${newVersionNumber}...) executed via execSync with a string, which runs through a shell. Even though this is a maintainer script, it’s safer to validate the version input (e.g., strict semver) and/or use execFileSync/spawnSync with an argument array to avoid shell injection and quoting issues.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +6
3. Run `npm run prepare-release` from the root of the repo and enter the new version number. This will automatically create GitHub releases for the new tags with the correct release notes from the changelogs.
4. Verify that the commit is on GitHub and that the GitHub releases for the new version have been created.
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The text says this will create GitHub releases for “the new tags” (plural) with notes from “the changelogs”, but prepare-release.js currently creates a single dotnet-stryker@... tag/release and updates only the root CHANGELOG.md. Please adjust the wording to match the actual behavior (singular), or update the script to create releases for multiple tags if that’s the intent.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 4, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
1 New Security Hotspots (required ≤ 0)

See analysis details on SonarQube Cloud

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