-
Notifications
You must be signed in to change notification settings - Fork 475
compiler: error on inputs declared under custom jobs #48607
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,6 +175,10 @@ func (c *Compiler) extractCustomJobProperties(job *Job, jobName string, configMa | |
| } | ||
|
|
||
| func (c *Compiler) extractCustomJobCoreProperties(job *Job, jobName string, configMap map[string]any) error { | ||
| if _, hasInputs := configMap["inputs"]; hasInputs { | ||
| return fmt.Errorf("jobs.%s.inputs: inputs are not supported on jobs; use 'env' to pass values to job steps", jobName) | ||
|
Comment on lines
+178
to
+179
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check is dead code in the real compile path — schema validation already rejects
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in a3561ac by adding pre-schema validation for |
||
| } | ||
|
|
||
| if err := c.extractCustomJobRunsOn(job, jobName, configMap); err != nil { | ||
| return err | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in a3561ac. I added a pre-schema validation in parser validation flow so
jobs.<name>.inputsnow fails before JSON schema, and added both parser-level and compile-string end-to-end tests to verify the actionable error is returned (not the generic unknown-property message). Kept the compiler-side check as defense-in-depth for direct builder paths that bypass schema.