-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-4918: Release notes automation #1677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few questions
evergreen/release-notes.yml
Outdated
- maintenance | ||
|
||
- The full list of issues resolved in this release is available at [CSHARP JIRA project](https://jira.mongodb.org/issues/?jql=project%20%3D%20CSHARP%20AND%20fixVersion%20%3D%20${version}%20ORDER%20BY%20key%20ASC). | ||
- Documentation on the .NET driver can be found [here](https://www.mongodb.com/docs/drivers/csharp/v${version}/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think docs link work for version that includes patch: "3.3.1".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
for section in opts.template["sections"]: | ||
if is_in_section(mapped, section): | ||
if mapped in section["items"]: | ||
break # PR was already added to the section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. If we have multiple PRs for single Jira ticket, then it might be already in the list.
evergreen/release-notes.py
Outdated
|
||
for commit in commits["commits"]: | ||
pullrequests_url = "{github_api_base_url}{repo}/commits/{commit_sha}/pulls".format( | ||
github_api_base_url=opts.github_api_base_url, repo=opts.repo, commit_sha=commit["sha"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that we can have multiple PRs for same commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to make it possible, but github API has such model, so I suppose somehow it's possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably just same endpoint to server other requests.
So the loop is redundant, do we want to just take the first one and/or throw?
It's minor either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! + Few optional comments
evergreen/release-notes.py
Outdated
url = '{github_api_base_url}{repo}/releases/tags/{tag}'.format(github_api_base_url=opts.github_api_base_url, repo=opts.repo, tag=opts.version_tag) | ||
response = requests.get(url, headers=opts.github_headers) | ||
response.raise_for_status() | ||
if response.status_code == 200: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it's safer to have != 404
check?
evergreen/release-notes.py
Outdated
"Accept": "application/vnd.github+json" | ||
} | ||
|
||
print("Prepare release notes for: tag {version_tag}, previous tag {previous_tag}".format(version_tag = options.version_tag, previous_tag = options.previous_tag)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use same tense as other outputs: "Preparing".
No description provided.