Repository navigation
Align with commercial build support - #1537
Conversation
Align spring-pulsar's Gradle and CI setup with spring-pulsar-commercial so the same workflow files and build scripts can run, largely unmodified, in both repositories. - Add an `isCI` Gradle variable in a buildscript block and conditionally apply a new `commercial-settings.gradle` when the `COMMERCIAL` environment variable is set (i.e. only in the commercial repository). Inert in OSS. - `commercial-settings.gradle` resolves artifacts from the enterprise Artifactory repositories in CI, falling back to the spring-commercial remote for local development. - Recognize `*.x-internal` maintenance branches alongside `main` and `*.x` in the CI-triggering workflows (ci.yml, ci-pr.yml). - Relax the repository guard from `github.repository == spring-projects/ spring-pulsar` to `github.repository_owner == spring-projects` so CI also runs in the commercial repository. - Introduce a `vars.COMMERCIAL` repository variable as the single source of truth for repo-specific behavior: it selects the Artifactory URL/repository for snapshot deployment and, together with `COMMERCIAL_ARTIFACTORY_*` secret fallbacks, the deploy credentials. - Gate the OSS-only `deploy_docs_antora` and Maven Central `perform_release` jobs on `!vars.COMMERCIAL`; commercial docs and releases are handled by the release-train workflows. - Add release-train automation workflows (release-train-build/join/leave/ ready/retry/test) and their composite actions, plus a `post-release.yml` gated on `vars.COMMERCIAL`, and the `.github/workflow-generator.yml` config. Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
artembilan
left a comment
There was a problem hiding this comment.
Thanks for doing this, Soby!
But as we have discussed many times: it is not that easy since the project diverges from our experience in other projects.
Let's hope we can nail it anyway!
|
|
||
| jobs: | ||
| release: | ||
| # Commercial-only: in OSS, post-release automation runs inside ci.yml's perform_release job. |
There was a problem hiding this comment.
I don't think this is correct.
The ci.yml is not use for release anymore.
The tag is going to be pushed to repository by the Orchestrator.
Therefore, on: push: tags: is still valid, and this condition is wrong.
There was a problem hiding this comment.
maybe we should eventually drop the perfom_release from ci.yml.
There was a problem hiding this comment.
I think that should be a separate task.
For now we need to assume that release-related code in the ci.yml is dead because we are not going to release manually anymore.
| contents: write | ||
| issues: write | ||
|
|
||
| uses: spring-io/spring-github-workflows/.github/workflows/spring-post-release.yml@main |
There was a problem hiding this comment.
We need to double check if the logic in that spring-post-release.yml is valid for this project: https://github.com/spring-io/spring-github-workflows/blob/main/.github/workflows/spring-post-release.yml
There was a problem hiding this comment.
Looks good to me from what i can see.
| uses: "actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95" # v5.6.0 | ||
| with: | ||
| distribution: "liberica" | ||
| java-version: "17" |
There was a problem hiding this comment.
I think the copy/paste artifact.
According to the generator has to be Java 25.
I see the same problem in SA, SK & SI.
Will fix there shortly.
Thank you for doing this, so we spot problems on review! 😄
| // Commercial build support: applied only when the COMMERCIAL repository variable is | ||
| // propagated into the environment (i.e. in the spring-pulsar-commercial repository). | ||
| // Inert in OSS builds where COMMERCIAL is unset. | ||
| if (System.getenv('COMMERCIAL')) { |
There was a problem hiding this comment.
Yeah... This feels a bit fragile.
I my understand why you cannot rely on the ARTIFACTORY_USERNAME like we do in other projects but then this COMMERCIAL has to be propagated in more places to the ENV.
SNAPSHOT build, PR build, release train build and test.
Or... the logic in those workflows has to be revisited to not use ARTIFACTORY_USERNAME...
There was a problem hiding this comment.
I tried to rework it so that it is now gated on the ARTIFACTORY_USERNAME condition.
Align with the sibling Spring projects (spring-kafka, spring-amqp,
spring-integration) instead of the bespoke COMMERCIAL env-var mechanism.
- Gate commercial-settings.gradle on ARTIFACTORY_USERNAME, apply it via
${rootProject.projectDir}, and add the isDependabotPr guard. Presence of
the commercial credential is now the single trigger, so the release-train
build/test workflows (which already export it) need no further changes.
- Source ARTIFACTORY_USERNAME/PASSWORD from the COMMERCIAL_* secrets in
ci.yml and ci-pr.yml (empty in OSS, so the settings stay inert there),
keeping the OSS snapshot-deploy gate via a step-scoped fallback. Drop the
now-unused COMMERCIAL env var; vars.COMMERCIAL still drives the
workflow-level switches.
- Drop the vars.COMMERCIAL gate from post-release.yml so it runs on v* tag
push in both repositories.
- Fix the release-train Java version (17 -> 25) in release-train-test.yml.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Only the read-only artifactory secrets are available to PR builds, so source ARTIFACTORY_USERNAME/PASSWORD from those in ci-pr.yml. Aligns with the sibling projects. Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Align spring-pulsar's Gradle and CI setup with spring-pulsar-commercial so
the same workflow files and build scripts can run, largely unmodified, in
both repositories.
isCIGradle variable in a buildscript block and conditionallyapply a new
commercial-settings.gradlewhen theCOMMERCIALenvironmentvariable is set (i.e. only in the commercial repository). Inert in OSS.
commercial-settings.gradleresolves artifacts from the enterpriseArtifactory repositories in CI, falling back to the spring-commercial
remote for local development.
*.x-internalmaintenance branches alongsidemainand*.xin the CI-triggering workflows (ci.yml, ci-pr.yml).
github.repository == spring-projects/ spring-pulsartogithub.repository_owner == spring-projectsso CI alsoruns in the commercial repository.
vars.COMMERCIALrepository variable as the single source oftruth for repo-specific behavior: it selects the Artifactory URL/repository
for snapshot deployment and, together with
COMMERCIAL_ARTIFACTORY_*secret fallbacks, the deploy credentials.
deploy_docs_antoraand Maven Centralperform_releasejobs on
!vars.COMMERCIAL; commercial docs and releases are handled by therelease-train workflows.
ready/retry/test) and their composite actions, plus a
post-release.ymlgated on
vars.COMMERCIAL, and the.github/workflow-generator.ymlconfig.Signed-off-by: Soby Chacko soby.chacko@broadcom.com