Skip to content

Commit

Permalink
[release-15.0] Set the number of threads for release notes generation…
Browse files Browse the repository at this point in the history
… with a flag (#13315)

* Set the number of threads for release notes generation with a flag (#13273)

* Set the number of threads for release notes generation by a flag

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Add the flag to the release instructions and remove the make commande for release notes

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

---------

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* remove os.Exit (#13310)

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

---------

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
  • Loading branch information
frouioui committed Jun 28, 2023
1 parent aad3f10 commit 6308a57
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,5 @@ vtadmin_authz_testgen:
generate_ci_workflows:
cd test && go run ci_workflow_gen.go && cd ..

release-notes:
go run ./go/tools/release-notes --from "$(FROM)" --to "$(TO)" --version "$(VERSION)" --summary "$(SUMMARY)"

install_kubectl_kind:
./tools/get_kubectl_kind.sh
8 changes: 6 additions & 2 deletions doc/internal/ReleaseInstructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,16 @@ We need to verify that _arewefastyet_ has finished the benchmark too.
2. Run the following command to generate the release notes:
1. Release Candidate:
```shell
make VERSION="v15.0.0-rc1" FROM="v14.0.3" TO="HEAD" SUMMARY="./changelog/15.0/15.0.0/summary.md" release-notes
go run ./go/tools/release-notes --from "v14.0.3" --to "HEAD" --version "v15.0.0-rc1" --summary "./changelog/15.0/15.0.0/summary.md" [--threads=[0-9.]]
```
2. General Availability:
```shell
make VERSION="v15.0.0-rc1" FROM="v14.0.3" TO="HEAD" SUMMARY="./changelog/15.0/15.0.0/summary.md" release-notes
go run ./go/tools/release-notes --from "v14.0.3" --to "HEAD" --version "v15.0.0" --summary "./changelog/15.0/15.0.0/summary.md" [--threads=[0-9.]]
```
> Important note: The release note generation fetches a lot of data from the GitHub API. You might reach the API request limit.
In which case you should use the `--threads=` flag and set an integer value lower than 10 (the default).
This command will generate the release notes by looking at all the commits between the tag `v14.0.3` and the reference `HEAD`.
It will also use the file located in `./changelog/15.0/15.0.0/summary.md` to prefix the release notes with a text that the maintainers wrote before the release.
Please verify the generated release notes to make sure it is well-formatted and all the bookmarks are generated properly.
Expand Down
3 changes: 2 additions & 1 deletion go/tools/release-notes/release_notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type (

var (
releaseNotesPath = `changelog/`
numberOfThreads = 10
)

const (
Expand Down Expand Up @@ -134,7 +135,6 @@ The entire changelog for this release can be found [here]({{ .PathToChangeLogFil

prefixType = "Type: "
prefixComponent = "Component: "
numberOfThreads = 10
lengthOfSingleSHA = 40
)

Expand Down Expand Up @@ -499,6 +499,7 @@ func main() {
pflag.StringVarP(&to, "to", "t", to, "to sha/tag/branch")
pflag.StringVarP(&versionName, "version", "v", "", "name of the version (has to be the following format: v11.0.0)")
pflag.StringVarP(&summaryFile, "summary", "s", "", "readme file on which there is a summary of the release")
pflag.IntVar(&numberOfThreads, "threads", numberOfThreads, "Define the number of threads used to fetch data from GitHub's API. Lower this number if you hit request limit errors.")
pflag.Parse()

// The -version flag must be of a valid format.
Expand Down

0 comments on commit 6308a57

Please sign in to comment.