-
Notifications
You must be signed in to change notification settings - Fork 449
chore(script): generate changelog from structure #12516
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
base: main
Are you sure you want to change the base?
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.
I have a few suggestions here, but none blocking in case you don't like them :)
list_of_files=$(find "$dir" -maxdepth 1 -type f -not -name ".*") | ||
number_of_files=$(cat $list_of_files | wc -l) |
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.
If it finds nothing I think the result here will just be the empty string, in which case there is no need to count the lines, but can instead compare for equality with ""
.
exit 1 | ||
fi | ||
|
||
list_of_files=$(find "$dir" -maxdepth 1 -type f -not -name ".*") |
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.
Could this just be
list_of_files=$(find "$dir" -maxdepth 1 -type f -not -name ".*") | |
list_of_files=$(cat "$dir/*.md") |
This is arguably more precise, in that if new files types are ever added for some reason they won't be scoped up, and simpler to read, I think.
Signed-off-by: Etienne Marais <[email protected]>
Signed-off-by: Etienne Marais <[email protected]>
Signed-off-by: Etienne Marais <[email protected]>
Signed-off-by: Etienne Marais <[email protected]>
Signed-off-by: Etienne Marais <[email protected]>
Signed-off-by: Etienne Marais <[email protected]>
bdccc06
to
fd57aae
Compare
Signed-off-by: Etienne Marais <[email protected]>
fd57aae
to
bb573a9
Compare
Thanks, @shonfeder, for the feedback! I went for a hybrid solution. The problem with the |
This PR is the second part of #12304. It allows us to generate the changelog from the structure in
changes/
.It starts by generating the header. Then, the script stacks all the files from the various directories inside the new changelog file. While it is adding the files, it also removes them (we have git, it is easy to revert it). After that, it adds the old changelog without the unnecessary header. Finally, it moves the new changelog to replace the old one.
Requires #12472
Fixes #12304.