Skip to content

don't allow using --pr-commit-msg when only adding new files with --new-pr (unless --force is used)#4498

Merged
smoors merged 6 commits intoeasybuilders:developfrom
branfosj:no-pr-commit-msg
Jun 20, 2025
Merged

don't allow using --pr-commit-msg when only adding new files with --new-pr (unless --force is used)#4498
smoors merged 6 commits intoeasybuilders:developfrom
branfosj:no-pr-commit-msg

Conversation

@branfosj
Copy link
Member

@branfosj branfosj commented Apr 4, 2024

We should force the generated message in these cases.

An alternative to raising an error (as implemented here) would be to generate the default PR title and replace the commit_msg in these cases while printing a warning.

@branfosj branfosj added this to the release after 4.9.1 milestone Apr 4, 2024
@branfosj branfosj marked this pull request as draft April 4, 2024 13:20
@smoors
Copy link
Contributor

smoors commented Apr 4, 2024

should we also force re-generating the PR title if easyconfigs are renamed or deleted? because in that case the title is not correct anymore

@Micket
Copy link
Contributor

Micket commented Apr 4, 2024

@smoors We'd have to check that it wasn't modifying any file before doing that. But why not

@boegel boegel modified the milestones: 4.9.2, release after 4.9.2 Jun 6, 2024
@boegel boegel modified the milestones: 4.9.3, release after 4.9.3 Aug 28, 2024
@boegel boegel modified the milestones: release after 4.9.4, release after 5.0.0 Mar 17, 2025
@branfosj branfosj marked this pull request as ready for review June 4, 2025 07:29
@boegel
Copy link
Member

boegel commented Jun 18, 2025

I'm not sure if this is a good idea...

I think it's good to have the option to use --pr-commit-msg to provide a more meaningful commit message if you feel the auto-generated doesn't make sense, or can be improved.

Maybe we can require --force to not completely disallow but, only discourage it?

@branfosj
Copy link
Member Author

I'm not sure if this is a good idea...

I think it's good to have the option to use --pr-commit-msg to provide a more meaningful commit message if you feel the auto-generated doesn't make sense, or can be improved.

Maybe we can require --force to not completely disallow but, only discourage it?

61aff50 allows bypassing the error if --force is used.

I explicitly want this to be an error as I want people to see it and act on it. I'm deliberately not saying that you can use --force to bypass the check for the same reason.

Copy link
Contributor

@smoors smoors left a comment

Choose a reason for hiding this comment

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

works as advertised, lgtm

@smoors smoors enabled auto-merge June 20, 2025 14:20
@smoors smoors merged commit 68f9650 into easybuilders:develop Jun 20, 2025
37 checks passed
@branfosj branfosj deleted the no-pr-commit-msg branch June 20, 2025 15:39
@boegel boegel changed the title no --pr-commit-msg when only adding new files don't allow using --pr-commit-msg when only adding new files with --new-pr (unless --force is used) Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants