Conversation
There was a problem hiding this comment.
Pull request overview
Updates the repository’s release/build automation to reflect the durabletask-js-azuremanaged package location change and introduces a new GitHub Actions workflow intended to automate release preparation (version bumps + changelog + release PR).
Changes:
- Update Azure Pipelines build template to build/package the azure-managed package from
packages/durabletask-js-azuremanaged. - Add a new
Prepare ReleaseGitHub Actions workflow to calculate the next version, updatepackage.jsonfiles, updateCHANGELOG.md, and open a release PR.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| eng/templates/build.yml | Switch build/pack/copy steps to packages/durabletask-js-azuremanaged path. |
| .github/workflows/prepare-release.yaml | Add workflow to automate release prep (versioning, changelog generation, branch/tag creation, PR creation). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| CHANGELOG_CONTENT=$(git log "$LATEST_TAG"..HEAD --merges --pretty=format:"- %s" | \ | ||
| sed 's/Merge pull request #\([0-9]*\) from [^:]*:/\[#\1\](https:\/\/github.com\/microsoft\/durabletask-js\/pull\/\1):/' | \ | ||
| sed 's/Merge branch .*//' | \ | ||
| grep -v '^$' || echo "") |
There was a problem hiding this comment.
sed 's/Merge branch .*//' can turn a line like - Merge branch 'x' into - (not an empty line), so grep -v '^$' won't remove it and the changelog can contain blank bullet points. Consider filtering these merges before prefixing with - , or drop lines that become -/- after transformations.
| grep -v '^$' || echo "") | |
| grep -Ev '^- *$' || echo "") |
| console.log(v); | ||
| process.exit(0); | ||
| } | ||
| const [, major, minor, patch, preType, preNum] = match; | ||
| if (preType && preNum) { | ||
| // Increment pre-release number | ||
| console.log(\`\${major}.\${minor}.\${patch}-\${preType}.\${parseInt(preNum) + 1}\`); | ||
| } else { | ||
| // Increment patch version | ||
| console.log(\`\${major}.\${minor}.\${parseInt(patch) + 1}\`); |
There was a problem hiding this comment.
If the current version doesn’t match the regex, the script prints the current version and exits successfully, which will cause the workflow to try creating a branch/tag that likely already exists (and then fail later). It would be safer to exit 1 with a clear error when parsing fails, or fall back to npm version patch --no-git-tag-version for semver-aware bumping.
| console.log(v); | |
| process.exit(0); | |
| } | |
| const [, major, minor, patch, preType, preNum] = match; | |
| if (preType && preNum) { | |
| // Increment pre-release number | |
| console.log(\`\${major}.\${minor}.\${patch}-\${preType}.\${parseInt(preNum) + 1}\`); | |
| } else { | |
| // Increment patch version | |
| console.log(\`\${major}.\${minor}.\${parseInt(patch) + 1}\`); | |
| console.error(`Unable to parse current version '${v}'. Expected format 'MAJOR.MINOR.PATCH' or 'MAJOR.MINOR.PATCH-prerelease.NUM'.`); | |
| process.exit(1); | |
| } | |
| const [, major, minor, patch, preType, preNum] = match; | |
| if (preType && preNum) { | |
| // Increment pre-release number | |
| console.log(`${major}.${minor}.${patch}-${preType}.${parseInt(preNum) + 1}`); | |
| } else { | |
| // Increment patch version | |
| console.log(`${major}.${minor}.${parseInt(patch) + 1}`); |
| node -e " | ||
| const fs = require('fs'); | ||
| let content = fs.readFileSync('CHANGELOG.md', 'utf8'); | ||
|
|
||
| const newSection = \`$NEW_SECTION\`; |
There was a problem hiding this comment.
const newSection = $NEW_SECTION; in a node -e "..." block is fragile because $NEW_SECTION includes commit messages; backticks, ${...}, or other special characters in commit subjects can break the JS template literal and/or the shell quoting. Consider writing NEW_SECTION to a temp file and reading it from Node, or pass it via base64/JSON-escaped string to avoid injection/quoting failures.
| node -e " | |
| const fs = require('fs'); | |
| let content = fs.readFileSync('CHANGELOG.md', 'utf8'); | |
| const newSection = \`$NEW_SECTION\`; | |
| NEW_SECTION_FILE=$(mktemp) | |
| printf '%s\n' "$NEW_SECTION" > "$NEW_SECTION_FILE" | |
| NEW_SECTION_FILE="$NEW_SECTION_FILE" node -e " | |
| const fs = require('fs'); | |
| let content = fs.readFileSync('CHANGELOG.md', 'utf8'); | |
| const newSection = fs.readFileSync(process.env.NEW_SECTION_FILE, 'utf8'); |
| # Create release tag | ||
| git tag "v${NEW_VERSION}" | ||
|
|
||
| # Push branch and tag | ||
| git push origin "$BRANCH_NAME" | ||
| git push origin "v${NEW_VERSION}" |
There was a problem hiding this comment.
This workflow creates and pushes the release tag before the release PR is reviewed/merged, so the tag will point to a release-branch commit rather than the eventual merge commit on main. That can make vX.Y.Z not correspond to the released commit on the default branch and can confuse consumers/tooling. Consider deferring tag creation until after the PR is merged (e.g., a separate workflow triggered on merge), or tagging the merge commit.
| ### Changes | ||
|
|
||
| ${CHANGELOG_CONTENT} |
There was a problem hiding this comment.
The workflow adds changelog sections as ### Changes, but the existing CHANGELOG.md structure uses ### New / ### Fixes headings. Consider keeping the same headings (and optionally splitting entries) so the changelog remains consistent across releases and any downstream tooling/expectations don’t break.
| ### Changes | |
| ${CHANGELOG_CONTENT} | |
| ### New | |
| ${CHANGELOG_CONTENT} | |
| ### Fixes |
| CHANGELOG_CONTENT=$(git log "$LATEST_TAG"..HEAD --merges --pretty=format:"- %s" | \ | ||
| sed 's/Merge pull request #\([0-9]*\) from [^:]*:/\[#\1\](https:\/\/github.com\/microsoft\/durabletask-js\/pull\/\1):/' | \ |
There was a problem hiding this comment.
git log ... --merges --pretty=format:"- %s" will typically produce subjects like "Merge pull request #123 from ..." (no PR title). After the sed rewrite this becomes a changelog entry that only contains a PR link/colon with no description. Consider extracting the PR title (e.g., from the merge commit body) or using a different format/API so each changelog line has meaningful text.
| CHANGELOG_CONTENT=$(git log "$LATEST_TAG"..HEAD --merges --pretty=format:"- %s" | \ | |
| sed 's/Merge pull request #\([0-9]*\) from [^:]*:/\[#\1\](https:\/\/github.com\/microsoft\/durabletask-js\/pull\/\1):/' | \ | |
| CHANGELOG_CONTENT=$(git log "$LATEST_TAG"..HEAD --merges --pretty=format:"- %s %b" | \ | |
| sed 's/Merge pull request #\([0-9]*\) from [^ ]* \(.*\)/\[#\1\](https:\/\/github.com\/microsoft\/durabletask-js\/pull\/\1): \2/' | \ |
Summary
What changed?
Why is this change needed?
Issues / work items
Project checklist
CHANGELOG.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
AI verification (required if AI was used):
Testing
Automated tests
Manual validation (only if runtime/behavior changed)
1.
2.
3.
Notes for reviewers