Skip to content

Pass the CI secrets with secrets: inherit on main - #254

Closed
jwrosewell wants to merge 2 commits into
mainfrom
ci/secrets-inherit-main
Closed

jwrosewell wants to merge 2 commits into
mainfrom
ci/secrets-inherit-main

Conversation

@jwrosewell

Copy link
Copy Markdown
Contributor

This pull request is based on main and targets main. It changes only CI workflows and ci/ scripts and publishes no package of its own, so it may go into main between monthly releases. It stays a draft to be merged by an administrator. The "Only rc into main" check fails on it by design, because its head is not rc.

Read "What it releases" before merging. main already holds unreleased package changes, and this lets the nightly that would publish them run again.

The problem

On 22 and 23 November the shared workflows in common-ci stopped declaring named secrets and stopped handing secrets to a repository's scripts as parameters or as Keys (common-ci #360 released in #356, then #362 released in #363). Each job now exports the secrets into the environment under their own names. The signing secrets go only to the job that builds the packages, the publishing ones only to the job that publishes, and the steps that download data files set _51DEGREES_LICENSE_KEY from the data license.

rc already does this, but main still passes the secrets by name, so the Nightly Pipeline on main has ended in startup_failure every night since 23 November, for example run 46567577301 on 1 December, and so has the Example Assets Update. Once started, main's scripts would fail too, because ci/build-package.ps1 and ci/publish-package.ps1 take a mandatory Keys and pass keys to common-ci's Java scripts, which no longer take them, and ci/fetch-assets.ps1 passes -DeviceDetection to the shared steps/fetch-assets.ps1, which no longer takes it.

What this changes

Every file is under .github/workflows or ci:

  • The eight workflows that call a shared workflow (data-file-change.yml, example-assets-update.yml, monthly-copyright-update.yml, nightly-pipeline.yml, package-update.yml, publish.yml, pull-requests.yml and submodule-update.yml) pass secrets: inherit in place of the named secrets, as rc does. Nothing else in them changes.
  • ci/build-package.ps1 and ci/publish-package.ps1 take no keys and pass none to common-ci's Java scripts, which read them from the environment, as on rc.
  • ci/fetch-assets.ps1 takes no secrets and downloads the TAC and Enterprise IP Intelligence data files with the data license, as rc does. It no longer asks for 20000 User Agents.csv, which the shared step stopped fetching in the same change and which nothing on main reads (UA_FILE in the shared test helpers is declared and never used).
  • ci/run-unit-tests.ps1, ci/run-integration-tests.ps1 and ci/run-performance-tests.ps1 give the tests _51DEGREES_RESOURCE_KEY_BESPOKE and _51DEGREES_LICENSE_KEY under the Maven properties the tests on main read (TestResourceKey, SuperResourceKey and LicenseKey). The IP Intelligence examples and benchmark now always run, because the Enterprise data file is now always fetched, where before they ran only when IPI_DATA_FILE_URL was given.
  • ci/README.md names the secrets as they are now.

The other differences between main and rc in these files are left for the next release from rc.

What it releases

Nothing that main does not already plan. git diff --stat origin/main lists 15 files, all under .github/workflows and ci, and no package includes either folder.

main itself, though, has been unreleased since 4.5.130. The release pull request #112 merged on 13 November and 226 files outside documentation, .github and ci have changed since the 4.5.130 tag. So ci/get-next-package-version.ps1 gives 4.5.131 and common-ci's steps/package-update-required.ps1 exits 0, meaning release, both on main and on this branch:

java at origin/main: next=4.5.131 shared-check exit=0
java at ci/secrets-inherit-main: next=4.5.131 shared-check exit=0

Before 23 November the nightly on main tried to publish 4.5.131 every night and stopped at the Build job, with Unsupported class file major version 69, for example run 44979653277 on 22 November. Once this is merged, the nightly runs again, and if its Build and Test jobs pass it publishes 4.5.131 to Maven Central with no one starting it. Whether main should release 4.5.131 now is a decision for whoever merges this.

How it was verified

The Nightly Pipeline was started on this branch with dryrun set, run 46628057343. It started, which main has not done since 23 November.

  • Nightly Data File Change, Nightly Package Update, Nightly Submodule Update, Get Pull Requests and the pull request Configure job passed. The asset prefetch downloaded the TAC and Enterprise IP Intelligence data files with the data license.
  • Nightly Publish Configure printed version=4.5.131 and found an update required, as above, and its release interval check printed The last release, 4.5.130, was on 5 November 2026, so the next may go from 12 November 2026. All seven Pre Build jobs passed.
  • The Build job exported the signing secrets and stopped in mvn deploy with Unable to get publisher server properties for server id: central. common-ci #360 removed the central server from common-ci's java/settings.xml, and the central-publishing-maven-plugin 0.7.0 that the poms configure with publishingServerId central looks that server up even with -DskipPublishing=true, which common-ci passes. So Test and Package were skipped. rc's poms configure the plugin the same way, and rc's build was not run here.
  • The pull request build of this branch (pull request 0) failed on Ubuntu Java 11 in two DidClientLiveTests tests, with {"context":"unreadable"} expected:<VERIFIED> but was:<UNKNOWN>, and fail-fast cancelled the other entries. Every other test in the reactor up to pipeline.did passed. LiveCloudKeys on main reads the licence key from _51DEGREES_LICENSE_KEY before _51DEGREES_LICENSE_KEY_BESPOKE, and common-ci now sets _51DEGREES_LICENSE_KEY to the data license in that step, where before 23 November it was not set and those tests skipped. The resource key the tests find is _51DEGREES_RESOURCE_KEY_BESPOKE, and the Cloud 51Did workflow on main notes that the service redeems only with a licence key of the resource key's own account. The nightly on main runs these unit tests only for a pull request into main itself, because it builds the pull requests into rc with rc's scripts and tests.

When rc next goes into main

rc changes each of these files further, so the release pull request from rc will meet conflicts in them. Take rc's version of every file this changes.

What remains

  1. The Build failure above, which stops the publish from main, and rc's too if its poms meet the same, until common-ci's java/settings.xml defines a central server again or the plugin no longer needs one when publishing is skipped. Until then the nightly on main cannot publish 4.5.131.
  2. The two DidClientLiveTests failures in a pull request build of main's own code, above.
  3. This pull request stays a draft until it is merged by an administrator.

The shared common-ci workflows no longer declare named secrets, so a
caller that passes them by name fails to start. They export each
secret into the environment under its own name rather than handing the
secrets to the repository's scripts as parameters, and give the
signing secrets only to the job that builds the packages and the
publishing ones only to the job that publishes.

Every workflow that calls a shared workflow passes the secrets with
secrets: inherit, as rc does.

The CI scripts take no secrets as parameters, as on rc.
build-package.ps1 and publish-package.ps1 no longer pass keys to
common-ci's Java scripts, which read them from the environment.
fetch-assets.ps1 downloads the TAC and Enterprise IP Intelligence data
files with the data license, and no longer asks for "20000 User
Agents.csv", which the shared step no longer fetches and nothing on
main reads. The unit, integration and performance test scripts give
the tests _51DEGREES_RESOURCE_KEY_BESPOKE and _51DEGREES_LICENSE_KEY
under the Maven properties they read on main, and run the IP
Intelligence examples and benchmark every time, because the Enterprise
data file is now always fetched. ci/README.md lists the secrets as
they are now.

Only .github/workflows and ci change.
@jwrosewell jwrosewell mentioned this pull request Dec 2, 2026
@Tracy51D Tracy51D closed this Dec 4, 2026
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.

2 participants