Apply DIFC integrity filtering to pre-agentic activation and pre-activation job steps#22794
Apply DIFC integrity filtering to pre-agentic activation and pre-activation job steps#22794
Conversation
Inject DIFC proxy start/stop into buildActivationJob so that all actions/github-script calls (add_reaction, check_workflow_timestamp, compute_text, add_workflow_run_comment, lock-issue, remove_trigger_label, etc.) are routed through integrity filtering when min-integrity is set. The proxy startup script already sets GITHUB_API_URL, GITHUB_GRAPHQL_URL, NODE_EXTRA_CA_CERTS, and GH_HOST via $GITHUB_ENV, so no per-step base-url injection is needed — all subsequent Octokit calls are intercepted automatically. Condition used: hasDIFCGuardsConfigured (same as indexing job), since the activation job always makes GitHub API calls via github-script regardless of custom steps. Also updates the package comment in compiler_difc_proxy.go and adds TestDIFCProxyInjectedInActivationJob tests. Recompiled all 177 workflow lock files. Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/dbd57cd2-a5f2-480b-aa12-24198fde2259
…fails Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/dbd57cd2-a5f2-480b-aa12-24198fde2259
|
@lpcox are you wrapping the user injected steps? |
|
Hey This PR looks well-structured — the fix is focused, the description clearly explains the "why" and "how", the pattern mirrors the existing indexing-job injection, and the 4-sub-test One thing to note: the PR is currently in draft state. Once the firewall-block warning in the PR body has been addressed (or confirmed as non-blocking for the change), marking it ready for review will unblock maintainer attention. This PR looks ready for review! 🚀
|
|
@pelikhan it should be but I will double check. |
|
@copilot make sure that you are proxying compiler-added steps and user defined steps (from the front matter). is there a way to also proxy imported steps? can imported steps access GH_TOKEN? |
…ler checks) Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/14d51822-1e33-42dd-a755-9a3c7a18e90a
Done in ac14b09. Compiler-added steps: All steps in the activation job (reactions, timestamp check, compute_text, status comments, lock, label removal) are wrapped — proxy starts right after setup, stops before artifact upload. User-defined steps from frontmatter:
Imported steps ( Can imported steps access GH_TOKEN?: Yes — both the pre-activation and main jobs have 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Are you going to break these steps? |
|
I'd like to discuss this one... preactivation/activation is infrastructure |
|
@pelikhan happy to chat. we can limit to post-preactivation/activation |
Pre-agentic
actions/github-scriptsteps in theactivationjob (reactions, timestamp checks, body fetch, status comments, issue locking, label removal) and thepre_activationjob (membership checks, rate-limit, skip-if queries, command position checks, and user-definedon.steps/jobs.pre-activationcustom steps) made direct unfiltered calls toapi.github.comeven whenmin-integritywas configured — the DIFC proxy only ran during the agent phase.Changes
compiler_activation_job.go: Inject proxy start immediately aftergenerateSetupStep(before any github-script/gh CLI call) and proxy stop before the artifact upload, gated onhasDIFCGuardsConfigured— the same condition used by the indexing job. Adds a warning log when guards are configured but step generation unexpectedly returns empty.compiler_pre_activation_job.go: Inject proxy start immediately aftergenerateSetupStep(before any github-script call including membership checks, rate-limit, skip-if queries, and command position checks) and proxy stop after all steps including user-definedon.stepsandjobs.pre-activationcustom steps, gated onhasDIFCGuardsConfigured.compiler_difc_proxy.go: Extend package comment to document the activation job and pre-activation job proxy lifecycles alongside the existing main job and indexing job entries. Update injection conditions table to include the pre-activation job.compiler_difc_proxy_test.go: AddTestDIFCProxyInjectedInActivationJob(4 sub-tests) andTestDIFCProxyInjectedInPreActivationJob(4 sub-tests) covering full compilation (with/without guard policy) and direct job builder calls verifying step presence and ordering.How it works
No per-step
base-urlinjection is needed. The existing proxy startup script already exportsGITHUB_API_URL,GITHUB_GRAPHQL_URL,NODE_EXTRA_CA_CERTS, andGH_HOSTvia$GITHUB_ENV— all subsequent Octokit calls in github-script steps are intercepted automatically. This follows the same pattern already in use for the qmd indexing job.Coverage
pre_activationon.steps+jobs.pre-activationcustom stepsactivationindexing(qmd)📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.