Skip to content

KFSPTS-37768 Add Jenkinsfile.unit-test-pr for GitHub Branch Source PR build - #1930

Open
dp65 wants to merge 3 commits into
developfrom
KFSPTS-37768-unit-test-pr-jenkinsfile
Open

dp65 wants to merge 3 commits into
developfrom
KFSPTS-37768-unit-test-pr-jenkinsfile

Conversation

@dp65

@dp65 dp65 commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

Adds Jenkinsfile.unit-test-pr at the repo root to support the migration of the unit-test-develop-pr job from the deprecated GHPRB plugin to the GitHub Branch Source plugin on the new native Jenkins instances (jenkins-qa/jenkins-live).

Part of KFSPTS-37768 (Jenkins native migration).

Details

  • multibranchPipelineJob on the native Jenkins resolves scriptPath within the scanned repo checkout, so the Jenkinsfile must live in the cu-kfs repo root.
  • Uses withMaven(maven:'Maven', jdk:'jdk17') so JUnit results publish automatically to the Jenkins UI.
  • Skip on QA stage uses getBuildCauses() to distinguish webhook-triggered builds (abort) from manual "Build Now" triggers (run full tests), enabling ad-hoc validation on jenkins-qa.
  • PROPERTIES_FILE path updated from /var/jenkins_home/ (old Docker Jenkins) to /var/lib/jenkins/ (native Jenkins).

Notes

  • This change is additive only — a single new Jenkinsfile at the repo root. No existing build behavior changes.
  • The old Docker Jenkins GHPRB job will fire on this PR; that is expected and harmless.

Impact

  • Files changed: Jenkinsfile.unit-test-pr (new, 84 lines)

dp65 and others added 3 commits June 26, 2026 13:52
…PR build

Replaces the GHPRB-triggered unit-test-develop-pr job on the old Docker
Jenkins. The new jenkins-live instance uses GitHub Branch Source
(multibranchPipelineJob) which discovers PRs via GitHub App webhook and
checks out this Jenkinsfile from the PR merge commit.

Behaviour preserved from the old maven2-moduleset job:
- Builds every PR opened/updated against the develop branch
- Defaults to CYNERGY_VERSION_SUFFIX=develop, PROPERTIES_FILE=kfs-config.properties
- Overrides CYNERGY_VERSION_SUFFIX=emerg when target branch matches emergency-fix-YYYY-MM-DD
- Overrides PROPERTIES_FILE=kfs-upgrade-config.properties when PR title matches
  the version-upgrade pattern
- Runs dependency:purge-local-repository before the main test to evict
  stale cynergy-customizations artifacts from the local Maven repo
- Runs mvn clean test with the same excludes and spring profiles as the old job

Uses withMaven(maven:'Maven', jdk:'jdk17') so JUnit results are automatically
published to the Jenkins UI without a separate post{junit} block. Paths updated
from /var/jenkins_home/ to /var/lib/jenkins/ for the native Jenkins instance.

JIRA: KFSPTS-37768

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nsfile

Skip on QA was aborting all builds when JENKINS_ROLE=qa, including
manually triggered ones. Intent is to suppress only automatic
webhook/SCM-triggered builds on jenkins-qa; manual 'Build Now'
should run the full unit tests.

Checks getBuildCauses() for UserIdCause — present on manual triggers,
absent on GitHub webhook / branch-indexing triggers.

JIRA: KFSPTS-37768

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…st PR pipeline

Add -Dmaven.test.failure.ignore=true to the Unit test stage mvn command so
surefire test failures/errors no longer make Maven exit non-zero. This keeps
the `sh` step from hard-failing the pipeline; withMaven's JUnit publisher then
marks the build UNSTABLE (yellow) instead of FAILURE (red) when only the
known-broken *IntegTest/*IntegrationTest classes fail.

This matches the behavior of the legacy Maven-project job on new-jenkins, which
reported UNSTABLE for the same pre-existing integration-test errors. It is a
PR-gating policy choice, not a fix for a jenkins-qa defect.
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