Skip to content

Commit

Permalink
revert: fix: fail-safe dependency config lookup in action config proc…
Browse files Browse the repository at this point in the history
…essing (#6549)
  • Loading branch information
vvagaytsev committed Oct 29, 2024
1 parent 260ea34 commit 0f096c7
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions core/src/graph/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1013,28 +1013,10 @@ const dependenciesFromActionConfig = profile(function dependenciesFromActionConf
const depKey = actionReferenceToString(d)
const depConfig = configsByKey[depKey]

// When a dependency config is missing here, 99% of the time this indicates a user error in a templated action name
// from a config template (e.g. an expression or part of an expression evaluating to null or undefined,
// and this then being interpolated into the string value for the action name).
if (!depConfig) {
const actionTemplateInfo = () => {
const configTemplateName = config.internal.templateName
if (!configTemplateName) {
return ""
}
return `The action was rendered from the configuration template ${styles.highlight(configTemplateName)}.`
}

log.warn(
deline`
Found a missing dependency with name ${styles.highlight(`"${name}"`)}.
The template expression for this action name (or part of it) may have unintentionally resolved to null or
undefined. Please take a look at the template expression in question in the configuration
for action ${styles.highlight(depKey)} or in its configuration template if any.
${actionTemplateInfo()}
`
)
return undefined
throw new ConfigurationError({
message: `${description} references dependency ${depKey}, but no such action could be found`,
})
}

return {
Expand Down

0 comments on commit 0f096c7

Please sign in to comment.