Skip to content

feat(ci): add copilot-setup-steps.yml for delegated CI-fix sessions#174

Merged
felickz merged 1 commit into
mainfrom
feat/copilot-setup-steps
Jul 10, 2026
Merged

feat(ci): add copilot-setup-steps.yml for delegated CI-fix sessions#174
felickz merged 1 commit into
mainfrom
feat/copilot-setup-steps

Conversation

@felickz

@felickz felickz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Why

Right now, delegating "fix the CI breakage from a CodeQL CLI bump" to a
Copilot coding agent session means it starts with no CodeQL CLI at all - it
would have to discover and install it itself, which the docs explicitly
warn

is "slow and unreliable, given the non-deterministic nature of LLMs."

What this does

Adds .github/workflows/copilot-setup-steps.yml, which GitHub Copilot coding
agent runs automatically before it starts working on a delegated task in this
repo. It:

  • Installs the CodeQL CLI version pinned in .codeqlversion, via the
    existing ./.github/actions/install-codeql composite action (same one
    ci.yml already uses).
  • Clones the matching codeql-cli-<version> branch of github/codeql
    alongside the workspace. Several languages' test options files (e.g.
    java/test/security/CWE-020/options) reference third-party library
    "stubs" (log4j, servlet-api, etc.) via a relative path into that sibling
    checkout instead of vendoring those stub jars into this repo - without it,
    codeql test run can't compile the test snippets at all. This mirrors
    ci.yml's own "Install Packs" step.

Deliberately does not run codeql pack install <lang>/... for every
language up front - that's fast enough for the agent to do itself for
whichever specific pack(s) it's actually fixing.

Also links this from CONTRIBUTING.md's "Fix any compilation/test errors"
checklist item, where delegating to a coding agent was already suggested.

Testing

  • Validated the workflow YAML parses correctly.
  • The codeql-cli-<version> branch naming was confirmed to exist upstream
    (e.g. codeql-cli-2.21.4) against github/codeql.

Pre-installs the pinned CodeQL CLI (via the existing install-codeql
composite action) and clones the matching codeql-cli-<version> branch
of github/codeql, so a Copilot coding agent session delegated to fix
compile/test errors from a CLI bump has everything it needs to run
`codeql pack install`/`codeql test run` itself instead of discovering
and installing the CLI through trial and error.

The github/codeql clone matters specifically for tests: several
languages' test `options` files (e.g. java/test/**/options) reference
third-party library stubs (log4j, servlet-api, etc.) via a relative
path into a sibling github/codeql checkout rather than vendoring those
stub jars into this repo - without it, codeql test run can't compile
the test snippets at all. This mirrors what ci.yml's own "Install
Packs" step already does.

Also links this from CONTRIBUTING.md's "Fix any compilation/test
errors" checklist item.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 10, 2026 22:21
@felickz felickz merged commit ebc1924 into main Jul 10, 2026
22 checks passed
@felickz felickz deleted the feat/copilot-setup-steps branch July 10, 2026 22:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Copilot cloud-agent setup workflow so delegated “fix CI after CodeQL CLI bump” sessions start with the repo’s pinned CodeQL CLI and the required github/codeql test-stubs checkout already available, and documents this in the contributor workflow.

Changes:

  • Add .github/workflows/copilot-setup-steps.yml to install the pinned CodeQL CLI and clone the matching codeql-cli-<version> branch of github/codeql.
  • Update CONTRIBUTING.md to reference the new setup-steps workflow in the “Fix compilation/test errors” checklist item.
Show a summary per file
File Description
CONTRIBUTING.md Links the new Copilot setup workflow from the CI-fix checklist item.
.github/workflows/copilot-setup-steps.yml Adds Copilot setup steps to preinstall CodeQL CLI and clone github/codeql stubs for codeql test run.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment on lines +40 to +50
# Several languages' test suites (see e.g. java/test/**/options,
# `--javac-args -cp ${testdir}/../../../../codeql/java/ql/test/stubs/...`)
# reference third-party library "stubs" (log4j, servlet-api, etc.) via a
# relative path into a sibling checkout of github/codeql, instead of
# vendoring those stub jars into this repo - github/codeql's own
# standard-library tests reuse the same stubs. Cloning the
# `codeql-cli-<version>` branch matching our pinned CLI version (mirroring
# ci.yml's own "Install Packs" step) is what makes those relative paths
# resolve, so `codeql test run` can actually compile the test snippets.
# `--depth=1`: we only need the tree at that branch tip, not its history.
gh repo clone github/codeql -- -b "codeql-cli-${CODEQL_CLI_VERSION}" --depth=1
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.

2 participants