Skip to content

Commit db7b593

Browse files
drernieclaude
andcommitted
Force quiltcore 0.1.7 for sha2-256-chunked hash type support (#318)
Add resolution strategy to pin quiltcore 0.1.7 which includes sha2-256-chunked hash type support, and add tests for hash type parsing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 95e80d7 commit db7b593

3 files changed

Lines changed: 85 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Use "package" as default prefix
66
- Modernize main*.nf files
7+
- Force quiltcore 0.1.7 to ensure sha2-256-chunked hash type support (#318)
78

89
## [0.9.1] 2024-12-24
910

plugins/nf-quilt/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ repositories {
5353
configurations {
5454
// Exclude transitive dependencies
5555
runtimeClasspath.exclude(group: 'org.slf4j', module: 'slf4j-api')
56+
57+
// Force quiltcore version to ensure chunked hash support
58+
all {
59+
resolutionStrategy {
60+
force 'com.quiltdata:quiltcore:0.1.7'
61+
}
62+
}
5663
}
5764

5865
sourceSets {
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/* groovylint-disable MethodName */
2+
/*
3+
* Copyright 2025, Quilt Data Inc
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package nextflow.quilt.jep
18+
19+
import com.quiltdata.quiltcore.Entry
20+
import nextflow.quilt.QuiltSpecification
21+
import spock.lang.Specification
22+
23+
/**
24+
* Test hash type support in quiltcore Entry class
25+
*
26+
* @author Ernest Prabhakar <ernest@quiltdata.io>
27+
*/
28+
class QuiltHashTypeTest extends Specification {
29+
30+
def 'should parse SHA256 hash type'() {
31+
when:
32+
def result = Entry.HashType.enumFor('SHA256')
33+
34+
then:
35+
result == Entry.HashType.SHA256
36+
}
37+
38+
def 'should parse sha2-256-chunked hash type'() {
39+
when:
40+
def result = Entry.HashType.enumFor('sha2-256-chunked')
41+
42+
then:
43+
result == Entry.HashType.SHA2_256_Chunked
44+
}
45+
46+
def 'should handle case-insensitive hash type names'() {
47+
when:
48+
def result1 = Entry.HashType.enumFor('sha256')
49+
def result2 = Entry.HashType.enumFor('SHA256')
50+
def result3 = Entry.HashType.enumFor('Sha256')
51+
52+
then:
53+
result1 == Entry.HashType.SHA256
54+
result2 == Entry.HashType.SHA256
55+
result3 == Entry.HashType.SHA256
56+
}
57+
58+
def 'should handle different separator formats for chunked'() {
59+
when:
60+
def result1 = Entry.HashType.enumFor('sha2-256-chunked')
61+
def result2 = Entry.HashType.enumFor('SHA2_256_Chunked')
62+
def result3 = Entry.HashType.enumFor('sha2_256_chunked')
63+
64+
then:
65+
result1 == Entry.HashType.SHA2_256_Chunked
66+
result2 == Entry.HashType.SHA2_256_Chunked
67+
result3 == Entry.HashType.SHA2_256_Chunked
68+
}
69+
70+
def 'should throw IllegalArgumentException for unknown hash type'() {
71+
when:
72+
Entry.HashType.enumFor('invalid-hash-type')
73+
74+
then:
75+
thrown(IllegalArgumentException)
76+
}
77+
}

0 commit comments

Comments
 (0)