Skip to content

contrib: Treat as a submodule so we don't release it separately - #9155

Merged
timosachsenberg merged 1 commit into
developfrom
pjones/contrib-submod
Apr 16, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
pjones/contrib-submod

Conversation

@pjones

@pjones pjones commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

Instead of pulling pre-built releases of contrib, build it in CI from the associated submodule.

We want to use the submodule revision hash as the way to connect an OpenMS release to a version of contrib. By doing this we make releasing OpenMS easier because we don't have to tag/release contrib and other external repositories.

Yes, this will add 45 minutes to the CI builds, but only when the contrib submodule is changed or the cached build of contrib is evicted from the cache.

Summary by CodeRabbit

  • Chores
    • Optimized the Windows build pipeline by adding a dedicated preparation job that caches and uploads a rebuilt dependency bundle with short-term (7-day) retention.
    • Updated the main Windows build to consume the prepared bundle instead of rebuilding or downloading archives, reducing duplicated work and build time.
    • Adjusted downstream build configuration to reference the prepared bundle layout for improved efficiency and reliability.

@pjones
pjones force-pushed the pjones/contrib-submod branch from 6c14786 to bf7efb9 Compare April 15, 2026 14:41
@pjones
pjones requested a review from timosachsenberg April 15, 2026 14:42
@coderabbitai

coderabbitai Bot commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Extracted Windows contrib preparation into a dedicated prepare-contrib-for-windows CI job that caches/builds and uploads contrib/build as an artifact; build-and-test now downloads that artifact and uses OpenMS/contrib/build for downstream builds.

Changes

Cohort / File(s) Summary
CI/CD Workflow (Windows contrib extraction)
.github/workflows/openms_ci_matrix_full.yml
Added Windows-only prepare-contrib-for-windows job to compute contrib submodule key, cache/build contrib/build, and upload contrib-<rev> artifact (7-day retention). Updated build-and-test to depend on it, removed in-job Windows cache/archive steps, recompute rev, download contrib-<rev> into OpenMS/contrib/build, and set OPENMS_CONTRIB_LIBS to ${{ github.workspace }}/OpenMS/contrib/build.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as "GitHub Actions (Matrix)"
    participant Win as "Windows runner\n(prepare-contrib-for-windows)"
    participant Artifact as "GitHub Artifacts"
    participant Build as "Runner\n(build-and-test)"
    participant Git as "Contrib Submodule"

    Dev->>Win: start prepare-contrib-for-windows
    Win->>Git: determine contrib submodule rev
    Win->>Win: check cache for `${{ runner.os }}-<rev>`\nbuild via CMake on cache miss
    Win->>Artifact: upload `contrib-<rev>` artifact
    Dev->>Build: start build-and-test (depends on prepare)
    Build->>Git: recompute contrib submodule rev
    Build->>Artifact: download `contrib-<rev>` -> `OpenMS/contrib/build`
    Build->>Build: set OPENMS_CONTRIB_LIBS to `.../OpenMS/contrib/build`\ncontinue build & tests
Loading

Suggested reviewers

  • timosachsenberg

Poem

🐰 I hopped through CI at break of day,
I cached the contrib to speed the way,
I bundled artifacts snug and tight,
Now Windows builds take flight at night,
Hop, hop — the pipeline's bright.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: treating contrib as a submodule to avoid separate releases, which is the core purpose of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pjones/contrib-submod

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/openms_ci_matrix_full.yml:
- Around line 94-95: The top-level needs key referencing
prepare-contrib-for-windows is forcing every matrix row to wait and blocking
non-Windows runs; remove that global dependency and instead create a dedicated
preparatory job (e.g., prepare-contrib-for-windows) that other jobs do not
implicitly need, then make only the Windows build job depend on it (or add an
explicit needs on that single Windows job) so the strategy/matrix jobs for Linux
and macOS run independently of Windows contrib prep.
- Around line 412-417: The step with id "contrib-rev" runs git submodule status
from the workflow root which is not a git repo; change the command to run in the
checked-out OpenMS directory by invoking git with -C OpenMS (i.e., update the
run block for the "Identify contrib submodule revision for cache key" step so
the git command uses git -C OpenMS submodule status --cached -- contrib) so the
submodule status is evaluated in the correct repository directory.
- Around line 51-57: The contrib-rev step is using plain echo which doesn't set
a GitHub Actions step output; change the step (id: contrib-rev) to write the
output into $GITHUB_OUTPUT (e.g., append "rev=$rev" to $GITHUB_OUTPUT) so that
steps.contrib-rev.outputs.rev is populated; apply the same change to the other
identical step(s) that set the contrib submodule revision (the later block
around the other occurrence) so cache keys and artifact names include the actual
submodule revision.
- Around line 72-81: The CI step "Build contrib if not in cache" currently only
runs the cmake generator command (cmake -G"Visual Studio 17 2022" -Ax64
-DBUILD_TYPE=ALL ...) which produces project files but does not compile
binaries; after the existing cmake generation call add an explicit build
invocation (using the same parallelism env var $NPROC /
$env:CMAKE_BUILD_PARALLEL_LEVEL) to actually build the generated Visual Studio
solution (e.g. run cmake --build . --config Release with parallel build flags)
so the expected lib/, bin/, and include/ outputs are produced before artifact
upload. Ensure the build runs in the same working directory set by Set-Location
"${{ github.workspace }}\contrib\build" and that failures propagate (exit on
non-zero).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ec6b5b67-2451-4155-94a1-4e0322e8070c

📥 Commits

Reviewing files that changed from the base of the PR and between cf71232 and bf7efb9.

📒 Files selected for processing (1)
  • .github/workflows/openms_ci_matrix_full.yml

@timosachsenberg

Copy link
Copy Markdown
Contributor

Sounds good - seems it could make things easier on Windows (and is a temporary solution).
I am not sure if build times are sufficient on the Windows runner though and more importantly, if caches are counted on the repo (not Org) level.
@jpfeuffer do you know?

@pjones
pjones force-pushed the pjones/contrib-submod branch 2 times, most recently from 477212a to e90e588 Compare April 15, 2026 15:00
@pjones

pjones commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@timosachsenberg Build times are per job not per runner or per workspace so it shouldn't be a problem. I did a full CI build without caching and it was fine.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

♻️ Duplicate comments (2)
.github/workflows/openms_ci_matrix_full.yml (2)

94-95: ⚠️ Potential issue | 🟠 Major

Don’t gate the full matrix on the Windows contrib prep job.

Line 95 makes Linux and macOS wait for a Windows-only cache/build path. On a cache miss, that turns the stated Windows slowdown into a whole-matrix slowdown.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/openms_ci_matrix_full.yml around lines 94 - 95, The
build-and-test job is currently gated on the Windows-only preparatory job
prepare-contrib-for-windows via the needs: field; remove that global dependency
and instead either (A) drop needs: prepare-contrib-for-windows from
build-and-test so Linux/macOS runners aren’t blocked, or (B) make the
Windows-specific matrix entry depend on prepare-contrib-for-windows by splitting
build-and-test into separate jobs or adding a conditional that only requires
prepare-contrib-for-windows for the Windows matrix axis; update references to
the job name build-and-test and the dependency prepare-contrib-for-windows
accordingly.

413-418: ⚠️ Potential issue | 🔴 Critical

Run the submodule lookup from OpenMS/.

In this job the repository is checked out under OpenMS/ (Lines 141-143), so Line 417 executes git submodule status outside a Git repository and the Windows artifact download never gets a valid revision.

Suggested fix
       - name: Identify contrib submodule revision for cache key
         id: contrib-rev
         shell: bash
         run: |
-        rev=$(git submodule status --cached -- contrib | sed -E 's/^-?//' | cut -d' ' -f1)
+        rev=$(git -C OpenMS submodule status --cached -- contrib | sed -E 's/^-?//' | cut -d' ' -f1)
         echo "rev=$rev" >> "$GITHUB_OUTPUT"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/openms_ci_matrix_full.yml around lines 413 - 418, The
"Identify contrib submodule revision for cache key" step (id: contrib-rev) runs
git submodule status outside the checked-out OpenMS working tree, so it returns
no revision; update the step to execute the submodule lookup from the OpenMS
checkout (either change the working directory to OpenMS before running the
existing git submodule status command, or invoke git with the -C OpenMS option)
so that the rev=$(git submodule status --cached -- contrib) extraction runs
inside the OpenMS repository and produces a valid revision for the artifact
cache key.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/openms_ci_matrix_full.yml:
- Around line 45-57: In the CI prep job step with id contrib-rev (name "Identify
contrib submodule revision for cache key"), remove the stray "cd OpenMS" so the
git submodule status command runs from the workspace root (where the job checks
out and builds contrib/...), i.e. delete the cd line and keep the rev assignment
and echo as-is so rev=$(git submodule status --cached -- contrib | sed -E
's/^-?//' | cut -d' ' -f1) executes in the correct directory to produce the
cache key and artifact name.

---

Duplicate comments:
In @.github/workflows/openms_ci_matrix_full.yml:
- Around line 94-95: The build-and-test job is currently gated on the
Windows-only preparatory job prepare-contrib-for-windows via the needs: field;
remove that global dependency and instead either (A) drop needs:
prepare-contrib-for-windows from build-and-test so Linux/macOS runners aren’t
blocked, or (B) make the Windows-specific matrix entry depend on
prepare-contrib-for-windows by splitting build-and-test into separate jobs or
adding a conditional that only requires prepare-contrib-for-windows for the
Windows matrix axis; update references to the job name build-and-test and the
dependency prepare-contrib-for-windows accordingly.
- Around line 413-418: The "Identify contrib submodule revision for cache key"
step (id: contrib-rev) runs git submodule status outside the checked-out OpenMS
working tree, so it returns no revision; update the step to execute the
submodule lookup from the OpenMS checkout (either change the working directory
to OpenMS before running the existing git submodule status command, or invoke
git with the -C OpenMS option) so that the rev=$(git submodule status --cached
-- contrib) extraction runs inside the OpenMS repository and produces a valid
revision for the artifact cache key.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f9a0ccf0-1359-4414-a07f-a7c36d46cbac

📥 Commits

Reviewing files that changed from the base of the PR and between bf7efb9 and e90e588.

📒 Files selected for processing (1)
  • .github/workflows/openms_ci_matrix_full.yml

We want to use the submodule revision hash as the way to connect an
OpenMS release to a version of contrib.  By doing this we make
releasing OpenMS easier because we don't have to tag/release contrib.

Yes, I know this is slower for building on Windows.  But contrib is
going away in the next couple of months.  I put the contrib build in
its own job so that we don't hit run-time limits.
@pjones
pjones force-pushed the pjones/contrib-submod branch from e90e588 to 9dbd850 Compare April 15, 2026 15:42

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/openms_ci_matrix_full.yml:
- Line 502: The CMake prefix path variable OPENMS_CONTRIB_LIBS was changed to
only include OpenMS/contrib/build which omits the Windows libcurl install in
OpenMS/contrib; restore or extend OPENMS_CONTRIB_LIBS so it includes both the
contrib root and the build subdir (so CMake can find libcurl installed into
OpenMS/contrib by the Windows libcurl step) — update the workflow entry that
defines OPENMS_CONTRIB_LIBS to include both "${{ github.workspace
}}/OpenMS/contrib" and "${{ github.workspace }}/OpenMS/contrib/build" so the
Windows configure step finds the correct curl.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3257e20e-9ca0-4c96-9243-cd6b40931245

📥 Commits

Reviewing files that changed from the base of the PR and between e90e588 and 9dbd850.

📒 Files selected for processing (1)
  • .github/workflows/openms_ci_matrix_full.yml

@pjones

pjones commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

@timosachsenberg The CI builds finally finished. I'm not sure what's going on but installing doxygen on Windows sometimes and randomly results in a 404. I've seen it in other builds as well. Restarting the build usually fixes the issue but in this case I had to restart it twice.

@timosachsenberg

Copy link
Copy Markdown
Contributor

Ok cool. I observed this as well. Not sure why choco seems to be so flaky

@timosachsenberg
timosachsenberg merged commit beae5c3 into develop Apr 16, 2026
72 of 75 checks passed
@timosachsenberg
timosachsenberg deleted the pjones/contrib-submod branch April 16, 2026 19:12
github-actions Bot pushed a commit that referenced this pull request Apr 17, 2026
Add entry for contrib directory converted to git submodule (#9155):
developers and packagers building from source now need
'git submodule update --init' to obtain vendored third-party libraries.

Co-authored-by: Copilot <[email protected]>
timosachsenberg pushed a commit that referenced this pull request Apr 17, 2026
Add entry for contrib directory converted to git submodule (#9155):
developers and packagers building from source now need
'git submodule update --init' to obtain vendored third-party libraries.

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
timosachsenberg pushed a commit that referenced this pull request Apr 21, 2026
The contrib directory was converted to a git submodule (#9155).
Add a note to AGENTS.md so developers know to run
'git submodule update --init contrib' before building.

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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