CI: Let the pull request workflow be dispatched as a dry run - #177
jwrosewell wants to merge 1 commit into
Conversation
The workflow reads inputs.dryrun but declares no such input, so a manual dispatch is refused when the input is given and runs as a live merge when it is not. Every other repository's pull request workflow declares the input, so this one is brought into line.
Run on this branch: unit tests pass, the integration step cannot clone the examples repositoryRun: https://github.com/51Degrees/ip-intelligence-java/actions/runs/35191695898 This branch adds the dry run input, so it was the first thing dispatched with it. The run built the branch on its own as pull request 0, so nothing was merged. What passedThe Ubuntu ARM Java 17 job got all the way through the unit tests. Maven reports "Tests run: 14, Failures: 0, Errors: 0, Skipped: 5", every module is SUCCESS, and the step ends with "BUILD SUCCESS" and "LASTEXITCODE = 0". What failed, and why it is the dispatch rather than the codeThe next step, "Run Integration Tests", stopped straight away:
For contrast, device-detection-java does not have the problem, because its own One related thing worth tidying whilst this is open
I have not changed anything, because deciding what the examples branch should be when the run is on a feature branch (fall back to main, or look the branch up first and fall back if it is missing) changes what the nightly does as well, and that is a call for a reviewer rather than something to slip in. The same thing will affect any dry run dispatch of this workflow until it is settled. The pull request has not been marked ready and no review has been requested. |
What is wrong
.github/workflows/pull-requests.ymlpassesdryrun: ${{ inputs.dryrun || false }}to the shared pull request workflow, but its
workflow_dispatchtrigger declaresno inputs at all. Two things follow from that.
HTTP 422: Unexpected inputs provided: ["dryrun"], so the workflow cannot berun as a dry run at all.
dryrunfalse, which is a live runthat can merge, when the person dispatching it may only have wanted to see
whether a branch builds.
Every other Java repository's pull request workflow declares the input, for
example
device-detection-java/.github/workflows/pull-requests.ymlandip-intelligence-java-examples/.github/workflows/pull-requests.yml, so this oneis the odd one out.
The change
Declare the
dryrunboolean input onworkflow_dispatch, defaulting to false,so the expression already in the file has something to read.
How it was checked
gh workflow run "Pull Requests" -R 51Degrees/ip-intelligence-java --ref main -f dryrun=trueonmainanswerscould not create workflow dispatch event: HTTP 422: Unexpected inputs provided: ["dryrun"]. The same command againstdevice-detection-java, whose workflowdeclares the input, starts a run.
Still outstanding, and not in this change
While checking the above I found that the nightly and pull request runs of this
repository pass no test resource key to the shared workflow, so every cloud test
asks to be skipped and the job still reports success. In the nightly run of
16 September 2026, run 35050420604, job "Build and Test - 176 - Ubuntu_Java_17",
these all report
Tests run: n, Failures: 0, Errors: 0, Skipped: n, meaningnothing ran:
fiftyone.ipintelligence.cloud.data.ValueCloudTests(1 of 1 skipped)fiftyone.ipintelligence.cloud.flowelements.MissingPropertyHandlingTests(1 of 1 skipped)
fiftyone.ipintelligence.CloudRequestOriginTests(3 of 3 skipped)GettingStartedCloudTest,MetadataCloudTest,GetAllPropertiesCloudTest,GettingStartedCloudMixedTest,GettingStartedWebCloudTestandGettingStartedWebCloudMixedTestThe cause is that
ci/run-unit-tests.ps1andci/run-integration-tests.ps1pass
-DTestResourceKey=$($Keys.TestResourceKey), and thePullRequestsjob inboth
pull-requests.ymlandnightly-pipeline.ymllists noTestResourceKeysecret, so the value is empty and the tests'
assumeFalse(isInvalidKey(key))skips them. The publish job in
nightly-pipeline.ymlalready passes a key, sothe secret exists and only needs adding to the two pull request jobs. That
change touches a secret reference and is left for a person to make.
Related
#178 turns the
cloud tests in this repository back on. Those tests still ask to be skipped
in CI until the
TestResourceKeysecret is added to the two jobs namedabove, which is the change left for a person to make.
Also found, and not changed here
The integration step of this repository fails for every pull request whose
branch name has no twin in
ip-intelligence-java-examples, which is almostall of them, including this one.
ci/run-integration-tests.ps1line 24 clones the examples repository at thepull request's own branch:
steps/clone-repo.ps1in common-ci runsgit clone --branch $Branchwith$PSNativeCommandUseErrorActionPreference = $true, so a branch that is notthere is not a fall back to
main, it is an error that ends the step. In therun on this branch,
35164943716,
job
Build and Test - 0 - Ubuntu_ARM_Java_17, the unit tests all pass andBUILD SUCCESSis reported, and then:Every other job in that run was cancelled by the matrix rather than failing
on its own.
device-detection-java/ci/run-integration-tests.ps1calls thesame step with no
-Branchat all, so it takesmainand works, which iswhy that repository does not show this.
The script also declares
[string]$ExamplesBranch = $Branchon line 10 andnever reads it, which suggests the examples branch was meant to be settable
on its own. Choosing between falling back to
mainwhen the branch isabsent, and wiring up
$ExamplesBranch, is a decision rather than a tidy up,so it is left out of this change.
Why this is still a draft, 17 September 2026
Three things stand between this branch and a green run, and none of them is in
this change.
ci/run-integration-tests.ps1still clonesip-intelligence-java-examplesat this branch's own name, which does notexist there, so the step ends with
fatal: Remote branch <branch> not found in upstream origin..github/workflows/pull-requests.ymlpasses noTestResourceKeyto the shared workflow, so a cloud test either skips orfails with
A resource key is required to access the cloud server.Points 1 and 2 are fixed by
#180, which falls
back to
mainwhen the branch has no twin in the examples repository and passesthe bespoke resource key secret to the pull request and nightly jobs. Its own run
35252381918
shows both working, with the line
No 'fix/pr-workflow-examples-branch-and-key' branch in 'ip-intelligence-java-examples', using 'main'and no resource key error anywhere in the log.
Point 3 is what that run then failed on, in the examples repository rather than
here:
So this pull request stays a draft until #180 has merged and the
CompareOnPremTestfailure inip-intelligence-java-exampleshas been cleared.Both are outside this repository's control, so someone with the examples
repository and the CI secrets has to clear them.