Skip to content

Fix Jackson OffsetDateTime serialization for Nextflow 24.10+ (#321) - #322

Merged
drernie merged 5 commits into
mainfrom
321-nextflow-version-mismatches
Apr 29, 2026
Merged

Fix Jackson OffsetDateTime serialization for Nextflow 24.10+ (#321)#322
drernie merged 5 commits into
mainfrom
321-nextflow-version-mismatches

Conversation

@drernie

@drernie drernie commented Apr 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Register JavaTimeModule and disable WRITE_DATES_AS_TIMESTAMPS on the ObjectMapper used by writeMapToPackage, so java.time.OffsetDateTime (returned by Nextflow 24.10+ WorkflowMetadata.toMap() for start/complete) serializes as ISO-8601 strings.
  • Add jackson-datatype-jsr310:2.19.0 dependency to match the existing jackson-databind version.
  • Restore working test input package (nf-core-gallery was deleted; switched to udp-spec/nf-quilt/source).
  • Bump version to 0.9.2.

Why

Without the module registered, toJson threw Java 8 date/time type java.time.OffsetDateTime not supported by default. The exception was caught in writeMapToPackage, so the pipeline appeared to finish — but nf-quilt/config.json, params.json, and workflow.json were never written, producing packages with degraded metadata.

Closes #321

Test plan

  • Pipeline run produces all three JSONs in the published package — verified at s3://udp-spec/nf-quilt/dest-0.9.2/nf-quilt/{config,params,workflow}.json
  • start/complete in workflow.json are ISO-8601 strings (e.g. 2026-04-29T08:09:29.334938-07:00), not epoch decimals
  • Existing test suite passes — all 10 CI jobs green (Linux/macOS/Windows × JDK 17/19/21) against pinned NXF_VER=24.10.3

🤖 Generated with Claude Code

Greptile Summary

This PR fixes a Jackson serialization failure for java.time.OffsetDateTime values returned by Nextflow 24.10+ workflow metadata, which silently prevented config.json, params.json, and workflow.json from being written to published packages. The fix registers JavaTimeModule and disables WRITE_DATES_AS_TIMESTAMPS on the static ObjectMapper, adds the matching jackson-datatype-jsr310:2.19.0 dependency, adds a targeted regression test, updates the test input package reference, and bumps the version to 0.9.2.

Confidence Score: 5/5

Safe to merge — the fix is correct, well-tested, and self-contained with no side effects on existing serialization behaviour.

All changes are focused and correct: JavaTimeModule + disabling WRITE_DATES_AS_TIMESTAMPS is the standard Jackson pattern for ISO-8601 OffsetDateTime output; the dependency version matches jackson-databind; a regression test covers both the positive and negative cases; the previous thread's concern about WRITE_DATES_AS_TIMESTAMPS was already addressed in the current HEAD.

No files require special attention.

Important Files Changed

Filename Overview
plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy Registers JavaTimeModule and disables WRITE_DATES_AS_TIMESTAMPS on the static ObjectMapper to fix OffsetDateTime serialization; changes are correct and thread-safe.
build.gradle Adds jackson-datatype-jsr310:2.19.0 to match existing jackson-databind version; correct dependency for JavaTimeModule.
plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy Adds a regression test for OffsetDateTime ISO-8601 serialization; checks both the positive (ISO string present) and negative (no numeric epoch for start key) cases.
main.nf Replaces deleted nf-core-gallery reference with udp-spec/nf-quilt/source package; removes unused params.hash variable.
wf/main.gallery.nf Deleted since it referenced the no-longer-available nf-core-gallery bucket.
plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF Bumps Plugin-Version from 0.9.1 to 0.9.2; consistent with changelog and README-DEV updates.

Sequence Diagram

sequenceDiagram
    participant NF as Nextflow 24.10+
    participant QP as QuiltProduct
    participant OM as ObjectMapper
    participant JTM as JavaTimeModule
    participant PKG as QuiltPackage

    NF->>QP: WorkflowMetadata.toMap()<br/>(start/complete as OffsetDateTime)
    QP->>OM: toJson(map)
    OM->>JTM: serialize(OffsetDateTime)
    JTM-->>OM: "2026-04-29T08:09:29.334938-07:00"
    OM-->>QP: JSON string (ISO-8601)
    QP->>PKG: writeMapToPackage(workflow.json)
    PKG-->>NF: Package published with metadata
Loading

Reviews (3): Last reviewed commit: "address PR review feedback" | Re-trigger Greptile

Nextflow 24.10+ returns java.time.OffsetDateTime for workflow start/complete
timestamps in WorkflowMetadata.toMap(). The bare ObjectMapper failed to
serialize these, causing writeMapToPackage to silently drop config.json,
params.json, and workflow.json from published packages.

Closes #321

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@drernie drernie linked an issue Apr 29, 2026 that may be closed by this pull request
Comment thread plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy Outdated
@github-actions

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ MARKDOWN markdown-link-check 2 0 0 2.6s
✅ MARKDOWN markdown-table-formatter 2 0 0 0 0.14s
✅ REPOSITORY checkov yes no no 9.99s
✅ REPOSITORY git_diff yes no no 0.0s
✅ REPOSITORY grype yes no no 38.06s
✅ REPOSITORY secretlint yes no no 0.43s
✅ REPOSITORY syft yes no no 1.13s
✅ REPOSITORY trivy yes no no 4.92s
✅ REPOSITORY trivy-sbom yes no no 0.08s
✅ REPOSITORY trufflehog yes no no 2.27s

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

drernie and others added 3 commits April 29, 2026 07:41
…-8601

Per Greptile review on #322: JavaTimeModule alone emits epoch decimals.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nf-core-gallery was deleted to save cost; switch to udp-spec/nf-quilt/source
(the same package dyn-test uses). pkg-test passes end-to-end against Nextflow
24.10.3 with the OffsetDateTime fix.

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

drernie commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

@greptileai

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes JSON serialization of Nextflow 24.10+ workflow metadata containing java.time.OffsetDateTime, ensuring config.json, params.json, and workflow.json are written correctly by the nf-quilt plugin.

Changes:

  • Register Jackson JavaTimeModule and disable timestamp serialization on the shared ObjectMapper.
  • Add jackson-datatype-jsr310:2.19.0 to match the existing Jackson databind version.
  • Bump plugin version to 0.9.2, update changelog, and refresh the example main.nf input package.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF Bumps plugin version to 0.9.2.
plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy Configures Jackson for Java time types to prevent OffsetDateTime serialization failures.
build.gradle Adds jackson-datatype-jsr310 dependency for Java time support.
main.nf Updates example/test input package URI.
CHANGELOG.md Records the release notes for the serialization fix and input package change.

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

Comment thread plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF
Comment thread CHANGELOG.md
Comment thread plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy
- Delete wf/main.gallery.nf (referenced deleted nf-core-gallery bucket)
- Bump VERSION in README-DEV.md to 0.9.2 to match manifest
- Add regression test for OffsetDateTime ISO-8601 serialization (#321)

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

drernie commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

@greptile-apps

@drernie
drernie merged commit abfdd28 into main Apr 29, 2026
10 checks passed
@drernie
drernie deleted the 321-nextflow-version-mismatches branch April 29, 2026 17:38
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.

Nextflow version mismatches?

2 participants