Fix #332: Disable FAIL_ON_EMPTY_BEANS for NF 25.10.x - #333
Merged
Conversation
Dynamic process directive closures (e.g. cpus = { task.attempt * 2 })
transitively pull in the script binding's secrets field, an anonymous
SecretsLoader$1 with no bean properties. Jackson would throw when
serializing config/params/workflow JSON.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
| esac | ||
| NEW="${MAJOR}.${MINOR}.${PATCH}" | ||
|
|
||
| sed -i.bak "s/^version = '${OLD}'\$/version = '${NEW}'/" "$FILE" |
There was a problem hiding this comment.
Unescaped dots in sed regex pattern
${OLD} (e.g. 1.0.1) is inserted directly into a sed regex, where . is a wildcard matching any character. In practice the surrounding single-quote context makes a false match extremely unlikely, but it is safer to escape the dots so the pattern is anchored to literal version strings.
Suggested change
| sed -i.bak "s/^version = '${OLD}'\$/version = '${NEW}'/" "$FILE" | |
| sed -i.bak "s/^version = '${OLD//./\\.}'\$/version = '${NEW}'/" "$FILE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SerializationFeature.FAIL_ON_EMPTY_BEANSon the shared JacksonObjectMappersowriteMapToPackage.toJsonsurvives Nextflow 25.10.x configs containing dynamic process directive closures (e.g.cpus = { task.attempt * 2 }) that transitively pull in the script binding'sSecretsLoader$1field.QuiltProductTestthat nests an anonymous-class object inside the config map and confirmstoJsondoes not throw.make bump [LEVEL=patch|minor|major](default patch) backed bywf/bump-version.sh, which rewritesversioninbuild.gradleand commits.nf-quilt/dest-1.0.1toudp-spec, update CHANGELOG.Closes #332.
Test plan
./gradlew checkpasses (test + jacoco coverage gate)main'sObjectMapperand passes withFAIL_ON_EMPTY_BEANSdisabledmake pkg-test WRITE_BUCKET=udp-specpublishednf-quilt/dest-1.0.1successfully🤖 Generated with Claude Code
Greptile Summary
This PR fixes a serialization crash introduced in Nextflow 25.10.x where dynamic process directive closures (e.g.
cpus = { task.attempt * 2 }) transitively pull inSecretsLoader$1— an anonymous inner class with no bean properties — causing Jackson to throw whentoJsonis called. The fix disablesSerializationFeature.FAIL_ON_EMPTY_BEANSon the sharedObjectMapper, accompanied by a targeted regression test, amake bumpconvenience target, and a version bump to 1.0.1.Confidence Score: 4/5
Safe to merge; the core fix is minimal and correct, with only a trivial style issue in the new shell script.
All P2-only findings — the sole issue is an unescaped dot in the sed regex inside
bump-version.sh, which is extremely unlikely to cause a false match in practice. The main bug fix and regression test are correct and well-scoped.wf/bump-version.sh (minor sed escaping issue on line 29)
Important Files Changed
.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)to the shared ObjectMapper — correct targeted fix for NF 25.10.x closure serialization failure.toJsonhandles anonymous inner classes without throwing; assertion and Spock structure are correct.bumpphony target delegating towf/bump-version.shwith configurableLEVEL; straightforward and correct.make bumptarget.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["NF 25.10.x config map\n(contains dynamic closures)"] --> B["QuiltProduct.writeMapToPackage"] B --> C["toJson(map)"] C --> D["OBJECT_WRITER.writeValueAsString(value)"] D --> E{FAIL_ON_EMPTY_BEANS?} E -- "enabled (main)" --> F["JsonMappingException\nSecretsLoader$1 has no properties"] E -- "disabled (this PR)" --> G["Serializes empty bean as {}"] G --> H["JSON string written to package"]Reviews (1): Last reviewed commit: "Update CHANGELOG for 1.0.1" | Re-trigger Greptile