chore: copilot agent triage env + instructions (static-first, runtime-fallback)#1872
Draft
wenytang-ms wants to merge 3 commits into
Draft
chore: copilot agent triage env + instructions (static-first, runtime-fallback)#1872wenytang-ms wants to merge 3 commits into
wenytang-ms wants to merge 3 commits into
Conversation
Provisions JDK 21, Node 20, gradle-server jars and Xvfb so the GitHub Copilot cloud agent can build and run the extension's autotest when reproducing issues. Mirrors the runtime of the build-and-analyse + test-extension jobs in main.yml. Static code analysis needs no setup since the agent always has a repo checkout; these steps enable the optional runtime-reproduction fallback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…exists buildJars only produces jars; the lib/gradle-server launcher is created by :gradle-server:serverStartScripts (run via gradlew build). Mirrors the build-and-analyse job that uploads the lib artifact consumed by test-extension. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…age flow Codifies the issue triage decision flow for the Copilot coding agent: prefer static code+git analysis, fall back to building/running testVsCode only when inconclusive. Includes repo orientation, build/lint/test commands, a structured verdict format, draft-PR-with-failing-test boundary, and a security boundary treating issue bodies as untrusted input. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two files that together let the GitHub Copilot coding agent triage issues with a static-analysis-first, runtime-fallback approach:
.github/workflows/copilot-setup-steps.yml— provisions the runtime (JDK 21, Node 20, gradle-server jars, Xvfb) so the agent can build and run the extension when static analysis is inconclusive..github/copilot-instructions.md— codifies the triage behavior contract: prefer static code + git-history analysis, only build/runtestVsCodeto reproduce when needed, emit a structured verdict, never fix product code (at most a draft PR with one failing regression test), and treat issue bodies as untrusted input.Why
When an issue is escalated to the Copilot cloud agent for root-cause analysis, the agent always works in a checkout of the repo, so static code + git-history analysis is available with zero setup. The expensive part is the fallback: when static analysis is inconclusive, the agent should be able to build the gradle-server jars and run the
testVsCodeautotest to reproduce the issue at runtime.The default Copilot environment does not have JDK 21, the sibling
build-server-for-gradlerepo, the built jars, or a headless display, so the runtime fallback would otherwise fail (or be slow and unreliable via trial-and-error). This file preinstalls them deterministically.What it does
Mirrors the runtime of the
build-and-analyse+test-extensionjobs in.github/workflows/main.yml:microsoft/build-server-for-gradleintoextension/build-server-for-gradle../gradlew buildJarsthen../gradlew build(the latter producesextension/libincl. thegradle-serverstart script via:gradle-server:serverStartScripts, plusdist/out) +npm ci+chmod +x extension/lib/gradle-server~/.gradleandextension/.vscode-testxvfb(not started — background procs don't persist into the agent session; the agent runsxvfb-run -a ../gradlew testVsCodeon demand)Notes / follow-ups
copilot-setup-steps.ymlonly takes effect once merged to the default branch (develop).services.gradle.org,repo.maven.apache.org,plugins.gradle.org, etc., orbuildJars/testVsCodewill fail.copilotenvironment free of publish/signing secrets — the runtime fallback builds untrusted Gradle projects from issue bodies (Gradle's configuration phase executes arbitrary code).buildJarsadds a few minutes to every Copilot session (mitigated by Gradle caching). Acceptable trade-off for runtime-capable triage.Opened as a draft for review of the fixture/command details before enabling.