Skip to content

Commit 806d993

Browse files
authored
chore: limit github release notes size (#7586)
This change fixes a crash I encountered in `scripts/release.py` by truncating the release notes before using them in a Github API request. This is a fallback for a case that probably indicates other problems with the script and generally will not change the release notes. ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) - [x] If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. - [x] This PR doesn't touch any of that.
1 parent c09ef1f commit 806d993

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/release.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
Generate release notes for the 2.15 release: `BASE=2.15 python release.py`
5050
""" # noqa
5151

52+
MAX_GH_RELEASE_NOTES_LENGTH = 125000
53+
5254

5355
def create_release_draft(dd_repo, base, rc, patch, latest_branch):
5456
# make sure we're up to date
@@ -218,7 +220,12 @@ def create_draft_release(
218220
)
219221
else:
220222
dd_repo.create_git_release(
221-
name=name, tag=tag, prerelease=prerelease, draft=True, target_commitish=base_branch, message=rn
223+
name=name,
224+
tag=tag,
225+
prerelease=prerelease,
226+
draft=True,
227+
target_commitish=base_branch,
228+
message=rn[:MAX_GH_RELEASE_NOTES_LENGTH],
222229
)
223230
print("\nPlease review your release notes draft here: https://github.com/DataDog/dd-trace-py/releases")
224231

0 commit comments

Comments
 (0)