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
Get Pull Request ID by branch name or commit hash #190
Get Pull Request ID by branch name or commit hash #190
Conversation
@haya14busa What do you think about it? |
I'm sorry for the late response. I think it might be a good idea as a fallback. Do you have some CI examples which don't support p-r number? [optional] |
I know at least the one CI service, which doesn't provide Pull Request ID - Vexor. I have been using my patched version of reviewdog on Vexor since the previous November. |
I've fixed all conflicts. |
This is breaking changes and I'm wondering what should we do.
e.g. Travis CI runs 2 builds, commit and p-r build.
Prior to this change, reviewdog only works on p-r build.
@reviewdog/reviewdog Do you have any thought?
Maybe we can document this change and the user can suppress reviewdog on commit build?
Worst case, 2 reviewdog runs in parallel and post duplicated comments.
Done. |
I think it is the CI's issue. You should send a feature request to vexor.io first. As haya14busa say, this feature is a breaking change. So it should be opt-in feature, and enabled by an environment value (e.g. |
@haya14busa @shogo82148 Updated. |
Sry for the late reply. I should have left comments earlier. I don't like the idea to change the behavior by an environment variable. Environment variables should be used for passing API key, CI "environment" variable (like commit, pr-number, etc... in CI services) and configuration which doesn't change the behavior but changing target or something (e.g. GITHUB_API base endpoint). Let's use the command-line flag instead. Also, as mattn said, reviewdog should exit with non-zero exit code if the user explicitly specifies the flag and couldn't find the p-r. |
@haya14busa @mattn Updated with using the flag About exiting with a non-zero code. I don't think that it's a good idea because CI-services create not only PR-builds. Thus, tests will always fail for these builds. I think reviewdog shouldn't do anything if it doesn't find Pull Request ID by the branch name and the commit SHA. And it should exit with the zero code. |
@haya14busa What do you think about it? Do you have any comments? |
@haya14busa Is there a chance to merge this PR? |
I'm sorry for the late response.
I'm still not 100% sure that it's a good approach, but it should be useful for some cases and acceptable design.
Thank you for your contribution!
Hi there!
Some CI-services don't provide information such as Pull Request ID. So, I decided to get Pull Request ID by branch name or commit hash.