Telenav / cactus

Modules for building the KivaKit Java framework.
Apache License 2.0
0 stars 1 forks source link

PR ambiguity check in approve pull request mojo fails #58

Closed jonathanl-telenav closed 2 years ago

jonathanl-telenav commented 2 years ago
mvn -Dorg.slf4j.simpleLogger.logFile="/var/folders/rm/1qd3sg1n6gx12kbf39xgp73w0000gn/T/maven-Fri-2022.08.01-12.08-telenav-approve-pull-request.log" -Dorg.slf4j.simpleLogger.defaultLogLevel="info" -Dorg.slf4j.simpleLogger.cacheOutputStream=false -Dcactus.authentication-token="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" -Dcactus.pr.branch-to-approve="feature/cors2" -Dcactus.pr.body="self-approving" -Dcactus.scope=all com.telenav.cactus:cactus-maven-plugin:1.5.27:git-approve-pull-request validate 2>&1

results in this failure (neither cited pull request is related):


[ERROR] Failed to execute goal com.telenav.cactus:cactus-maven-plugin:1.5.27:git-approve-pull-request (default-cli) on project safety-service-uber-bom: 

Ambiguous PRs - more than one PR on feature/cors2 in safety-service: 
[

{"baseRefName":"develop","body":"","headRefName":"jenkins-build-checks","mergeable":true,"number":101,"state":"OPEN","title":"trivial changes for testing PR build check","url":"https://github.com/Telenav/safety-service/pull/101","open":true}, 

{"baseRefName":"develop","body":"https://github.com/Telenav/safety-service/issues/86\r\n\r\nplease don't merge until:\r\n\r\n1. new kivakit version is published\r\n2. safety-service supermom references this version\r\n3. Jenkins build succeeds","headRefName":"feature/For_parking_incidents,_the_response_is_different_from_Swagger_definition_#86_and_narrow_logging","mergeable":true,"number":88,"state":"OPEN","title":"Feature/for parking incidents, the response is different from swagger definition #86 and narrow logging","url":"https://github.com/Telenav/safety-service/pull/88","open":true}

] -> [Help 1]
timboudreau commented 2 years ago

It fails for exactly the reason the error states: There is more than one open PR, and it was told "close a PR."

What should it do instead? Guess? Merge everything? It doesn't have the option of asking.

jonathanl-telenav commented 2 years ago

we can't find the PR for the branch using the name?

jonathanl-telenav commented 2 years ago

the PRs that are ambiguous are for other branches. there is no ambiguity for the feature/cors2 PR

jonathanl-telenav commented 2 years ago

ah, i see the problem, you can't use just the base and head ref of the PR because that's ambiguous across repositories. you also have to include the repository:

 "url": "https://github.com/Telenav/telenav-build/pull/14"

so the key needs to be "Telenav/telenav-build:fix-parentage:develop", meaning that this is a pull request in telenav-build to merge fix-parentage into develop

timboudreau commented 2 years ago

Fixed - list of PRs is now filtered correctly.