-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Create retarget-open-prs
utility
#45230
Conversation
retarget-open-prs
utility
c62af0b
to
c203bfb
Compare
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work with this one @saramarcondes!
I'll let @scinos to provide his feedback, but I'm leaving some thoughts and questions, none of which are really blocking IMHO. It mostly depends on how much we want to focus on making this one error-proof from the first iteration 😉
packages/retarget-open-prs/index.js
Outdated
} ); | ||
|
||
if ( remainingRateLimit === 0 ) { | ||
const rateLimitResetDate = new Date( rateLimitReset * 1000 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could just make the script wait for that time instead? That way we won't have to execute it again, but we can just wait for it to restart automatically once rate limit is reset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The amount of time I'm observing locally can be up to an hour, which seems like an awful long time for a script to stall. Do you think we should determine a tolerance? Maybe if the time is within the next ~minute or so we wait but otherwise escape with the message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the thing, maybe I want the script to run in the background while I'm working on other things 😉
We could have a config flag for that, and keep the default behavior as you described. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me!
describe: | ||
'The original branch name against which to select open PRs that need to be retargted.', | ||
demandOption: true, | ||
requiresArg: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it makes sense to always default to the default branch here? We could fetch it from the default_branch
field at https://docs.github.com/en/rest/reference/repos#get-a-repository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are your thoughts on this @saramarcondes? Perhaps this suggestion would be over-engineering, but I was just curious to know what you think about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I thought about doing this but it didn't feel necessary for something that could be too easily unintentional depending on the use case. It doesn't save but 10 keystrokes in most cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
1f62dfa
to
4c4e417
Compare
59a91c6
to
6df6c18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is looking great to me 👍 Nice work with this @saramarcondes! I don't see anything preventing this PR from shipping at this point.
@scinos did you have any further thoughts on this PR? I'd love to get your expertised mind to provide some feedback, if possible 😉
Co-authored-by: Marin Atanasov <8436925+tyxla@users.noreply.github.com>
Changes proposed in this Pull Request
retarget-open-prs
that retargets open pull requests in a repository from one branch to anotherTesting instructions
Related to #43395