Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: fix: fail-safe dependency config lookup in action config processing #6602

Merged
merged 1 commit into from
Oct 29, 2024
Merged
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
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