Skip to content

Commit

Permalink
Merge branch 'main' into renovate/org.objenesis-objenesis-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie authored May 13, 2024
2 parents 3112e91 + 0035fe0 commit 1559457
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances
Expand All @@ -37,7 +37,7 @@ jobs:
id: ml
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.github.io/flavors/
uses: oxsecurity/megalinter/flavors/dotnet@v7.8.0
uses: oxsecurity/megalinter/flavors/dotnet@v7.11.1
env:
# All available variables are described in documentation
# https://megalinter.github.io/configuration/
Expand All @@ -48,7 +48,7 @@ jobs:

# Upload MegaLinter artifacts
- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: MegaLinter reports
path: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
Expand All @@ -47,14 +47,18 @@ jobs:
cache: gradle

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3

- name: Run Gradle Tests
run: make test
env:
LOG4J_DEBUG: true

- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: nf-quilt-test-reports
path: |
/home/runner/work/nf-quilt/nf-quilt/plugins/nf-quilt/build/reports/tests/test/
overwrite: true
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.7.10] 2024-05-10 UNOFFICIAL

- Debug build of QuiltCore-Java
- Fail when pushing to read-only buckets

## [0.7.9] 2024-01-30

- Auto-install (needed for < 23.12?)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ 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.9/nf-quilt-0.7.9-meta.json
nextflow run main.nf -plugins nf-quilt@0.7.9
export LOG4J_DEBUG=true # for verbose logging
export NXF_PLUGINS_TEST_REPOSITORY=https://github.com/quiltdata/nf-quilt/releases/download/0.7.10/nf-quilt-0.7.10-meta.json
nextflow run main.nf -plugins nf-quilt@0.7.10
```

For Tower, you can use the "Pre-run script" to set the environment variables.
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ allprojects {
dependencies {
// see https://docs.gradle.org/4.1/userguide/dependency_management.html#sec:module_replacement
implementation 'com.github.groovy-wslite:groovy-wslite:1.1.3'
implementation 'org.codehaus.groovy:groovy-all:3.0.20'
implementation 'org.codehaus.groovy:groovy-all:3.0.21'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.1'
implementation 'com.upplication:s3fs:2.2.2'

Expand All @@ -106,8 +106,8 @@ allprojects {
}
// Documentation required libraries
groovyDoc 'org.fusesource.jansi:jansi:2.4.1'
groovyDoc 'org.codehaus.groovy:groovy-groovydoc:3.0.20'
groovyDoc 'org.codehaus.groovy:groovy-ant:3.0.20'
groovyDoc 'org.codehaus.groovy:groovy-groovydoc:3.0.21'
groovyDoc 'org.codehaus.groovy:groovy-ant:3.0.21'
}

test {
Expand Down
10 changes: 5 additions & 5 deletions plugins/nf-quilt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ ext {

dependencies {
// quiltcore
implementation 'com.quiltdata:quiltcore:0.1'
implementation 'com.quiltdata:quiltcore:0.1.2'

// This dependency is exported to consumers, that is to say found on their compile classpath.
compileOnly "io.nextflow:nextflow:$nextflowVersion"
compileOnly 'org.slf4j:slf4j-api:2.0.11'
compileOnly 'org.pf4j:pf4j:3.10.0'
compileOnly 'org.pf4j:pf4j:3.11.0'
// add here plugins depepencies
compileOnly 'org.slf4j:slf4j-simple:2.0.11'
compileOnly 'black.ninia:jep:4.2.0'
Expand All @@ -76,10 +76,10 @@ dependencies {
//testImplementation(testFixtures('black.ninia:jep:4.0.3'))

// test configuration
testImplementation "org.codehaus.groovy:groovy:3.0.20"
testImplementation "org.codehaus.groovy:groovy-nio:3.0.20"
testImplementation "org.codehaus.groovy:groovy:3.0.21"
testImplementation "org.codehaus.groovy:groovy-nio:3.0.21"
testImplementation "io.nextflow:nextflow:$nextflowVersion"
testImplementation ("org.codehaus.groovy:groovy-test:3.0.20") { exclude group: 'org.codehaus.groovy' }
testImplementation ("org.codehaus.groovy:groovy-test:3.0.21") { exclude group: 'org.codehaus.groovy' }
testImplementation ("cglib:cglib-nodep:3.3.0")
testImplementation ("org.objenesis:objenesis:3.4")
testImplementation ("org.spockframework:spock-core:2.3-groovy-3.0") { exclude group: 'org.codehaus.groovy'; exclude group: 'net.bytebuddy' }
Expand Down
4 changes: 3 additions & 1 deletion plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ ${nextflow}
List<Map> quilt_summarize = setupSummarize()
log.debug("setupSummarize: $quilt_summarize")
try {
pkg.push(msg, meta)
log.info("publish.pushing: ${pkg}")
def m = pkg.push(msg, meta)
log.info("publish.pushed: ${m}")
}
catch (Exception e) {
log.error("Exception: ${e}")
Expand Down
17 changes: 14 additions & 3 deletions plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class QuiltPackage {
})
}
// https://docs.quiltdata.com/v/version-5.0.x/examples/gitlike#install-a-package
void push(String msg = 'update', Map meta = [:]) {
Manifest push(String msg = 'update', Map meta = [:]) {
S3PhysicalKey registryPath = new S3PhysicalKey(bucket, '', null)
Registry registry = new Registry(registryPath)
Namespace namespace = registry.getNamespace(packageName)
Expand All @@ -250,8 +250,19 @@ class QuiltPackage {
builder.setMetadata((ObjectNode)mapper.valueToTree(fullMeta))

Manifest m = builder.build()
log.debug('QuiltPackage.push', m)
m.push(namespace, "nf-quilt:${today()}-${msg}", parsed.workflowName)
log.debug("push[${this.parsed}]: ${m}")
try {
Manifest manifest = m.push(namespace, "nf-quilt:${today()}-${msg}", parsed.workflowName)
log.debug("pushed[${this.parsed}]: ${manifest}")
return manifest
} catch (Exception e) {
log.error('ERROR: Failed to push manifest', e)
print("FAILED: ${this.parsed}\n")
e.printStackTrace()
/* groovylint-disable-next-line ThrowRuntimeException */
throw new RuntimeException(e)
}
return m
}

@Override
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.9
Plugin-Version: 0.7.10
Plugin-Provider: Quilt Data
Plugin-Requires: >=22.10.6
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ 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 READONLY_URL = 'quilt+s3://allencell#package=test%2ftmp&path=foo%2fbar.txt'

private QuiltPathFactory factory
private QuiltPath qpath
Expand Down Expand Up @@ -170,22 +171,26 @@ class QuiltPackageTest extends QuiltSpecification {
!Files.isDirectory(qpath)
}

@IgnoreIf({ System.getProperty('os.name').contains('indows') })
// @IgnoreIf({ System.getProperty('os.name').contains('indows') })
void 'should fail pushing new files to read-only bucket '() {
given:
def qout = factory.parseUri(TEST_URL)
println("read-only-bucket:TEST_URL: ${READONLY_URL}")
def qout = factory.parseUri(READONLY_URL)
def opkg = qout.pkg()
def outPath = Paths.get(opkg.packageDest().toString(), QuiltProduct.README_FILE)
println("opkg: ${opkg}")
def outPath = Paths.get(opkg.packageDest().toString(), 'foo/bar.txt')
println("outPath: ${outPath}")
Files.writeString(outPath, "Time: ${timestamp}")
expect:
Files.exists(outPath)
when:
println('Pushing to read-only bucket')
opkg.push()
then:
thrown(IOException)
thrown(RuntimeException)
}

@IgnoreIf({ env.WRITE_BUCKET == 'quilt-example' || env.WRITE_BUCKET == null })
@IgnoreIf({ env.WRITE_BUCKET == null })
void 'should get writeable package '() {
given:
QuiltPackage opkg = writeablePackage('observer')
Expand All @@ -196,7 +201,7 @@ class QuiltPackageTest extends QuiltSpecification {
opkg.packageName.contains('test/observer')
}

@IgnoreIf({ env.WRITE_BUCKET == 'quilt-example' || env.WRITE_BUCKET == null })
@IgnoreIf({ env.WRITE_BUCKET == null })
void 'should succeed pushing new files to writeable bucket '() {
given:
QuiltPackage opkg = writeablePackage('observer')
Expand Down

0 comments on commit 1559457

Please sign in to comment.