Skip to content

Migrate to new Nextflow plugin build system (#323) - #324

Merged
drernie merged 3 commits into
mainfrom
323-migrate-build-system
Apr 29, 2026
Merged

Migrate to new Nextflow plugin build system (#323)#324
drernie merged 3 commits into
mainfrom
323-migrate-build-system

Conversation

@drernie

@drernie drernie commented Apr 29, 2026

Copy link
Copy Markdown
Member

Summary

Migrates the build from the legacy buildSrc / launch.sh / plugins/build.gradle layout to the new io.nextflow.nextflow-plugin Gradle plugin, per the Seqera migration guide. This combines PR steps 1+2 from the issue breakdown — they're interdependent (deleting the old build files without a replacement breaks CI), so they're shipped together.

Refs #323.

What changed

  • Deleted buildSrc/, launch.sh, plugins/build.gradle, plugins/nf-quilt/build.gradle, groovysh-task.gradle, gradle-groovysh-init.gradle, and the now-redundant plugins/nf-quilt/src/resources/META-INF/{MANIFEST.MF,extensions.idx} (the Gradle plugin generates these).
  • Moved sources to the standard layout the new plugin expects:
    • plugins/nf-quilt/src/mainsrc/main/groovy
    • plugins/nf-quilt/src/testsrc/test/groovy
    • plugins/nf-quilt/src/resourcessrc/main/resources
  • settings.gradle reduced to rootProject.name = 'nf-quilt'.
  • New root build.gradle applies io.nextflow.nextflow-plugin 1.0.0-beta.6, declares quiltcore, jackson-databind, jackson-datatype-jsr310, commons-io as runtime deps, and configures nextflowPlugin {} with className = 'nextflow.quilt.QuiltPlugin', provider Quilt Data, and three extension points (QuiltObserverFactory, QuiltPathFactory, QuiltPathSerializer). Plugin version is inlined as 0.9.2 (unchanged).
  • Makefile rewritten around assemble / installPlugin / releasePlugin. The legacy pkg-test, dyn-test, s3-* integration targets are preserved but now use nextflow directly (the launch.sh shim is gone) and depend on installPlugin to seed ~/.nextflow/plugins/.
  • .github/workflows/test.yml artifact paths updated from plugins/nf-quilt/build/reports/ to build/reports/.
  • Tests: QuiltSpecification and QuiltPkgTest now read the generated MANIFEST.MF from build/tmp/jar/ (where the new plugin emits it), with the legacy paths kept as fallbacks. The test task gets the standard --add-opens JVM args and dependsOn 'jar' so the manifest exists before tests run.
  • gradle.properties cleared (legacy Groovy/JDK toolchain keys are no longer needed — the Gradle plugin handles all of that).

Deviations from the migration guide

  • MANIFEST.MF retained as a build artifact only. The guide assumes you'd just instantiate factories directly in tests. Our QuiltSpecification does a full Plugins.init round-trip, which needs MANIFEST.MF on disk. Rather than rewrite all 200+ tests, I pointed the TestPluginDescriptorFinder at the generated manifest and added tasks.named('test') { dependsOn 'jar' }.
  • Plugin version inlined in build.gradle rather than read from a now-deleted MANIFEST.MF source file. This matches the migration guide's example.
  • JaCoCo coverage is no longer wired up — the legacy verifyCoverage task is dropped from make test. The new Gradle plugin doesn't apply JaCoCo, and reapplying it cleanly is out of scope. Worth a follow-up if we want the 70% gate back.

Test plan

  • ./gradlew assemble — succeeds (produces build/libs/nf-quilt-0.9.2-meta.json + nf-quilt-0.9.2.zip)
  • ./gradlew test — 226 tests, 222 passing, 14 skipped, 0 failing (locally on JDK 21)
  • make test — green
  • CI matrix (ubuntu/macos/windows × JDK 17/19/21) — pending
  • Spot-check make pkg-test WRITE_BUCKET=udp-spec against real S3 (out of scope for this PR; the existing nf-quilt/dest-0.9.2 package on udp-spec should still satisfy QuiltPkgTest)

Deferred to subsequent PRs

  • Doc rewrites: README.md, README-DEV.md, CHANGELOG.md. This PR only touches the build layer; references to plugins/nf-quilt/... paths in docs were left alone where they aren't actively broken.
  • Bumping Plugin-Version to 1.0.0 and the actual registry release.
  • Reinstating JaCoCo coverage (if desired).
  • Validating releasePlugin against the registry (no --dry-run option exists; needs an API key).

Greptile Summary

This PR migrates the nf-quilt plugin build from the legacy buildSrc/launch.sh/nested-build.gradle layout to the io.nextflow.nextflow-plugin Gradle plugin, moving sources to the standard flat layout the new plugin expects and updating the Makefile and CI artifact paths accordingly.

  • P1 – logback-test.xml in src/main/resources/: this file will be packaged into the production JAR and force <root level="DEBUG"> logging for every user of the plugin; it must move to src/test/resources/.
  • P1 – Broken make coverage and make update targets: the jacocoTestReport and dependencyUpdates Gradle tasks referenced by these targets no longer exist in the new build.gradle, causing both targets to fail.
  • P2 – s3-test target missing -plugins flag: unlike all other integration targets, s3-test does not pass -plugins $(PROJECT)@$(VERSION), so Nextflow will resolve from the registry instead of the locally installed build.

Confidence Score: 3/5

Not safe to merge as-is: the logback-test.xml placement will pollute production logging for all plugin users, and two Makefile targets will fail at runtime.

Two P1s: (1) logback-test.xml in src/main/resources/ ships DEBUG root logging into the production JAR, and (2) make coverage and make update reference Gradle tasks removed from the new build, causing hard failures. The core Gradle migration and source-move appear correct, but these issues must be fixed before merging.

src/main/resources/logback-test.xml (wrong directory — must be src/test/resources/); Makefile (coverage and update targets broken, s3-test missing -plugins flag)

Important Files Changed

Filename Overview
build.gradle Root build.gradle rewritten to use io.nextflow.nextflow-plugin 1.0.0-beta.6; declares runtime deps and configures nextflowPlugin block cleanly
Makefile Rewritten around assemble/installPlugin/releasePlugin; three P1/P2 issues: make coverage calls a removed jacocoTestReport task, make update calls a removed dependencyUpdates task, and s3-test is missing the -plugins flag
src/main/resources/logback-test.xml P1: logback-test.xml placed in src/main/resources/ instead of src/test/resources/; will be packaged into the production JAR and force DEBUG root logging for all plugin users
src/test/groovy/nextflow/quilt/QuiltSpecification.groovy Base test spec updated to read MANIFEST.MF from build/tmp/jar/ with legacy fallback paths; correct use of TestPluginDescriptorFinder override
src/test/groovy/nextflow/quilt/QuiltPkgTest.groovy New test class with manifestVersion() helper; minor P2: FileInputStream not closed in try block
settings.gradle Simplified to single rootProject.name line; legacy multi-project include and foojay toolchain resolver removed
.github/workflows/test.yml Artifact upload paths updated from plugins/nf-quilt/build/reports/ to build/reports/ for both Windows and Linux/macOS runners
gradle.properties Legacy JVM toolchain keys (groovyVersion, jdkVersion, javaLangVersion) removed; now only a comment explaining the new plugin handles these

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[./gradlew assemble] --> B[build/libs/nf-quilt-0.9.2.zip]
    A --> C[build/tmp/jar/MANIFEST.MF]
    C --> D[QuiltSpecification.setupSpec\nreads MANIFEST.MF]
    D --> E[Plugins.init / startIfMissing]
    E --> F[Test suite runs\n226 tests]

    G[make install] --> H[./gradlew installPlugin]
    H --> I[~/.nextflow/plugins/nf-quilt-0.9.2/]
    I --> J[nextflow run ... -plugins nf-quilt@0.9.2]

    K[make release] --> L[./gradlew releasePlugin]
    L --> M[Seqera Plugin Registry]

    style C fill:#f9f,stroke:#c0c
    style D fill:#f9f,stroke:#c0c
Loading

Comments Outside Diff (1)

  1. src/main/resources/logback-test.xml, line 1-31 (link)

    P1 Test-only logback config packaged into production JAR

    logback-test.xml belongs in src/test/resources/, not src/main/resources/. By living in src/main/resources/ it will be included in the production plugin ZIP/JAR. Logback resolves logback-test.xml over logback.xml, so every Nextflow user who loads this plugin will inherit the <root level="DEBUG"> configuration, flooding their console with debug output from all loggers at runtime.

Reviews (1): Last reviewed commit: "Migrate to new Nextflow plugin build sys..." | Re-trigger Greptile

Greptile also left 4 inline comments on this PR.

Removes the legacy buildSrc/launch.sh/plugins/build.gradle structure and
adopts the io.nextflow.nextflow-plugin Gradle plugin (1.0.0-beta.6) per
the Seqera migration guide.

What changed:
- Delete buildSrc/, launch.sh, plugins/build.gradle, plugins/nf-quilt/build.gradle,
  groovysh helpers, plugins/nf-quilt/src/resources/META-INF/{MANIFEST.MF,extensions.idx}
- Move plugin sources from plugins/nf-quilt/src/{main,test,resources} to
  src/main/groovy, src/test/groovy, src/main/resources (standard layout
  expected by the new plugin)
- Replace settings.gradle with single rootProject.name line
- New root build.gradle declaring quiltcore, jackson-databind,
  jackson-datatype-jsr310, commons-io as runtime deps; nextflowPlugin {}
  block declares className, provider, extensionPoints (QuiltObserverFactory,
  QuiltPathFactory, QuiltPathSerializer); inline plugin version 0.9.2
- Rewrite Makefile around assemble / installPlugin / releasePlugin while
  preserving pkg-test / dyn-test / s3-* targets (now invoke `nextflow`
  directly instead of launch.sh, install plugin via gradle first)
- Update .github/workflows/test.yml artifact paths to build/reports
- QuiltSpecification + QuiltPkgTest read MANIFEST.MF from build/tmp/jar/
  (where the new gradle plugin generates it during the jar task), with
  legacy paths kept as fallbacks
- Test task gets --add-opens jvmArgs and dependsOn jar so the manifest
  exists before tests start
- Clear gradle.properties (legacy keys no longer needed)

Plugin-Version is unchanged (0.9.2). The 1.0.0 release happens in a
later PR.

Refs #323

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ REPOSITORY checkov yes no no 10.74s
✅ REPOSITORY git_diff yes no no 0.01s
✅ REPOSITORY grype yes no no 31.79s
✅ REPOSITORY secretlint yes no no 0.48s
✅ REPOSITORY syft yes no no 1.0s
✅ REPOSITORY trivy yes no no 6.3s
✅ REPOSITORY trivy-sbom yes no no 0.11s
✅ REPOSITORY trufflehog yes no no 2.29s
✅ XML xmllint 1 0 0 0 0.31s
✅ YAML prettier 1 0 0 0 0.39s
✅ YAML v8r 1 0 0 2.93s
✅ YAML yamllint 1 0 0 0.24s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Comment thread Makefile Outdated
Comment thread Makefile Outdated
Comment on lines +109 to +110
update:
./gradlew useLatestVersions
make check
./gradlew dependencyUpdates

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 dependencyUpdates task not available in the new build

./gradlew dependencyUpdates is provided by the com.github.ben-manes.versions plugin, which was removed from the new build.gradle. Running make update will fail with "Task 'dependencyUpdates' not found". The old Makefile used useLatestVersions (from se.patrikerdes.use-latest-versions), also now absent. If dependency-update checking is still desired, the corresponding plugin should be re-added to build.gradle.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in ef33379 — removed the update Makefile target. Will reintroduce alongside a versions-plugin replacement if/when needed.

Comment thread src/test/groovy/nextflow/quilt/QuiltPkgTest.groovy
Comment thread Makefile Outdated
drernie and others added 2 commits April 29, 2026 14:33
The io.nextflow.nextflow-plugin gradle plugin wires `test` to depend on
`assemble` (which transitively triggers `packagePlugin`). On Windows,
`packagePlugin` fails with "character to be escaped is missing" because
upstream uses `String.replaceAll('\\.', File.separator)` and `\` is the
escape character in regex replacements. Filed upstream as
nextflow-io/nextflow-plugin-gradle#20.

Until that's fixed:
- Sever the test->assemble dependency so `./gradlew test` (and therefore
  `make test` in CI) runs on Windows. `make assemble`, `make package`,
  and `make release` still pull in `packagePlugin` on platforms where it
  works.
- Bump to 1.0.0-beta.14 (latest) — same Windows bug, but worth being on
  the most recent release otherwise.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Remove broken Makefile targets (coverage, update) that referenced the
  removed jacoco and com.github.ben-manes.versions plugins
- Add missing -plugins flag to s3-test target
- Use withInputStream so the manifest FileInputStream is closed deterministically

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@drernie
drernie merged commit 9125116 into main Apr 29, 2026
10 checks passed
@drernie
drernie deleted the 323-migrate-build-system branch April 29, 2026 22:59
drernie added a commit that referenced this pull request Apr 30, 2026
## Summary

PR 2 of the 4-PR migration to the Nextflow Plugin Registry (#323). PR 1
was the structural rewrite (#324). This PR is documentation + restoring
the JaCoCo coverage gate; no version bump and no source/test changes.

- **Docs:** Replace legacy build/publish references (`launch.sh`, `make
publish`, `nextflow-io/plugins` PR flow, `NXF_PLUGINS_TEST_REPOSITORY`
GitHub-release pinning, `plugins/` subproject, `buildSrc`) in
`README-DEV.md` with the new `io.nextflow.nextflow-plugin` workflow:
`make assemble`/`install`/`package`/`release` and `./gradlew
releasePlugin` (requires `NPR_API_KEY`) for publishing to
registry.nextflow.io. `README.md` did not contain stale references and
was left as-is.
- **Changelog:** Added bullets to the in-flight `[0.9.2] 2026-04-29`
section noting the registry migration, the new build system, dropped
`nextflow-io/plugins` flow, doc updates, and JaCoCo restoration. No new
version section (1.0.0 entry comes in the release PR).
- **JaCoCo:** Re-added `id 'jacoco'` to the plugins block, configured
`jacocoTestReport` and `jacocoTestCoverageVerification` (70% line
minimum, mirroring the pre-migration threshold), and wired `check` to
depend on the verification task. Restored `coverage` / `verifyCoverage`
Makefile targets and updated `.PHONY`.
- **Verified locally** with JDK 21: `./gradlew check` passes including
`jacocoTestCoverageVerification` at the 70% bar — no threshold reduction
needed.

Refs #323

## Test plan

- [x] `./gradlew check` passes locally with the 70% JaCoCo gate enabled
- [ ] CI green on this branch
- [ ] Manual review of doc changes for accuracy vs. the new build flow

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@drernie drernie mentioned this pull request Apr 30, 2026
5 tasks
drernie added a commit that referenced this pull request Apr 30, 2026
## Summary

First release published to the [Nextflow Plugin
Registry](https://registry.nextflow.io). Bumps the plugin version to
`1.0.0`, consolidating the unpublished `0.9.2` intermediate into the
registry-migration release.

This is the final PR in the migration tracked by #323. It bundles three
previously-merged PRs:

- #322 — Jackson `OffsetDateTime` serialization fix for Nextflow 24.10+
- #324 — Migrate to the new `io.nextflow.nextflow-plugin` Gradle build
system
- #327 — Docs refresh + restore JaCoCo 70% line-coverage gate

## Changes

- `build.gradle`: `version = '0.9.2'` -> `'1.0.0'`
- `CHANGELOG.md`: rename `[0.9.2]` section to `[1.0.0]` and add note
about Nextflow Plugin Registry as the publishing channel
- `README-DEV.md`: bump example `nf-quilt@0.9.2` references to `@1.0.0`

The `dest-1.0.0` test package has been pre-published to `s3://udp-spec`
so `QuiltPkgTest > should confirm contents of dest URI` passes in CI.

## Post-merge manual steps (human)

The actual registry publish is intentionally NOT automated in this PR:

1. `git tag 1.0.0 && git push origin 1.0.0`
2. `export NPR_API_KEY=... && ./gradlew releasePlugin`
3. Verify the plugin appears on https://registry.nextflow.io
4. Close #321 with the registry URL

## Test plan

- [x] `./gradlew test` passes
- [x] `./gradlew check` passes (JaCoCo gate satisfied)
- [x] `./gradlew packagePlugin` produces
`build/distributions/nf-quilt-1.0.0.zip`
- [x] `make pkg-test WRITE_BUCKET=udp-spec` published
`nf-quilt/dest-1.0.0` to `udp-spec`
- [ ] CI green

Closes #323
Closes #321

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- greptile_comment -->

<h3>Greptile Summary</h3>

This PR bumps the plugin version from `0.9.2` to `1.0.0` across
`build.gradle`, `CHANGELOG.md`, and `README-DEV.md` in preparation for
the first publish to the Nextflow Plugin Registry. All `0.9.2`
references have been consistently updated and no stale occurrences
remain in the repository.

<h3>Confidence Score: 4/5</h3>

Safe to merge — changes are purely a version bump with no functional
code modifications.

Only P2 finding (stale comment in build.gradle); no logic, security, or
correctness issues present.

No files require special attention beyond the minor stale comment in
build.gradle line 17.

<h3>Important Files Changed</h3>

| Filename | Overview |
|----------|----------|
| build.gradle | Version bumped from 0.9.2 to 1.0.0; stale "until the
1.0.0 release" comment left in place (P2) |
| CHANGELOG.md | Section heading renamed from [0.9.2] to [1.0.0];
registry publication note prepended — no issues found |
| README-DEV.md | Four nf-quilt version references updated from 0.9.2 to
1.0.0 in example commands — no issues found |

</details>

<h3>Flowchart</h3>

```mermaid
%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["build.gradle\nversion = '1.0.0'"] --> B["./gradlew packagePlugin\nnf-quilt-1.0.0.zip"]
    B --> C["git tag 1.0.0\ngit push origin 1.0.0"]
    C --> D["./gradlew releasePlugin\nNPR_API_KEY set"]
    D --> E["Nextflow Plugin Registry\nregistry.nextflow.io"]
    F["CHANGELOG.md\n1.0.0 section"] -.-> B
    G["README-DEV.md\nnf-quilt at 1.0.0"] -.-> E
```

<sub>Reviews (1): Last reviewed commit: ["Release
1.0.0"](c7e63de)
| [Re-trigger
Greptile](https://app.greptile.com/api/retrigger?id=30280267)</sub>

> Greptile also left **1 inline comment** on this PR.

<!-- /greptile_comment -->

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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