Skip to content

ci: cleanup/re-organisation - #8807

Merged
torcolvin merged 2 commits into
mainfrom
ci-cleanup
Sep 15, 2026
Merged

torcolvin merged 2 commits into
mainfrom
ci-cleanup

Conversation

@bbrks

@bbrks bbrks commented Sep 15, 2026

Copy link
Copy Markdown
Member

Several recent PRs have introduced more scripts, helpers or job definitions, but spread throughout the repo without too much consistency.

This PR attempts to clean that up and organise a little better by nesting underneath .ci where appropriate (dev-time scripts remain in their existing places):

  • Move all shared CI scripts/utils into the .ci directory
  • Move Jenkinsfiles into .ci/jenkins/<job> subdirectories
  • Root Jenkinsfile remains - multibranch pipelines discovers it there and is where you'd expect it
  • Fixes shellcheck glob for nested shell scripts
  • .github remains for GitHub Action only jobs/scripts

TODO in Jenkins

  1. Merge PR so main has the new layout
  2. Update the Script Path on the six Jenkins jobs (they load their Jenkinsfile from main, so doing this first points them at files that don't exist yet):
job new Script Path
MainIntegration-Pipeline .ci/jenkins/MainIntegration/Jenkinsfile
SyncGatewayIntegration-Pipeline .ci/jenkins/SyncGatewayIntegration/Jenkinsfile
SyncGatewayIntegrationWeekly .ci/jenkins/SyncGatewayIntegrationWeekly/Jenkinsfile
TopologyTests .ci/jenkins/TopologyTests/Jenkinsfile
e2e .ci/jenkins/e2e/Jenkinsfile
update-git-docs-tag .ci/jenkins/update-git-docs-tag/Jenkinsfile

Integration Tests

  • n/a

The Jenkins pipelines were spread over three directories: a Jenkinsfile at the
repo root, one under jenkins/, and five under integration-test/ alongside the
test scripts. Collect the job definitions under .ci/jenkins/ and the helpers
they share with each other in .ci/, next to retry.sh.

slack_usernames.yaml moves out of .github/ because only jenkinsHelpers.groovy
reads it - nothing in GitHub Actions does.

The three job Jenkinsfiles that fetch jenkinsHelpers.groovy from main now fetch
slack_usernames.yaml too. It previously sat at a path every branch had, so a
build of an older SG_COMMIT found it in the checkout; after the move it would be
missing there and the fileExists guard would quietly skip the Slack DM.

Scripts that are also meant to be run by hand stay where they are - build.sh,
test.sh, integration-test/*.sh and start_cbs.py. integration-build.sh moves
because it is Jenkins-only: it rewrites global git config on the agent.

The root Jenkinsfile stays put, since multibranch pipelines discover it there.

Also widen the shell workflow's path filter from "*.sh" to "**.sh". A path
filter's "*" does not cross "/", so changing any of the nine shell scripts
outside the repo root - including integration-test/e2e/run_e2e_tests.sh and the
service installers - never triggered shellcheck.

Updating the Script Path of the six Jenkins jobs is a separate manual step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bbrks
bbrks requested review from a team and a lite review from Copilot September 15, 2026 12:16
@factory-droid

factory-droid Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Droid finished @bbrks's task —— View job


Validation complete (Pass 2).

Summary: CI layout changes look consistent, but two correctness issues stand out: the e2e job’s failure post block can throw if helpers were never fetched, and SyncGatewayIntegration can no longer test older SG_COMMITs because the integration-build script moved without a fallback.

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.

🔵 Needs a closer look

Five unresolved critical Jenkins pipeline issues block approval.

Pull request overview

Reorganizes shared CI assets and Jenkins job definitions under .ci, updating pipeline references and shell workflow coverage.

Changes:

  • Relocates Jenkinsfiles, helpers, Slack mappings, and integration scripts.
  • Updates documentation and CI paths.
  • Expands nested shell-script detection and adds maintenance jobs.
File summaries
File Reviewed changes and findings
Jenkinsfile Loads relocated Jenkins helpers.
AGENTS.md Documents the new CI layout.
.github/workflows/shell.yml Expands nested shell-script matching.
.ci/slack_usernames.yaml Relocated Slack mappings.
.ci/jenkinsHelpers.groovy Updates helper and mapping paths.
.ci/jenkins/update-git-docs-tag/Jenkinsfile Critical (1 vote): Tag deletion and recreation are not atomic.
.ci/jenkins/TopologyTests/Jenkinsfile Critical (3 votes): Older commits may lack the relocated runner and retry dependency.
.ci/jenkins/SyncGatewayIntegrationWeekly/Jenkinsfile Critical (2 votes): Docker Hub tag parsing fails due to JSON whitespace.
.ci/jenkins/SyncGatewayIntegration/Jenkinsfile Critical (3 votes): Older commits may lack the relocated runner and retry dependency.
.ci/jenkins/MainIntegration/Jenkinsfile Critical (3 votes): Older commits may lack the relocated runner and retry dependency.
.ci/jenkins/integration-build.sh Relocated integration test runner.
.ci/jenkins/e2e/Jenkinsfile Updates E2E CI paths.
Review details

Suppressed comments (3)

.ci/jenkins/MainIntegration/Jenkinsfile:96

  • This job checks out params.SG_COMMIT, which may be a release or older branch that predates the move to .ci/jenkins/integration-build.sh. Only the helper and Slack map are fetched from main, so the later runner invocation can fail before any tests run; fetch the current runner and its .ci/retry.sh dependency here and make them executable, as the E2E job does for its fetched scripts.
    .ci/jenkins/SyncGatewayIntegration/Jenkinsfile:153
  • This job checks out params.SG_COMMIT, which may be a release or older branch that predates the move to .ci/jenkins/integration-build.sh. Only the helper and Slack map are fetched from main, so the later runner invocation can fail before any tests run; fetch the current runner and its .ci/retry.sh dependency here and make them executable, as the E2E job does for its fetched scripts.
    .ci/jenkins/TopologyTests/Jenkinsfile:120
  • This job checks out params.SG_COMMIT, which may be a release or older branch that predates the move to .ci/jenkins/integration-build.sh. Only the helper and Slack map are fetched from main, so the later runner invocation can fail before any tests run; fetch the current runner and its .ci/retry.sh dependency here and make them executable, as the E2E job does for its fetched scripts.
  • Files reviewed: 8/12 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .ci/jenkins/e2e/Jenkinsfile
Comment thread .ci/jenkins/SyncGatewayIntegration/Jenkinsfile
@torcolvin torcolvin assigned bbrks and unassigned torcolvin Sep 15, 2026
SG_COMMIT can be an arbitrary branch, and anything predating the move of
jenkins-integration-build.sh into .ci/jenkins dies on the missing path
before a single test runs. Fetch it from main alongside the helpers, and
.ci/retry.sh with it since the script calls that.

Doesn't make older branches runnable on its own - main's script also wants
start_cbs.py, the integration-test/tools module and the go.mod tool
directives, none of which exist on release/4.1.x or earlier. Those need
the .ci move backporting.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@torcolvin
torcolvin merged commit 060f37f into main Sep 15, 2026
50 checks passed
@torcolvin
torcolvin deleted the ci-cleanup branch September 15, 2026 18:38
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