Skip to content

Fix buildCustomJobs() to extract 7 silently-dropped job fields#19539

Merged
pelikhan merged 5 commits intomainfrom
copilot/fix-extraction-of-job-fields
Mar 4, 2026
Merged

Fix buildCustomJobs() to extract 7 silently-dropped job fields#19539
pelikhan merged 5 commits intomainfrom
copilot/fix-extraction-of-job-fields

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

  • Add ContinueOnError bool field to Job struct in pkg/workflow/jobs.go
  • Add rendering for continue-on-error in renderJob in pkg/workflow/jobs.go
  • Extract name (DisplayName) field in buildCustomJobs() in pkg/workflow/compiler_jobs.go
  • Extract timeout-minutes field in buildCustomJobs() in pkg/workflow/compiler_jobs.go
  • Extract concurrency field (string and map forms) in buildCustomJobs() in pkg/workflow/compiler_jobs.go
  • Extract env field in buildCustomJobs() in pkg/workflow/compiler_jobs.go
  • Extract container field (string and map forms) in buildCustomJobs() in pkg/workflow/compiler_jobs.go
  • Extract services field in buildCustomJobs() in pkg/workflow/compiler_jobs.go
  • Extract continue-on-error field in buildCustomJobs() in pkg/workflow/compiler_jobs.go
  • Add unit tests for all 7 new fields in pkg/workflow/compiler_jobs_test.go
  • Fix ContinueOnError to use *bool to distinguish "not set" from "explicit false", preventing continue-on-error: false from appearing in all compiled jobs
Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Fix buildCustomJobs() to extract silently-dropped job fields</issue_title>
<issue_description>## Objective

Fix buildCustomJobs() in pkg/workflow/compiler_jobs.go to extract the 7 schema-defined job fields that are currently silently dropped at compile time.

Context

From discussion #19383: The buildCustomJobs() function only extracts 8 of the 17 schema-defined job properties. Fields like name, timeout-minutes, env, container, services, and concurrency are accepted by the schema at parse time but silently discarded at compile time — users get no warning.

The Job struct in pkg/workflow/jobs.go already has fields for most of these, and the rendering code in jobs.go already handles them. They just need to be populated during extraction.

Approach

In pkg/workflow/compiler_jobs.go, inside buildCustomJobs() (around line 424), add extraction for each missing field:

  1. name (DisplayName): Extract string from configMap["name"]job.DisplayName
  2. timeout-minutes: Extract int from configMap["timeout-minutes"]job.TimeoutMinutes
  3. concurrency: Extract string from configMap["concurrency"]job.Concurrency
  4. env: Extract map[string]string from configMap["env"]job.Env
  5. container: Use YAML marshal on configMap["container"] to produce a YAML string → job.Container
  6. services: Use YAML marshal on configMap["services"] to produce a YAML string → job.Services
  7. continue-on-error: Add new ContinueOnError bool field to Job struct, extract bool from configMap["continue-on-error"], add rendering in jobs.go

Files to Modify

  • pkg/workflow/compiler_jobs.go — add field extraction in buildCustomJobs()
  • pkg/workflow/jobs.go — add ContinueOnError field to Job struct and rendering logic

Acceptance Criteria

  • All 7 missing fields are extracted and rendered in compiled YAML output
  • container and services use YAML marshaling consistent with top-level extraction pattern
  • continue-on-error: true renders correctly in compiled job YAML
  • Unit tests added/updated to verify each field is preserved through compilation
  • Run make agent-finish before committing

Generated by Plan Command for issue #discussion #19383 ·

  • expires on Mar 5, 2026, 10:49 AM UTC

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…imeout-minutes, concurrency, env, container, services, continue-on-error)"

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix buildCustomJobs to extract silently-dropped job fields Fix buildCustomJobs() to extract 7 silently-dropped job fields Mar 4, 2026
@pelikhan pelikhan marked this pull request as ready for review March 4, 2026 08:31
Copilot AI review requested due to automatic review settings March 4, 2026 08:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes buildCustomJobs() so several schema-valid job fields are no longer silently dropped during compilation, ensuring they appear in the generated .lock.yml.

Changes:

  • Extend Job to support continue-on-error and render it in job YAML.
  • Update buildCustomJobs() to extract and propagate: name, timeout-minutes, concurrency, env, container, services, continue-on-error.
  • Add unit tests covering extraction/rendering paths via CompileWorkflow() and direct buildCustomJobs().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pkg/workflow/jobs.go Adds ContinueOnError to Job and renders continue-on-error in job YAML output.
pkg/workflow/compiler_jobs.go Extracts previously ignored job fields from custom job configs and populates Job accordingly.
pkg/workflow/compiler_jobs_test.go Adds tests to verify the newly extracted fields are preserved and rendered.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pelikhan
Copy link
Contributor

pelikhan commented Mar 4, 2026

@copilot fix tests

CI / build-wasm (pull_request)Failing after 53s
CI / test (pull_request)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot fix tests

CI / build-wasm (pull_request)Failing after 53s
...

Fixed in 51b11ba. The issue was that commit 90a28e7 applied a review suggestion to always render continue-on-error: %t, which emitted continue-on-error: false on every job (since bool defaults to false), breaking the golden tests.

Changed ContinueOnError from bool to *bool — it's only rendered when explicitly set, and now correctly handles both true and false values without polluting jobs that don't set it.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw x_amd64/vet /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha te &#39;../../../**/*.json&#39; &#39;!../../../pkg/workflow/js/**/*.json&#39; --ignore-path ../../../.prettieriggit -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc git rev-�� --show-toplevel -tests /home/REDACTED/work/gh-aw/gh-aw/node_modules/.bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha it/ref/tags/v7 /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git -bool -buildtags /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel -tests /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha */*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.prettierignore pull.rebase 86_64/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git rite &#39;../../../*git /tmp/go-build273rev-parse ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/asm /usr/bin/git -bool -buildtags /home/REDACTED/wor--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha &#34;prettier&#34; --write &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel x_amd64/vet /usr/bin/git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha te &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.pret.prettierignore /tmp/go-build2732162797/b063/vet.cfg nfig/composer/vendor/bin/sh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha te &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.pret.prettierignore /tmp/go-build2732162797/b003/vet.cfg k/gh-aw/gh-aw/actions/setup/node_modules/.bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel x_amd64/vet /usr/bin/git h ../../../.pretgit (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha js/**/*.json&#39; --ignore-path ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha ../pkg/workflow/js/**/*.json&#39; ---errorsas om/davecgh/go-spew@v1.1.1/spew/c-ifaceassert ache/go/1.25.0/x64/pkg/tool/linu-nilfunc http.https://gitgit (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha te &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.pret.prettierignore -buildtags /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet 2162�� rite &#39;../../../**/*.json&#39; &#39;!../../../pkg/workflow/js/**/*.json&#39; --ignore-path ../../../.prettiergit 2162797/b001/_testmain.go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha te &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.pret.prettierignore /tmp/go-build2732162797/b070/vet.cfg k/gh-aw/gh-aw/node_modules/.bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --show-toplevel x_amd64/compile /usr/bin/git h ../../../.pretgit (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha te &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.pret.prettierignore /tmp/go-build2732162797/b124/vet.cfg h -c=4 -nolocalimports -importcfg 2162797/b357/importcfg -uns�� rite &#39;../../../**/*.json&#39; &#39;!../../../pkg/workflow/js/**/*.json&#39; --ignore-path k/gh-aw/gh-aw/pkg/workflow/importable_tools_test.go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel /bin/sh .cfg cd actions/setupgit (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha te &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.pret.prettierignore /tmp/go-build2732162797/b053/vet.cfg tnet/tools/sh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel /bin/sh /usr/bin/git echo &#34;��� JavaScgit (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha get --local ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet http.https://gitgit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha ster.patch /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git -unreachable=falgit /tmp/go-build273rev-parse es/.bin/sh git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git te &#39;scripts/**/*git -buildtags /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha re --log-level=e!../../../pkg/workflow/js/**/*.json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha re --log-level=error elds x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha ignore-path ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha xterm-color 64/pkg/tool/linux_amd64/vet /usr/bin/git (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha ignore-path ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan merged commit 3ee4953 into main Mar 4, 2026
48 checks passed
@pelikhan pelikhan deleted the copilot/fix-extraction-of-job-fields branch March 4, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Fix buildCustomJobs() to extract silently-dropped job fields

3 participants