Skip to content

Commit 3251465

Browse files
authored
chore: add script to fetch closed bugs since git commit (#2066)
1 parent 4c2c485 commit 3251465

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

docs/development/releasing.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ Once release branch is pushed, it's last commit will be picked up by our CI/CD:
2525
- `./utils/print_versions.js`
2626
1. Fill "Highlights" if any.
2727
- Be creative.
28+
1. Make sure you fetched tags from the upstream to get latest releases.
29+
- `git fetch --tags upstream`
2830
1. Fill "New APIs" if any.
2931
- `git diff $(git describe --tags $(git rev-list --tags --max-count=1)):docs/api.md docs/api.md`
3032
1. Fill "Breaking API Changes" if any.
3133
- `git diff $(git describe --tags $(git rev-list --tags --max-count=1)):docs/api.md docs/api.md`
3234
1. Fill "Bug fixes".
33-
- `git log $(git describe --tags $(git rev-list --tags --max-count=1))..HEAD`
34-
- Manually look for `#1234` references in commit messages.
35+
- `./utils/list_closed_issues.sh $(git describe --tags $(git rev-list --tags --max-count=1))`
3536
1. Fill "Raw notes".
36-
- `git fetch --tags upstream`
37+
- `git log --pretty="%h - %s" $(git describe --tags $(git rev-list --tags --max-count=1))..HEAD`
38+
3739
1. When making links to the API, copy actual links from [GitHub](https://github.com/microsoft/playwright/blob/master/docs/api.md), and not from `api.md` source - these might be incorrect.
3840
- Before publishing, replace `blob/master/docs` with `blob/vX.Y.Z/docs` in all the links.
3941
1. Use "Save Draft", not "Publish".

utils/list_closed_issues.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
set -e
3+
set +x
4+
5+
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
6+
echo "usage: $(basename $0) <GIT_SHA>"
7+
echo
8+
echo "List Playwright closed issues since the given commit was landed"
9+
echo
10+
echo "Example: $(basename $0) HEAD~100"
11+
exit 0
12+
fi
13+
14+
if [[ $# == 0 ]]; then
15+
echo "missing git SHA"
16+
echo "try './$(basename $0) --help' for more information"
17+
exit 1
18+
fi
19+
20+
COMMIT_DATE_WEIRD_ISO=$(git show -s --format=%cd --date=iso $1)
21+
COMMIT_DATE=$(node -e "console.log(new Date('${COMMIT_DATE_WEIRD_ISO}').toISOString())")
22+
23+
curl -s "https://api.github.com/repos/microsoft/playwright/issues?state=closed&since=${COMMIT_DATE}&direction=asc&per_page=100" | \
24+
node -e "console.log(JSON.parse(require('fs').readFileSync(0, 'utf8')).filter(issue => !issue.pull_request && new Date(issue.closed_at) > new Date('${COMMIT_DATE}')).map(issue => '#' + issue.number + ' - ' + issue.title).join('\n'))"
25+

0 commit comments

Comments
 (0)