Align webhook branch validation (#1781) - #2105
Conversation
015be54 to
bdd45e2
Compare
|
Near duplicate of #1840 It's initially master and if you want to write the routines for a one time migrate to main for individual users you are welcome to.... otherwise this is not going to be merged in it's current state. Alignment is currently with git not GitHub. |
|
Thanks for pointing to #1840 and for the direction. Understood: default stays master, with an explicit one-way opt-in/migration to main per user on their GitHub auth in /user/preferences, wired through the user model, webhook, and repoManager. I am glad to take this on. I will keep working on this branch to implement the preference UI, model field, and sync wiring accordingly. |
|
Implemented the one-way
Tested locally across migrated and unmigrated user flows. Both commits are signed. Ready for review whenever convenient. |
|
Nicely done. You've impressed me with how much you know the site coding and styling as well.
OpenUserJS.org/views/pages/newScriptPage.html Line 370 in ac009d5 master when it should say main depending on the user migration status.
Once that is complete let's just not bother showing the migration status with header ever again on the preferences page. The above text conditional modification correction will be enough for a confirmation.
Then I can run the final scan and tests now that my dev stations remote DB is fixed (no thanks to the ubuntu peeps for giving just the bare minimum kernel to mess it up) and hopefully get it merged maybe this weekend. Thanks. |
|
Updated in
Thanks for the detailed review and guidance. |
|
Thank you. I did a forgotten check from last night on importing and it seems that |
|
Good catch on the repo import path. Updated in
Ready whenever you have time to re-test. |
|
Almost... so on a main'ed repo it appears to be working well... however on a master'ed repo it changed the url in the list to It's currently okay to have support for importing from any detected default branch in an owned repo... however the webhook is the one that will remain fixed to the user default of |
|
Understood, that makes complete sense. Separating repo-level detection for imports from the account-level preference for webhooks is much cleaner. Updated in
As a side note on the multi-repo case: if a user maintains multiple repos with mixed defaults (e.g. one repo on Thanks again for testing both repository configurations. |
|
Weird... with your revert it didn't do the issue I mentioned with
Nope... one way trip to keep it simple. Speaking of keeping it simple when I did a similar code modification to this (now a long time ago) I think I overcomplicated what this one could have been. Your solution is very agreeable and doesn't overcomplicate like I was thinking. So thank you for the alternate perspective. Let me play around with it for a bit just to make sure there aren't any edge cases (don't think so but one never knows)... and I'll give it the final 👍 for the merge. Thank you for your contributing. It has been a pleasant experience. 😄 |
|
Seems to be working on all the standard use cases. Thanks again! |
|
Really appreciate how thoroughly you tested this across both repo setups — catching those subtleties is exactly what keeps things solid. Really enjoyed the back-and-forth and working through this together. Truly a pleasure! |
Aligns the webhook branch check with GitHub's current default branch naming (#1781).
Uses
payload.repository.default_branchwhich is already utilized incontrollers/user.js:1706for the import page, falling back to'master'if absent.No behavioral change for repositories using
masteras default.