Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,8 @@ public void visitConfigAssign(ConfigAssignNode node) {
var scopes = currentConfigScopes();
inProcess = !scopes.isEmpty() && "process".equals(scopes.get(0));
inClosure = node.value instanceof ClosureExpression;
if( inClosure ) {
if( isWorkflowHandler(scopes, node) )
vsc.addWarning("The use of workflow handlers in the config is deprecated -- use the entry workflow or a plugin instead", String.join(".", node.names), node);
else if( !inProcess )
vsc.addError("Dynamic config options are only allowed in the `process` scope", node);
}
if( isWorkflowHandler(scopes, node) )
vsc.addWarning("The use of workflow handlers in the config is deprecated -- use the entry workflow or a plugin instead", String.join(".", node.names), node);
if( inClosure ) {
vsc.pushScope(ScriptDsl.class);
if( inProcess )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,6 @@ class ConfigResolveTest extends Specification {
errors[0].getOriginalMessage() == '`process` is not defined'
}

def 'should report an error for an invalid dynamic config option' () {
when:
def errors = check(
'''\
report.file = { "report.html" }
'''
)
then:
errors.size() == 1
errors[0].getStartLine() == 1
errors[0].getStartColumn() == 1
errors[0].getOriginalMessage() == 'Dynamic config options are only allowed in the `process` scope'

when:
errors = check(
'''\
process.clusterOptions = { "--cpus ${task.cpus}" }
'''
)
then:
errors.size() == 0
}

def 'should report an error for an invalid config include' () {
given:
def root = tempDir()
Expand Down