From 0ceff174d658d54b257ccebe47fd3205d472ad69 Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:13:27 -0800 Subject: [PATCH 1/4] ignoring `home` bucket --- plugins/nf-quilt/src/main/nextflow/quilt/QuiltPathify.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltPathify.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltPathify.groovy index 1a771351..b07f5182 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltPathify.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltPathify.groovy @@ -156,6 +156,11 @@ class QuiltPathify { } boolean isBucketAccessible() { + // ignore internal publishing from work dir + if (path.getBucket() == 'home') { + log.warn('isBucketAccessible: ignoring `home` bucket') + return false + } return pkg.isBucketAccessible() } From 1bf0225be31e5d42a97b7b3fa48a3c8e5f78c9ee Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:22:33 -0800 Subject: [PATCH 2/4] skip null config --- .../main/nextflow/quilt/QuiltProduct.groovy | 21 ++++++++++++------- .../nextflow/quilt/QuiltProductTest.groovy | 17 +++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy index d5e3cf6f..69087a28 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy @@ -170,20 +170,25 @@ ${nextflow} } boolean addSessionMeta() { + println("addSessionMeta: ${session}") if (shouldSkip(KEY_META)) { return false } + Map> cf = session.config println("addSessionMeta.cf: ${cf}") - Map qf = cf.navigate('quilt') as Map - qf['package_id'] = pkg.toString() - qf['uri'] = path.toUriString() - println("addSessionMeta.qf: ${qf}") - Map cmeta = qf.navigate('meta') as Map - qf.remove('meta') - println("addSessionMeta.cmeta: ${cmeta}") - + if (cf == null) { + log.error("addSessionMeta: no config found", pkg.meta) + return false + } try { + Map qf = cf.navigate('quilt') as Map + qf['package_id'] = pkg.toString() + qf['uri'] = path.toUriString() + println("addSessionMeta.qf: ${qf}") + Map cmeta = qf.navigate('meta') as Map + qf.remove('meta') + println("addSessionMeta.cmeta: ${cmeta}") Map smeta = getMetadata(cf) // println("addSessionMeta.smeta: ${smeta}") smeta['quilt'] = qf diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy index c92c9af0..a9d9b856 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy @@ -62,6 +62,15 @@ class QuiltProductTest extends QuiltSpecification { return makeProductFromUrl(subURL, success) } + QuiltProduct makeConfigProduct(Map config = null) { + QuiltPath path = QuiltPathFactory.parse(testURI) + QuiltPathify pathify = new QuiltPathify(path) + Session session = GroovyMock(Session) + session.config >> config + QuiltProduct product = new QuiltProduct(pathify, session) + + } + QuiltProduct makeWriteProduct(Map meta = [:]) { String subURL = writeableURI('quilt_product_test') // + '&workflow=universal' if (meta) { @@ -109,6 +118,7 @@ class QuiltProductTest extends QuiltSpecification { void 'shouldSkip is true if key=SKIP'() { given: QuiltProduct product = makeProduct('readme=SKIP') + Session expect: !product.shouldSkip(QuiltProduct.KEY_SKIP) !product.shouldSkip(QuiltProduct.KEY_META) @@ -117,6 +127,13 @@ class QuiltProductTest extends QuiltSpecification { !makeProduct('?readme=now').shouldSkip() } + void 'addSessionMeta is false if no config'() { + given: + QuiltProduct product = makeConfigProduct() + expect: + product.addSessionMeta() == false + } + @IgnoreIf({ System.getProperty('os.name').toLowerCase().contains('windows') }) void 'does not create README if readme=SKIP'() { given: From f172979f1c18de3ec726a1fa18199b8ba85e400b Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:35:42 -0800 Subject: [PATCH 3/4] handle missing quilt config --- .../main/nextflow/quilt/QuiltProduct.groovy | 17 ++++++++------- .../nextflow/quilt/QuiltProductTest.groovy | 21 ++++++++++++------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy index 69087a28..a87c4e58 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy @@ -178,17 +178,18 @@ ${nextflow} Map> cf = session.config println("addSessionMeta.cf: ${cf}") if (cf == null) { - log.error("addSessionMeta: no config found", pkg.meta) + log.error('addSessionMeta: no config found', pkg.meta) return false } + Map qf = cf.navigate('quilt') as Map ?: [:] + qf['package_id'] = pkg.toString() + qf['uri'] = path.toUriString() + println("addSessionMeta.qf: ${qf}") + Map cmeta = qf.navigate('meta') as Map + qf.remove('meta') + println("addSessionMeta.cmeta: ${cmeta}") + try { - Map qf = cf.navigate('quilt') as Map - qf['package_id'] = pkg.toString() - qf['uri'] = path.toUriString() - println("addSessionMeta.qf: ${qf}") - Map cmeta = qf.navigate('meta') as Map - qf.remove('meta') - println("addSessionMeta.cmeta: ${cmeta}") Map smeta = getMetadata(cf) // println("addSessionMeta.smeta: ${smeta}") smeta['quilt'] = qf diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy index a9d9b856..fd83c415 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy @@ -68,7 +68,7 @@ class QuiltProductTest extends QuiltSpecification { Session session = GroovyMock(Session) session.config >> config QuiltProduct product = new QuiltProduct(pathify, session) - + return product } QuiltProduct makeWriteProduct(Map meta = [:]) { @@ -118,7 +118,6 @@ class QuiltProductTest extends QuiltSpecification { void 'shouldSkip is true if key=SKIP'() { given: QuiltProduct product = makeProduct('readme=SKIP') - Session expect: !product.shouldSkip(QuiltProduct.KEY_SKIP) !product.shouldSkip(QuiltProduct.KEY_META) @@ -128,10 +127,16 @@ class QuiltProductTest extends QuiltSpecification { } void 'addSessionMeta is false if no config'() { - given: - QuiltProduct product = makeConfigProduct() - expect: - product.addSessionMeta() == false + when: + QuiltProduct no_config = makeConfigProduct() + then: + no_config.addSessionMeta() == false + + when: + QuiltProduct no_quilt = makeConfigProduct([quilt: null]) + + then: + no_quilt.addSessionMeta() == false } @IgnoreIf({ System.getProperty('os.name').toLowerCase().contains('windows') }) @@ -154,7 +159,7 @@ class QuiltProductTest extends QuiltSpecification { then: !defaultREADME.shouldSkip(QuiltProduct.KEY_README) - files.size() == 1 + files.size() > 0 when: String readme_text = 'hasREADME' @@ -164,7 +169,7 @@ class QuiltProductTest extends QuiltSpecification { then: text == readme_text !hasREADME.shouldSkip(QuiltProduct.KEY_README) - files.size() == 1 + files.size() > 0 } void 'setupSummarize empty if no files are present'() { From 405280602c95ed504757995b411e3636e7862609 Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:36:02 -0800 Subject: [PATCH 4/4] v0.8.10 --- CHANGELOG.md | 5 +++++ plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b11cd220..ba2d32b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ - Improve handling of dynamically-specified URIs - Rewrite README.md, splitting out developer documentation to README_DEV.md +## [0.8.10] 2024-11-4 UNPUBLISHED + +- Ignore publish to 'home' +- Fix: Cannot set property 'package_id' on null object + ## [0.8.9] 2024-10-31 UNPUBLISHED - Handle multiple/internal publishDir calls diff --git a/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF b/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF index 57de8d5f..d1ec193e 100644 --- a/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF +++ b/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Plugin-Class: nextflow.quilt.QuiltPlugin Plugin-Id: nf-quilt -Plugin-Version: 0.8.9 +Plugin-Version: 0.8.10 Plugin-Provider: Quilt Data Plugin-Requires: >=22.10.6