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

MR Process: bug when applying patch to your own release #338

Open
zepumph opened this issue Nov 16, 2023 · 3 comments
Open

MR Process: bug when applying patch to your own release #338

zepumph opened this issue Nov 16, 2023 · 3 comments
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Nov 16, 2023

I recently was tired and wrote this maintenance code (as part of a larger MR patch in phetsims/build-a-nucleus#215). It broke things!

m.reset()
m.createPatch( 'build-a-nucleus', 'https://github.com/phetsims/build-a-nucleus/issues/215' );
m.addNeededPatch( 'build-a-nucleus' ,'1.1', 'build-a-nucleus' );
m.addPatchSHA( 'build-a-nucleus', '367a00e015ea94fb29797e5799f294c2cead7e48' );
m.applyPatches();
m.updateDependencies();  // <--- created a build-a-nucleus-1.1 branch in build-a-nucleus

It ended up creating a build-a-nucleus-1.1 branch. That makes me sad, and seems like an easy thing to improve upon, but I couldn't really crack it when looking at the code. @jonathanolson could you help me brainstorm even a spot for an assertion like "You can't patch the branch of a release branch that you have as a needed patch".

@jonathanolson
Copy link
Contributor

It looks like it would need to be patched in a few places to avoid this type of thing.

@zepumph
Copy link
Member Author

zepumph commented Nov 20, 2023

Is there a quick and dirty spot where we could fail out just so that we know it isn't a supported feature?

@zepumph
Copy link
Member Author

zepumph commented Nov 20, 2023

Or better yet, could it just become a ternary when it comes to figuring out the branch name (untested made up code):

get branchName( repo ) { return this.repo === repo? this.branch : '${repo}-${this.branch}'; }

@zepumph zepumph changed the title Maintenance bug when applying patch to your own release MR Process: bug when applying patch to your own release Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants