Skip to content

CI: Let the pull request workflow be dispatched as a dry run - #177

Draft
jwrosewell wants to merge 1 commit into
mainfrom
ci/dispatch-as-dry-run
Draft

jwrosewell wants to merge 1 commit into
mainfrom
ci/dispatch-as-dry-run

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

What is wrong

.github/workflows/pull-requests.yml passes dryrun: ${{ inputs.dryrun || false }}
to the shared pull request workflow, but its workflow_dispatch trigger declares
no inputs at all. Two things follow from that.

  1. A dispatch that gives the input is refused, with
    HTTP 422: Unexpected inputs provided: ["dryrun"], so the workflow cannot be
    run as a dry run at all.
  2. A dispatch that gives no input runs with dryrun false, which is a live run
    that 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.yml and
ip-intelligence-java-examples/.github/workflows/pull-requests.yml, so this one
is the odd one out.

The change

Declare the dryrun boolean input on workflow_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=true on main answers
could not create workflow dispatch event: HTTP 422: Unexpected inputs provided: ["dryrun"]. The same command against device-detection-java, whose workflow
declares 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, meaning
nothing 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)
  • the examples repository's GettingStartedCloudTest, MetadataCloudTest,
    GetAllPropertiesCloudTest, GettingStartedCloudMixedTest,
    GettingStartedWebCloudTest and GettingStartedWebCloudMixedTest

The cause is that ci/run-unit-tests.ps1 and ci/run-integration-tests.ps1
pass -DTestResourceKey=$($Keys.TestResourceKey), and the PullRequests job in
both pull-requests.yml and nightly-pipeline.yml lists no TestResourceKey
secret, so the value is empty and the tests' assumeFalse(isInvalidKey(key))
skips them. The publish job in nightly-pipeline.yml already passes a key, so
the 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 TestResourceKey secret is added to the two jobs named
above, 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 almost
all of them, including this one.

ci/run-integration-tests.ps1 line 24 clones the examples repository at the
pull request's own branch:

./steps/clone-repo.ps1 -RepoName $ExamplesRepo -OrgName $OrgName -Branch $Branch

steps/clone-repo.ps1 in common-ci runs git clone --branch $Branch with
$PSNativeCommandUseErrorActionPreference = $true, so a branch that is not
there is not a fall back to main, it is an error that ends the step. In the
run on this branch,
35164943716,
job Build and Test - 0 - Ubuntu_ARM_Java_17, the unit tests all pass and
BUILD SUCCESS is reported, and then:

Cloning 'ip-intelligence-java-examples'
fatal: Remote branch ci/dispatch-as-dry-run not found in upstream origin
Program "git" ended with non-zero exit code: 128
##[error]Process completed with exit code 1.

Every other job in that run was cancelled by the matrix rather than failing
on its own. device-detection-java/ci/run-integration-tests.ps1 calls the
same step with no -Branch at all, so it takes main and works, which is
why that repository does not show this.

The script also declares [string]$ExamplesBranch = $Branch on line 10 and
never reads it, which suggests the examples branch was meant to be settable
on its own. Choosing between falling back to main when the branch is
absent, 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.

  1. The examples clone. ci/run-integration-tests.ps1 still clones
    ip-intelligence-java-examples at this branch's own name, which does not
    exist there, so the step ends with
    fatal: Remote branch <branch> not found in upstream origin.
  2. No test resource key. .github/workflows/pull-requests.yml passes no
    TestResourceKey to the shared workflow, so a cloud test either skips or
    fails with A resource key is required to access the cloud server.
  3. A failure in the examples repository that survives both of those.

Points 1 and 2 are fixed by
#180, which falls
back to main when the branch has no twin in the examples repository and passes
the 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:

[ERROR] Tests run: 1, Failures: 0, Errors: 1 <<< FAILURE!
  - in fiftyone.ipintelligence.examples.console.CompareOnPremTest
java.util.concurrent.ExecutionException: java.lang.RuntimeException: POLYGON ((...

So this pull request stays a draft until #180 has merged and the
CompareOnPremTest failure in ip-intelligence-java-examples has been cleared.
Both are outside this repository's control, so someone with the examples
repository and the CI secrets has to clear them.

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.
@jwrosewell

Copy link
Copy Markdown
Contributor Author

Run on this branch: unit tests pass, the integration step cannot clone the examples repository

Run: 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 passed

The 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 code

The next step, "Run Integration Tests", stopped straight away:

Cloning 'ip-intelligence-java-examples'
fatal: Remote branch ci/dispatch-as-dry-run not found in upstream origin
Program "git" ended with non-zero exit code: 128

ci/run-integration-tests.ps1 line 24 clones the examples repository on $Branch, and the workflow hands it the name of the branch the run is on. On a nightly that is main, which exists in the examples repository, so it works. Dispatched against a feature branch it is that feature branch, which the examples repository has never heard of, so the clone fails and the job fails with it. The matrix then cancelled the other 15 jobs, which is why the whole run is red.

For contrast, device-detection-java does not have the problem, because its own ci/run-integration-tests.ps1 calls the clone step without a branch at all and picks up the "main" default.

One related thing worth tidying whilst this is open

ci/run-integration-tests.ps1 declares $ExamplesBranch on line 10 and never uses it. Line 24 clones with $Branch instead. It reads as though somebody meant to separate the examples branch from the run's branch and the parameter never got wired up, which is the same separation the clone failure above is asking for.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant