Skip to content

fix(scripts): check if PR list is empty #8805

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

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

phorcys420
Copy link
Member

I am currently (= finally) working on a PR for chocolatey support.

During testing, It occured to me that the release notes were always failing, that is because check_commit_metadata.sh tries to loop over $pr_metadata_raw even if it is empty, this causes an issue because PRs don't ususally have PRs.
This PR makes it so that it checks if the PR list is empty before looping.

@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Jul 31, 2023
@phorcys420 phorcys420 changed the title [scripts] Check if PR list is empty before looping. fix(scripts): Check if PR list is empty before looping. Jul 31, 2023
@phorcys420 phorcys420 changed the title fix(scripts): Check if PR list is empty before looping. fix(scripts): check if PR list is empty before looping Jul 31, 2023
@phorcys420
Copy link
Member Author

I have accidentally pushed to the wrong branch.

@matifali
Copy link
Member

matifali commented Aug 1, 2023

@phorcys420 you need to run make fmt and make lint to fix any fmt or lint error.

@phorcys420
Copy link
Member Author

I pushed the wrong files, lol.
I keep screwing this up.

@phorcys420 phorcys420 changed the title fix(scripts): check if PR list is empty before looping fix(scripts): check if PR list is empty Aug 1, 2023
@phorcys420
Copy link
Member Author

@phorcys420 you need to run make fmt and make lint to fix any fmt or lint error.

Thanks Atif, I think it should maybe be added to the Contributing docs.

@github-actions github-actions bot added the stale This issue is like stale bread. label Aug 9, 2023
@matifali matifali requested a review from mafredri August 9, 2023 08:26
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Could you share a bit about your use-case and why you need to call the commit metadata script on a branch?

I think this change could be fine, although the previous behavior is a bit safer in that we may not want to continue if the gh command doesn't return any output (since we don't know if it guarantees a proper exit code).

Then again, the previous behavior might fail in an edge case where we only want to release a single commit that wasn't merged via PR.

@phorcys420
Copy link
Member Author

phorcys420 commented Aug 9, 2023

hey @mafredi, I am looking at making the release action work (atleast mostly) in a branch that way you can do dry-runs in a fork.

The idea is that it would allow for easier testing (in the real environment that it would run in) when PRing stuff like Chocolatey or Scoop support.

This would allow you to find out for simple syntax errors and other simple things you might not see by eye.

@mafredri
Copy link
Member

mafredri commented Aug 9, 2023

Alright, thanks for expanding on that. Let's get this merged and hopefully unblock you! ☺️ Thanks for the PR!

@mafredri mafredri enabled auto-merge (squash) August 9, 2023 19:15
@mafredri mafredri merged commit 53f26b3 into coder:main Aug 9, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Pull Requests and issues created by the community. stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants