Closed infraredgirl closed 2 years ago
Hi @infraredgirl ,
Thanks for the report!
I was able to repro the issue you reported:
--github-org
over --repo
is actually working as intended. It is documented here, but upon reflection I can see how it is confusing. Was your expectation that the org "git-xargs-test
would have been used to specify the org, with the subsequent --repo
flag serving as a filter to only operate on that specific repo within the specified org? git-xargs actually only operates on one mode at a time, with an order of preferences as stated in the above linked docs. --repo
in your example (test-repo-4
) doesn't include the Github org prefix - so git-xargs considered this user-supplied repo invalid and discarded it --loglevel DEBUG
you would have gotten a small, easy to miss line about your --repo
value being ignored--repo
values, but all are malformed, you'll get a more explicit error message explaining this now
b. The "targeting mode" currently being used by git-xargs
on any given run is now reported in the final print out - so that it's hopefully more clear what's happening and whyPlease let me know if you'd like to discuss this further / go over it (if it's helpful for the ramp-up we're all doing) etc!
Hey Zack, thanks for addressing this!
- The behavior of preferring
--github-org
over--repo
is actually working as intended. It is documented here, but upon reflection I can see how it is confusing. Was your expectation that the org "git-xargs-test
would have been used to specify the org, with the subsequent--repo
flag serving as a filter to only operate on that specific repo within the specified org? git-xargs actually only operates on one mode at a time, with an order of preferences as stated in the above linked docs.
After I filed the issue, I did notice it's documented that the GH org takes precedence if present. I think intuitively I would still expect that, if more then one selection mode is used, the result should be their intersection. However, as this was the intended design, I think it's good enough if we document that (already done) and make explicit which mode is being used at runtime (added by your PR).
- The value you're passing to
--repo
in your example (test-repo-4
) doesn't include the Github org prefix - so git-xargs considered this user-supplied repo invalid and discarded it
Interestingly enough, the reason that this repo was detected as malformed/invalid was not the lack of org prefix. It was because this was an empty/uninitiated repo that I created in GH for testing purposes. Just a data point for you - this is unlikely to come up in a real world usage.
- There was no good error handling explaining this - but if you ran with
--loglevel DEBUG
you would have gotten a small, easy to miss line about your--repo
value being ignored- Therefore in the linked PR I added better error handling: a. If you supply only
--repo
values, but all are malformed, you'll get a more explicit error message explaining this now b. The "targeting mode" currently being used bygit-xargs
on any given run is now reported in the final print out - so that it's hopefully more clear what's happening and why
Thanks - I will review the PR in question!
Hey Zack, thanks for addressing this!
- The behavior of preferring
--github-org
over--repo
is actually working as intended. It is documented here, but upon reflection I can see how it is confusing. Was your expectation that the org "git-xargs-test
would have been used to specify the org, with the subsequent--repo
flag serving as a filter to only operate on that specific repo within the specified org? git-xargs actually only operates on one mode at a time, with an order of preferences as stated in the above linked docs.After I filed the issue, I did notice it's documented that the GH org takes precedence if present. I think intuitively I would still expect that, if more then one selection mode is used, the result should be their intersection. However, as this was the intended design, I think it's good enough if we document that (already done) and make explicit which mode is being used at runtime (added by your PR).
- The value you're passing to
--repo
in your example (test-repo-4
) doesn't include the Github org prefix - so git-xargs considered this user-supplied repo invalid and discarded itInterestingly enough, the reason that this repo was detected as malformed/invalid was not the lack of org prefix. It was because this was an empty/uninitiated repo that I created in GH for testing purposes. Just a data point for you - this is unlikely to come up in a real world usage.
- There was no good error handling explaining this - but if you ran with
--loglevel DEBUG
you would have gotten a small, easy to miss line about your--repo
value being ignored- Therefore in the linked PR I added better error handling: a. If you supply only
--repo
values, but all are malformed, you'll get a more explicit error message explaining this now b. The "targeting mode" currently being used bygit-xargs
on any given run is now reported in the final print out - so that it's hopefully more clear what's happening and whyThanks - I will review the PR in question!
Ah understood. Thanks for the helpful context!
git-xargs version
v0.0.11
Describe the bug If both
--github-org
and--repo
are specified,git-xargs
is still cloning all the repos in the org.To Reproduce
Expected behavior Only repos supplied with the
--repo
flag get cloned/processed, even if the--github-org
flag is used as well.