Skip to content

Commit e897e77

Browse files
committed
Remove the use of URL fragments
Signed-off-by: Ben Sherman <[email protected]>
1 parent 85b9d00 commit e897e77

30 files changed

+306
-654
lines changed

docs/reference/channel.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ The `channel.fromLineage` factory creates a channel that emits files from the {r
7272

7373
```nextflow
7474
channel
75-
.fromLineage(workflowRun: 'lid://0d1d1622ced3e4edc690bec768919b45', labels: ['alpha', 'beta'])
75+
.fromLineage(workflowLaunch: 'lid://0d1d1622ced3e4edc690bec768919b45', labels: ['alpha', 'beta'])
7676
.view()
7777
```
7878

@@ -86,7 +86,7 @@ Available options:
8686
`taskRun`
8787
: LID of the task run that produced the desired files.
8888

89-
`workflowRun`
89+
`workflowLaunch`
9090
: LID of the workflow run that produced the desired files.
9191

9292
(channel-fromlist)=

docs/reference/cli.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,8 @@ List the Nextflow runs with lineage metadata enabled, printing the corresponding
716716

717717
```console
718718
$ nextflow lineage list
719-
TIMESTAMP RUN NAME SESSION ID LINEAGE ID
720-
2025-04-22 14:45:43 backstabbing_heyrovsky 21bc4fad-e8b8-447d-9410-388f926a711f lid://c914d714877cc5c882c55a5428b510b1
719+
TIMESTAMP RUN NAME SESSION ID LAUNCH LID RUN LID
720+
2025-05-02 19:06:15 CDT stoic_shaw bc79451f-c573-4b7d-8e7c-697be8d9cefc lid://cd7197c02ab1250eafc2bf7499715e5f lid://304c57e48ab6b324715ad2c5ba55b25e
721721
```
722722

723723
View a lineage record.
@@ -726,12 +726,6 @@ View a lineage record.
726726
$ nextflow lineage view <lid>
727727
```
728728

729-
The output of a workflow run can be shown by appending `#output` to the workflow run LID:
730-
731-
```console
732-
$ nextflow lineage view lid://c914d714877cc5c882c55a5428b510b1#output
733-
```
734-
735729
:::{tip}
736730
You can use the [jq](https://jqlang.org/) command-line tool to apply further queries and transformations on the resulting lineage record.
737731
:::

modules/nextflow/src/main/groovy/nextflow/cli/CmdLineage.groovy

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class CmdLineage extends CmdBase implements UsageAware {
4040
private static final String NAME = 'lineage'
4141

4242
interface LinCommand extends ExtensionPoint {
43-
void log(ConfigMap config)
44-
void describe(ConfigMap config, List<String> args)
43+
void list(ConfigMap config)
44+
void view(ConfigMap config, List<String> args)
4545
void render(ConfigMap config, List<String> args)
4646
void diff(ConfigMap config, List<String> args)
4747
void find(ConfigMap config, List<String> args)
@@ -61,8 +61,8 @@ class CmdLineage extends CmdBase implements UsageAware {
6161
private ConfigMap config
6262

6363
CmdLineage() {
64-
commands << new CmdLog()
65-
commands << new CmdDescribe()
64+
commands << new CmdList()
65+
commands << new CmdView()
6666
commands << new CmdRender()
6767
commands << new CmdDiff()
6868
commands << new CmdFind()
@@ -94,7 +94,7 @@ class CmdLineage extends CmdBase implements UsageAware {
9494
// load the command operations
9595
this.operation = Plugins.getExtension(LinCommand)
9696
if( !operation )
97-
throw new IllegalStateException("Unable to load lineage extensions.")
97+
throw new IllegalStateException("Unable to load lineage records.")
9898
// consume the first argument
9999
getCmd(args).apply(args.drop(1))
100100
}
@@ -148,7 +148,7 @@ class CmdLineage extends CmdBase implements UsageAware {
148148
throw new AbortOperationException(msg)
149149
}
150150

151-
class CmdLog implements SubCmd {
151+
class CmdList implements SubCmd {
152152

153153
@Override
154154
String getName() {
@@ -157,7 +157,7 @@ class CmdLineage extends CmdBase implements UsageAware {
157157

158158
@Override
159159
String getDescription() {
160-
return 'List the executions with lineage enabled'
160+
return 'List all workflow runs with lineage enabled'
161161
}
162162

163163
@Override
@@ -167,7 +167,7 @@ class CmdLineage extends CmdBase implements UsageAware {
167167
usage()
168168
return
169169
}
170-
operation.log(config)
170+
operation.list(config)
171171
}
172172

173173
@Override
@@ -177,7 +177,7 @@ class CmdLineage extends CmdBase implements UsageAware {
177177
}
178178
}
179179

180-
class CmdDescribe implements SubCmd{
180+
class CmdView implements SubCmd{
181181

182182
@Override
183183
String getName() {
@@ -186,7 +186,7 @@ class CmdLineage extends CmdBase implements UsageAware {
186186

187187
@Override
188188
String getDescription() {
189-
return 'Print the description of a Lineage ID (lid)'
189+
return 'View a lineage record'
190190
}
191191

192192
void apply(List<String> args) {
@@ -196,7 +196,7 @@ class CmdLineage extends CmdBase implements UsageAware {
196196
return
197197
}
198198

199-
operation.describe(config, args)
199+
operation.view(config, args)
200200
}
201201

202202
@Override
@@ -229,7 +229,7 @@ class CmdLineage extends CmdBase implements UsageAware {
229229
@Override
230230
void usage() {
231231
println description
232-
println "Usage: nextflow $NAME $name <workflow output lid> [<html output file>]"
232+
println "Usage: nextflow $NAME $name <lid> [<html output file>]"
233233
}
234234

235235
}
@@ -241,7 +241,7 @@ class CmdLineage extends CmdBase implements UsageAware {
241241

242242
@Override
243243
String getDescription() {
244-
return 'Show differences between two lineage descriptions'
244+
return 'Show differences between two lineage records'
245245
}
246246

247247
void apply(List<String> args) {
@@ -268,12 +268,12 @@ class CmdLineage extends CmdBase implements UsageAware {
268268

269269
@Override
270270
String getDescription() {
271-
return 'Find lineage metadata descriptions matching with a query'
271+
return 'Find lineage records that match a query'
272272
}
273273

274274
void apply(List<String> args) {
275-
if (args.size() != 1) {
276-
println("ERROR: Incorrect number of parameters")
275+
if (args.size() == 0) {
276+
println("ERROR: At least one key-value pair is required")
277277
usage()
278278
return
279279
}
@@ -283,7 +283,7 @@ class CmdLineage extends CmdBase implements UsageAware {
283283
@Override
284284
void usage() {
285285
println description
286-
println "Usage: nextflow $NAME $name <query>"
286+
println "Usage: nextflow $NAME $name <key>=<value> [<key>=<value> ...]"
287287
}
288288

289289
}

modules/nextflow/src/main/groovy/nextflow/extension/LinExtension.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface LinExtension {
2929
static final Map PARAMS = [
3030
labels: List,
3131
taskRun: [String,GString],
32-
workflowRun: [String,GString],
32+
workflowLaunch: [String,GString],
3333
]
3434

3535
/**

modules/nf-lineage/src/main/nextflow/lineage/DefaultLinHistoryLog.groovy

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,30 +38,33 @@ class DefaultLinHistoryLog implements LinHistoryLog {
3838
Files.createDirectories(path)
3939
}
4040

41-
void write(String name, UUID key, String runLid, Date date = null) {
42-
assert key
41+
@Override
42+
void write(String name, UUID id, String launchLid, String runLid, Date date = null) {
43+
assert id
4344
def timestamp = date ?: new Date()
44-
final recordFile = path.resolve(key.toString())
45+
final recordFile = path.resolve(id.toString())
4546
try {
46-
recordFile.text = new LinHistoryRecord(timestamp, name, key, runLid).toString()
47-
log.trace("Record for $key written in lineage history log ${FilesEx.toUriString(this.path)}")
47+
recordFile.text = new LinHistoryRecord(timestamp, name, id, launchLid, runLid).toString()
48+
log.trace("Record for $id written in lineage history log ${FilesEx.toUriString(this.path)}")
4849
}catch (Throwable e) {
49-
log.warn("Can't write record $key file ${FilesEx.toUriString(recordFile)}", e.message)
50+
log.warn("Can't write record $id file ${FilesEx.toUriString(recordFile)}", e.message)
5051
}
5152
}
5253

54+
@Override
5355
void updateRunLid(UUID id, String runLid) {
5456
assert id
5557
final recordFile = path.resolve(id.toString())
5658
try {
5759
def current = LinHistoryRecord.parse(path.resolve(id.toString()).text)
58-
recordFile.text = new LinHistoryRecord(current.timestamp, current.runName, id, runLid).toString()
60+
recordFile.text = new LinHistoryRecord(current.timestamp, current.runName, id, current.launchLid, runLid).toString()
5961
}
6062
catch (Throwable e) {
6163
log.warn("Can't read session $id file: ${FilesEx.toUriString(recordFile)}", e.message)
6264
}
6365
}
6466

67+
@Override
6568
List<LinHistoryRecord> getRecords(){
6669
List<LinHistoryRecord> list = new LinkedList<LinHistoryRecord>()
6770
try {
@@ -73,6 +76,7 @@ class DefaultLinHistoryLog implements LinHistoryLog {
7376
return list.sort {it.timestamp }
7477
}
7578

79+
@Override
7680
LinHistoryRecord getRecord(UUID id) {
7781
assert id
7882
final recordFile = path.resolve(id.toString())

modules/nf-lineage/src/main/nextflow/lineage/LinExtensionImpl.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class LinExtensionImpl implements LinExtension {
4949

5050
private static Map<String, List<String>> buildQueryParams(Map<String,?> opts) {
5151
final queryParams = [type: [FileOutput.class.simpleName] ]
52-
if( opts.workflowRun )
53-
queryParams['workflowRun'] = [opts.workflowRun as String]
52+
if( opts.workflowLaunch )
53+
queryParams['workflowLaunch'] = [opts.workflowLaunch as String]
5454
if( opts.taskRun )
5555
queryParams['taskRun'] = [opts.taskRun as String]
5656
if( opts.labels )

modules/nf-lineage/src/main/nextflow/lineage/LinHistoryLog.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ interface LinHistoryLog {
2626
*
2727
* @param name Workflow execution name.
2828
* @param sessionId Workflow session ID.
29+
* @param launchLid Workflow launch Lineage ID.
2930
* @param runLid Workflow run ID.
3031
*/
31-
void write(String name, UUID sessionId, String runLid)
32+
void write(String name, UUID sessionId, String launchLid, String runLid)
3233

3334
/**
3435
* Updates the run LID for a given session ID.

modules/nf-lineage/src/main/nextflow/lineage/LinHistoryRecord.groovy

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ class LinHistoryRecord {
3535
final Date timestamp
3636
final String runName
3737
final UUID sessionId
38+
final String launchLid
3839
final String runLid
3940

40-
LinHistoryRecord(Date timestamp, String name, UUID sessionId, String runLid) {
41+
LinHistoryRecord(Date timestamp, String name, UUID sessionId, String launchLid, String runLid) {
4142
this.timestamp = timestamp
4243
this.runName = name
4344
this.sessionId = sessionId
45+
this.launchLid = launchLid
4446
this.runLid = runLid
4547
}
4648

@@ -51,6 +53,7 @@ class LinHistoryRecord {
5153
timestamp ? TIMESTAMP_FMT.format(timestamp) : '-',
5254
runName ?: '-',
5355
sessionId.toString(),
56+
launchLid ?: '-',
5457
runLid ?: '-',
5558
)
5659
}
@@ -62,8 +65,8 @@ class LinHistoryRecord {
6265

6366
static LinHistoryRecord parse(String line) {
6467
final cols = line.tokenize('\t')
65-
if (cols.size() == 4) {
66-
return new LinHistoryRecord(TIMESTAMP_FMT.parse(cols[0]), cols[1], UUID.fromString(cols[2]), cols[3])
68+
if (cols.size() == 5) {
69+
return new LinHistoryRecord(TIMESTAMP_FMT.parse(cols[0]), cols[1], UUID.fromString(cols[2]), cols[3], cols[4])
6770
}
6871
throw new IllegalArgumentException("Not a valid history entry: `$line`")
6972
}

0 commit comments

Comments
 (0)