Closed ryanwholey closed 2 years ago
Hey @brikis98 @zackproser! Any interest in the changes proposed here? Thanks!
Hi @ryanwholey,
Thanks so much for contributing to git-xargs
and apologies for the delay in getting back to you.
First off, this looks like a great start and I do believe we'd be interested in this functionality. There are a couple of things we'd probably want to include before this is ready to merge, however:
--draft
flag and the --loglevel DEBUG
flag, I can see HTTP 422 errors being returned as a result. We should probably handle this error specificallystats/stats.go
and add it to the slice of all events in that same file. This way, when someone attempts to open draft pull requests on a repo that does not support them, they'll get a detailed breakdown of exactly which repos had this issue, so it will be easier to troubleshoot. @zackproser all good, thank you for the direction! I'll dive in and update soon
Hi @zackproser, finally getting back around to this!
I've added handling for 422's under the event type RepoNotCompatibleWithPullConfig
. Looks like the GitHub client doesn't export more specified errors here for something like draft incompatibility. Let me know if you think we need some more targeted copy shown to the user.
Regarding updating the testing framework here, I don't believe I'll have time to get to this any time soon. Please let me know if you'd like to see some other form of validation here with regard to these changes.
Hi @zackproser, finally getting back around to this!
I've added handling for 422's under the event type
RepoNotCompatibleWithPullConfig
. Looks like the GitHub client doesn't export more specified errors here for something like draft incompatibility. Let me know if you think we need some more targeted copy shown to the user.Regarding updating the testing framework here, I don't believe I'll have time to get to this any time soon. Please let me know if you'd like to see some other form of validation here with regard to these changes.
Hi @ryanwholey,
Awesome - thanks again for implementing this! I was able to get draft PRs opened using your branch against my test org, so that's great.
I have a couple of nits and thoughts around how to best describe the draft PR activity in the final run report that gets rendered for operators.
I'm going to keep playing around with this and leave some feedback on your PR. Understood on time constraints, so I will probably push some commits there, too.
I opened https://github.com/gruntwork-io/git-xargs/issues/61 to track the implementation of additional test coverage for draft PRs.
Thanks for the review! Going to merge this in now, as tests also passed locally.
Thanks so much @ryanwholey ! https://github.com/gruntwork-io/git-xargs/releases/tag/v0.0.13
Hey folks, thanks for the neat tool!
My team is interested in using the GitHub drafts feature so I've implemented a
--draft
flag here.I played around with a few tests but I didn't find one that felt like it provided meaningful coverage. What we want I think is a test where we check that the PR submitted to
client.PullRequests.Create
has the hasDraft: true
, which would require some storage structure on the mock used in perhaps another test likeTestProcessRepo
. This did seem like a lot for a flag, so wanted to see what you thought before adding it. Open to any suggestions for testing approaches!Also looks like my editor removed a couple extra spaces, please let me know if you'd like them reverted.
closes #47