Skip to content

fix(QTDI-3123): Also deploy SNAPSHOTs to internal Nexus on master builds#1252

Merged
lxia-talend merged 3 commits into
masterfrom
copilot/QTDI-3123_deploy_snapshots_to_nexus
Jul 10, 2026
Merged

fix(QTDI-3123): Also deploy SNAPSHOTs to internal Nexus on master builds#1252
lxia-talend merged 3 commits into
masterfrom
copilot/QTDI-3123_deploy_snapshots_to_nexus

Conversation

@lxia-talend

@lxia-talend lxia-talend commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Requirements

  • Any code change adding any logic MUST be tested through a unit test executed with the default build
  • Any API addition MUST be done with a documentation update if relevant

Why this PR is needed?

PR #1515 (QTDI-1369) bumped component-runtime.version from 1.93.01.94.0-SNAPSHOT in connectors-se. This caused persistent Jenkins build failures: the connectors-se Jenkins agents cannot reach central.sonatype.com (network blocked), and component-runtime master builds were deploying SNAPSHOTs only to central.sonatype.com — not to the internal Nexus (artifacts-zl.talend.com). Maven caches the resolution failure, causing all subsequent builds to fail.
Jira ticket: QTDI-3123

What does this PR adds (design/code thoughts)?

In the Maven deploy stage of Jenkinsfile, adds a second mvn deploy call guarded by if (stdBranch_buildOnly) (master/maintenance builds only). The call activates -Pprivate_repository to also publish SNAPSHOTs to artifacts-zl.talend.com/nexus/content/repositories/snapshots using nexusCredentials (no GPG signing needed for internal Nexus).
Why two separate Maven invocations? Activating both -Possrh -Psnapshot and -Pprivate_repository in a single call would deploy only to Nexus because private_repository overrides snapshotRepository. Two separate calls are the only correct way to publish to both endpoints.
Compliance notes (committed history — not rewritten):

  • ⚠️ Commit subjects slightly exceed the 50-char recommendation (55 and 52 chars)
  • ℹ️ Pre-existing bash mvn deploy typo in the first deploy call is out of scope per approved plan

AI generated code

https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code

  • this PR has been written with the help of GitHub Copilot or another generative AI tool

On master/maintenance builds (stdBranch_buildOnly=true), add a second
mvn deploy call using -Pprivate_repository to publish SNAPSHOTs to
artifacts-zl.talend.com in addition to central.sonatype.com.
connector-se Jenkins agents cannot reach central.sonatype.com
(network blocked), causing PR builds to fail with 'Connection reset'
when component-runtime.version references a SNAPSHOT version.
Co-Authored-By: GitHub Copilot <copilot@github.com>
Co-Authored-By: GitHub Copilot <copilot@github.com>
@lxia-talend

Copy link
Copy Markdown
Contributor Author

🔍 Scope & Design Review — Round 1

# Severity File Description Suggested Fix
1 MINOR Jenkinsfile String nexusDeployOptions uses explicit type where the file convention uses def for local variables Changed to def nexusDeployOptions = ...
Verdict: ✅ APPROVED — no Blocker or Major findings. 1 Minor finding found and fixed inline before PR creation.

Approval rationale

  • if (stdBranch_buildOnly) guard correctly excludes dev branches (which already deploy to Nexus via the first call)
  • Credentials binding (nexusCredentials) injects the correct env vars for the talend.snapshots server
  • Two separate Maven invocations correctly avoid the private_repository profile conflict
  • If the first deploy fails, the second is never triggered (correct behaviour)
  • No Blocker or Major findings

✅ Compliance Check

File Severity Finding Rule
Jenkinsfile ⚠️ Warning Commit subject 1 exceeds 50 chars (55): "Also deploy SNAPSHOTs to internal Nexus on master builds" Commit message format
Jenkinsfile ⚠️ Warning Commit subject 2 exceeds 50 chars (52): "Fix minor style issue in Jenkinsfile (def vs String)" Commit message format
Jenkinsfile ℹ️ Info Pre-existing bash mvn deploy typo in first deploy call — out of scope per approved plan Build conventions
Verdict: ✅ PASSED — No Critical findings. Warnings are committed history (Git rewrite disproportionate for commit message length). All findings noted above.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the CI pipeline so master/maintenance builds publish SNAPSHOT artifacts not only to Sonatype Central Portal snapshots, but also to the internal Nexus (artifacts-zl.talend.com) to unblock downstream builds that cannot reach central.sonatype.com.

Changes:

  • Add a second mvn deploy invocation on stdBranch_buildOnly builds, activating private_repository to deploy SNAPSHOTs to internal Nexus.
  • Extend the Jenkins job description to mention the additional internal Nexus deployment on standard branches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Jenkinsfile
Comment thread Jenkinsfile
Comment on lines +498 to +500
if (stdBranch_buildOnly) {
JenkinsStatusController.jobDescriptionAppend("Maven artefact also deployed as ${finalVersion} on [artifacts-zl.talend.com](https://artifacts-zl.talend.com/nexus/content/repositories/snapshots/org/talend/sdk/component) ")
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02876ad0049 — extracted the Nexus snapshot URL to a local nexusSnapshotUrl variable in the description script {} block; both repo[1] (devBranch path) and the jobDescriptionAppend (stdBranch path) now reference the variable.

Comment thread Jenkinsfile Outdated
// can resolve SNAPSHOT dependencies.
script {
if (stdBranch_buildOnly) {
def nexusDeployOptions = "$skipOptions --activate-profiles private_repository -Denforcer.skip=true"

@thboileau thboileau Jul 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there could be a global variable called nexusDeployOptions (cf line 474) which will be used twice:

  • line 286: deployOptions = nexusDeployOptions
  • line 479

simply move the line 474 higher in the code in order to declare a global variable nexusDeployOptions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02876ad0049 (incorporating @thboileau's guidance in the reply below) — added String nexusDeployOptions = "$skipOptions --activate-profiles private_repository -Denforcer.skip=true" as a global variable next to skipOptions/deployOptions. The devBranch qualify block now uses deployOptions = nexusDeployOptions and the stdBranch deploy uses the global directly; the local def nexusDeployOptions has been removed.

@lxia-talend lxia-talend requested review from thboileau and undx July 10, 2026 06:43
- Fix typo in comment: connector-se -> connectors-se
- Extract nexusDeployOptions as global variable; reuse at
  devBranch qualify block (line 286) and stdBranch deploy
- Extract nexusSnapshotUrl as local variable in description
  block to eliminate duplicated URL
Co-Authored-By: GitHub Copilot <copilot@github.com>
@lxia-talend

Copy link
Copy Markdown
Contributor Author

Review round 1 — summary

Comment Class Action
#1 (Copilot) — Typo connector-se vs connectors-se in Jenkinsfile comment Code fix Fixed in 02876ad0049
#2 (Copilot) — Nexus URL duplicated in description block Code fix Fixed in 02876ad0049 — extracted to nexusSnapshotUrl local variable
#3 (Copilot) — Deploy options string duplicated at lines 286 + 474 Code fix Fixed in 02876ad0049
#4 (thboileau) — Declare global nexusDeployOptions, reuse in both places Code fix Fixed in 02876ad0049 — global var added; both usages replaced
Fixes pushed: 02876ad0049 — fix(QTDI-3123): Address round 1 review comments
Pending clarifications: 0
Already addressed: 0
Rebase on master: no
Round summary generated by AI. Please resolve threads after verifying the fixes.

@sonar-rnd

sonar-rnd Bot commented Jul 10, 2026

Copy link
Copy Markdown

@lxia-talend lxia-talend merged commit d984994 into master Jul 10, 2026
8 checks passed
@lxia-talend lxia-talend deleted the copilot/QTDI-3123_deploy_snapshots_to_nexus branch July 10, 2026 10:04
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.

3 participants