Skip to content

Commit

Permalink
chore: add back logging v0.7.6 (#171)
Browse files Browse the repository at this point in the history
The original error seems moot.
`error unknown method invocation multiply on integer type`

Still trying to get decent error messages on failure...
  • Loading branch information
drernie authored Jan 11, 2024
1 parent 7d118d1 commit 5240fbb
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 44 deletions.
36 changes: 21 additions & 15 deletions .groovylintrc.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
{
"extends": "recommended",
"rules": {
"MethodCount": {
"CatchException": {
"enabled": false
},
"JavadocMissingParamDescription": {
"CatchThrowable": {
"enabled": false
},
"JavadocMissingThrowsDescription": {
"ClassJavadoc": {
"enabled": false
},
"JavadocEmptyReturnTag": {
"ClosureAsLastMethodParameter": {
"enabled": false
},
"JavadocEmptyFirstLine": {
"DuplicateNumberLiteral": {
"enabled": false
},
"JUnitPublicNonTestMethod": {
"DuplicateStringLiteral": {
"enabled": false
},
"CatchException": {
"FieldTypeRequired": {
"enabled": false
},
"CatchThrowable": {
"ImplicitClosureParameter": {
"enabled": false
},
"ClassJavadoc": {
"JUnitPublicNonTestMethod": {
"enabled": false
},
"ClosureAsLastMethodParameter": {
"JavaIoPackageAccess": {
"enabled": false
},
"DuplicateNumberLiteral": {
"JavadocEmptyFirstLine": {
"enabled": false
},
"DuplicateStringLiteral": {
"JavadocEmptyReturnTag": {
"enabled": false
},
"FieldTypeRequired": {
"JavadocMissingParamDescription": {
"enabled": false
},
"JavaIoPackageAccess": {
"JavadocMissingThrowsDescription": {
"enabled": false
},
"MethodCount": {
"enabled": false
},
"MethodParameterTypeRequired": {
Expand All @@ -61,6 +64,9 @@
"SpaceAroundMapEntryColon": {
"enabled": false
},
"SpaceAroundOperator": {
"enabled": false
},
"SystemExit": {
"enabled": false
},
Expand All @@ -80,4 +86,4 @@
"enabled": false
}
}
}
}
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# Changelog

## [0.7.6] 2024-01-10 UNOFFICIAL

- Re-enable crash on failure

## [0.7.5] 2023-10-17

- Grab all multiqc subfolders

## [0.7.4] 2023-10-16b
## [0.7.4] 2023-10-16b UNOFFICIAL

- Actually print the exception stack trace
- `make install` to enable nextflow testing

## [0.7.3] 2023-10-16a
## [0.7.3] 2023-10-16a UNOFFICIAL

- Catch and log exception on push failure

## [0.7.2] 2023-10-16
## [0.7.2] 2023-10-16 UNOFFICIAL

- Throw exceptions on push failure

Expand All @@ -26,7 +30,7 @@

- Officially QuiltCore 0.1.0 instead of Python

## [0.6.0] 2023-10-03
## [0.6.0] 2023-10-03 UNOFFICIAL

(interim release still using Python)

Expand All @@ -36,7 +40,7 @@
- Top level (only): md, html, pdf, csv, tsv
- multiqc sub-folder HTML

## [0.5.0] 2023-09-04
## [0.5.0] 2023-09-04 UNOFFICIAL

- Switch to quiltcore-java [NOTE: this pre-release does NOT check workflows]
- Do not pre-install packages (only install before write)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ test-all: clean compile-all check #coverage

pkg-test: compile-all
echo "$(TEST_URI)"
./launch.sh run ./main.nf -profile standard -plugins $(PROJECT) --outdir "$(TEST_URI)"
$(NF_BIN) run ./main.nf -profile standard -plugins $(PROJECT) --outdir "$(TEST_URI)"

pkg-fail: compile
echo "$(TEST_URI)"
./launch.sh run ./fail.nf -profile standard -plugins $(PROJECT) --outdir "$(TEST_URI)"
$(NF_BIN) run ./fail.nf -profile standard -plugins $(PROJECT) --outdir "$(TEST_URI)"

tower-test: $(NF_BIN)
$(NF_BIN) run "https://github.com/quiltdata/nf-quilt" -name local_einstein -with-tower -r main -latest --pub "$(TEST_URI)"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ From the command-line, do, e.g.:

```bash
# export NXF_VER=23.04.3
export NXF_PLUGINS_TEST_REPOSITORY=https://github.com/quiltdata/nf-quilt/releases/download/0.7.5/nf-quilt-0.7.5-meta.json
nextflow run main.nf -plugins [email protected].5
export NXF_PLUGINS_TEST_REPOSITORY=https://github.com/quiltdata/nf-quilt/releases/download/0.7.6/nf-quilt-0.7.6-meta.json
nextflow run main.nf -plugins [email protected].6
```

For Tower, you can use the "Pre-run script" to set the environment variables.
Expand Down
12 changes: 6 additions & 6 deletions plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ import groovy.json.JsonOutput
@Slf4j
@CompileStatic
class QuiltProduct {

public final static String README_FILE = 'README_NF_QUILT.md'
public final static String SUMMARY_FILE = 'quilt_summarize.json'


private final static String KEY_META = 'metadata'
private final static String KEY_README = 'readme'
private final static String KEY_SKIP = 'SKIP'
Expand Down Expand Up @@ -142,10 +142,10 @@ ${nextflow}
pkg.push(msg, meta)
}
catch (Exception e) {
log.error("publish failed:", e)
log.error("Exception: ${e}")
print("FAILED: $pkg\n")
return
// throw e
e.printStackTrace()
throw new RuntimeException(e)
}
print("SUCCESS: $pkg\n")
}
Expand Down Expand Up @@ -251,7 +251,7 @@ ${nextflow}
nextflow: nextflow,
now: now(),
pkg: pkg.packageName,
]).toString()
])
log.debug("readme.template: ${template}")
return template
}
Expand Down Expand Up @@ -296,7 +296,7 @@ ${nextflow}
List<Path> paths = match(wildcard)
paths.each { path ->
String filename = path.getFileName()
Map entry = ["path": path.toString(), "title": filename]
Map entry = ['path': path.toString(), 'title': filename]
quilt_summarize.add(entry)
}
}
Expand Down
24 changes: 14 additions & 10 deletions plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* groovylint-disable ReturnNullFromCatchBlock */
/*
* Copyright 2022, Quilt Data Inc
*
Expand Down Expand Up @@ -34,10 +35,9 @@ import com.quiltdata.quiltcore.Namespace
import com.quiltdata.quiltcore.Manifest
import com.quiltdata.quiltcore.key.LocalPhysicalKey
import com.quiltdata.quiltcore.key.S3PhysicalKey
import com.quiltdata.quiltcore.workflows.WorkflowException

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.node.ObjectNode

@Slf4j
@CompileStatic
Expand Down Expand Up @@ -184,15 +184,19 @@ class QuiltPackage {
S3PhysicalKey registryPath = new S3PhysicalKey(bucket, '', null)
Registry registry = new Registry(registryPath)
Namespace namespace = registry.getNamespace(packageName)
String resolvedHash = (hash == 'latest' || hash == null || hash == 'null') ? namespace.getHash('latest') : hash
String resolvedHash = (hash == 'latest' || hash == null || hash == 'null')
? namespace.getHash('latest')
: hash
log.info("hash: $hash -> $resolvedHash")
Manifest manifest = namespace.getManifest(resolvedHash)

manifest.install(dest)
log.info("done")
log.info('done')
} catch (IOException e) {
log.error("failed to install $packageName")
return null
// this is non-fatal error, so we don't want to stop the pipeline
/* groovylint-disable-next-line ReturnNullFromCatchBlock */
return
}

installed = true
Expand Down Expand Up @@ -229,22 +233,22 @@ class QuiltPackage {
Manifest.Builder builder = Manifest.builder()

Files.walk(packageDest()).filter(f -> Files.isRegularFile(f)).forEach(f -> {
System.out.println(f)
log.debug("push: ${f} -> ${packageDest()}")
String logicalKey = packageDest().relativize(f)
LocalPhysicalKey physicalKey = new LocalPhysicalKey(f)
long size = Files.size(f)
builder.addEntry(logicalKey, new Entry(physicalKey, size, null, null))
});

Map<String, Object> fullMeta = [
"version": Manifest.VERSION,
"user_meta": meta + this.meta,
'version': Manifest.VERSION,
'user_meta': meta + this.meta,
]
ObjectMapper mapper = new ObjectMapper()
builder.setMetadata((ObjectNode)mapper.valueToTree(fullMeta))

Manifest m = builder.build()
log.debug("QuiltPackage.push", m)
log.debug('QuiltPackage.push', m)
m.push(namespace, "nf-quilt:${today()}-${msg}", parsed.workflowName)
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Plugin-Class: nextflow.quilt.QuiltPlugin
Plugin-Id: nf-quilt
Plugin-Version: 0.7.5
Plugin-Version: 0.7.6
Plugin-Provider: Quilt Data
Plugin-Requires: >=22.10.6
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class QuiltProductTest extends QuiltSpecification {
}

int writeFiles(dest) {
String root = dest.toString()
String root = dest
String[] filenames = [
'SUMMARIZE_ME.md',
'SUMMARIZE_ME.csv',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import groovy.transform.CompileDynamic
class QuiltPackageTest extends QuiltSpecification {

private final static String PACKAGE_URL = 'quilt+s3://quilt-example#package=examples%2fsmart-report@d68a7e9'
private final static String TEST_URL = PACKAGE_URL + "&path=README.md"
private final static String TEST_URL = PACKAGE_URL + '&path=README.md'

private QuiltPathFactory factory
private QuiltPath qpath
Expand Down Expand Up @@ -158,7 +158,7 @@ class QuiltPackageTest extends QuiltSpecification {
when:
opkg.push()
then:
thrown(java.io.IOException)
thrown(IOException)
}

@IgnoreIf({ env.WRITE_BUCKET == 'quilt-example' || env.WRITE_BUCKET == null })
Expand Down

0 comments on commit 5240fbb

Please sign in to comment.