Skip to content
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

scripts/prepare_changelog: Replace python for with gh and jq commands #12689

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

nywilken
Copy link
Contributor

@nywilken nywilken commented Nov 8, 2023

This change uses the GitHub CLI to obtain all pull-requests merged after the latest release to help with updating the Packer CHANGELOG.

~>  ./scripts/prepare_changelog.sh v1.9.4
Update LICENSE text - [GH-12686](https://github.com/hashicorp/packer/pull/12686)

docs: amend HCL templates/functions docs - [GH-12672](https://github.com/hashicorp/packer/pull/12672)

build(deps-dev): bump @babel/traverse from 7.17.9 to 7.23.2 in /website - [GH-12658](https://github.com/hashicorp/packer/pull/12658)

init: warn if no requirements specified - [GH-12638](https://github.com/hashicorp/packer/pull/12638)

hcl2template: remove value validation for locals - [GH-12620](https://github.com/hashicorp/packer/pull/12620)

Updating Community Tools webpage - [GH-12612](https://github.com/hashicorp/packer/pull/12612)

Datasource logic cleanup - [GH-12608](https://github.com/hashicorp/packer/pull/12608)

version: prepare v1.9.5-dev - [GH-12602](https://github.com/hashicorp/packer/pull/12602)

Changelog setup 1.9.5 - [GH-12601](https://github.com/hashicorp/packer/pull/12601)

Update version output for `-v` and `--version` flags - [GH-12569](https://github.com/hashicorp/packer/pull/12569)

@nywilken nywilken requested a review from a team as a code owner November 8, 2023 23:57
@nywilken nywilken force-pushed the update/prepare-changelog-for-backports branch from 0fdd24d to 3e1b89a Compare November 8, 2023 23:58
@nywilken nywilken added backport/1.9.x Backport PR changes to `release/1.9.x` tech-debt Issues and pull requests related to addressing technical debt or improving the codebase labels Nov 9, 2023
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, but overall this LGTM!

scripts/prepare_changelog.sh Outdated Show resolved Hide resolved
if [ -z $LAST_RELEASE ]; then
echo "you need to give the previous release version. prepare_changelog.sh v<version>"
exit 1
fi

if ! (($+commands[jq])); then
DO_PR_CHECK=0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the variable is not used, I believe we can remove it?

scripts/prepare_changelog.sh Outdated Show resolved Hide resolved
git log HEAD...${LAST_RELEASE} --first-parent --oneline --grep="Merge pull request #[0-9]\+" --grep="(#[0-9]\+)$" |
grep -o "#\([0-9]\+\)" | awk -F\# '{print $2}' | while read line
release_time="$(gh release view --json "createdAt" --jq '.createdAt' ${LAST_RELEASE})"
gh pr list -s merged -S "merged:>=$release_time -label:documentation -label:automated -label:tech-debt -label:website -label:legal -label:docs -author:hc-github-team-packer" --json "number" --jq '.[]|.number' | while read line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation looks mixed between spaces and tabs, doesn't it?

scripts/prepare_changelog.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple more nits, but aside from that LGTM, feel free to merge when you're ready

scripts/prepare_changelog.sh Show resolved Hide resolved
fi
rm -f pull.json
vared -ch ok
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That command's a total mystery to me, what's vared?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a zsh function that drops zsh into a temp editor. The value typed in before hitting return will be assigned to the value ok. It looks like this is being used as a way to make the command interactive. Otherwise it just prints all the line entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made one change to it for now.

This change uses the GitHub CLI to obtain all pull-requests merged after
the latest release to help with updating the Packer CHANGELOG.
@nywilken nywilken force-pushed the update/prepare-changelog-for-backports branch from 2d836f7 to 3201a97 Compare November 9, 2023 16:06
@nywilken nywilken merged commit 360df8f into main Nov 9, 2023
11 checks passed
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.9.x Backport PR changes to `release/1.9.x` tech-debt Issues and pull requests related to addressing technical debt or improving the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants