Skip to content

Commit df23b56

Browse files
Copilotdata-douser
andauthored
Unpin CodeQL pack dependencies by removing committed lock files (#45)
* Initial plan * Remove pinned codeql-pack.lock.yml files and ignore future ones Agent-Logs-Url: https://github.com/advanced-security/codeql-development-template/sessions/a6282c16-1661-4d3b-b8ae-3a50f516d757 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Add install script, ${workspace} refs, bump to v0.0.2 - Add scripts/install-codeql-packs.sh using codeql pack ls for dynamic pack discovery with retry and --language filter - Use ${workspace} for intra-workspace deps in test packs - Bump all 32 workspace packs from 0.0.1 to 0.0.2 - Add pack install step to copilot-setup-steps workflow - Add README Step 2 for post-clone pack installation - Revert .gitignore: keep lock files in template-derived repos Resolves review feedback from #45. See also #43. * Fixes for prompt tidy/lint * Fixes for install-codeql-packs.sh * Update copilot-setup-steps workflow "on:{push,pull_request}paths" --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> Co-authored-by: Nathan Randall <data-douser@github.com>
1 parent 344b82a commit df23b56

67 files changed

Lines changed: 231 additions & 973 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/copilot-setup-steps.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ on:
1111
- .github/workflows/copilot-setup-steps.yml
1212
- .github/actions/setup-codeql-environment/action.yml
1313
- qlt.conf.json
14+
- scripts/install-codeql-packs.sh
1415
pull_request:
1516
branches:
1617
- main
1718
paths:
1819
- .github/workflows/copilot-setup-steps.yml
1920
- .github/actions/setup-codeql-environment/action.yml
2021
- qlt.conf.json
22+
- scripts/install-codeql-packs.sh
2123

2224
jobs:
2325
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
@@ -31,3 +33,7 @@ jobs:
3133

3234
- name: Copilot Setup - Setup CodeQL environment
3335
uses: ./.github/actions/setup-codeql-environment
36+
37+
- name: Copilot Setup - Install CodeQL workspace packs
38+
shell: bash
39+
run: ./scripts/install-codeql-packs.sh

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,19 @@ Before using this repository template, ensure your GitHub organization/account h
3434

3535
**Note:** The ['copilot-setup-steps' actions workflow](./.github/workflows/copilot-setup-steps.yml) will automatically set up the environment for Copilot Coding Agent (CCA), so local installation is optional and primarily useful for manual development.
3636

37-
### Step 2: Create an Issue for the CodeQL query you want to develop
37+
### Step 2: Install CodeQL Pack Dependencies
38+
39+
After cloning your new repository, install the CodeQL pack dependencies:
40+
41+
```bash
42+
./scripts/install-codeql-packs.sh
43+
```
44+
45+
This uses `codeql pack ls` to discover all packs in the workspace and runs `codeql pack install` for each one, generating `codeql-pack.lock.yml` files and downloading required dependencies locally. You can target a single language with `--language <lang>` (e.g., `--language java`).
46+
47+
> **Note:** The generated `codeql-pack.lock.yml` files should be committed to your repository to ensure reproducible dependency resolution across your team.
48+
49+
### Step 3: Create an Issue for the CodeQL query you want to develop
3850

3951
1. **Navigate to Issues** in your new repository
4052
2. **Click "New Issue"**
@@ -46,13 +58,13 @@ Before using this repository template, ensure your GitHub organization/account h
4658
- Specify severity level
4759
5. **Submit the issue**
4860

49-
### Step 3: Assign Issue to `@copilot`
61+
### Step 4: Assign Issue to `@copilot`
5062

5163
1. **Assign the issue** to `@copilot` (GitHub's Copilot Coding Agent user)
5264
2. **Wait for Copilot** to process the issue and create a Pull Request
5365
3. **Monitor progress** via the `Sessions` and/or comments for the new Pull Request
5466

55-
### Step 4: Review Pull Request created by Copilot Coding Agent
67+
### Step 5: Review Pull Request created by Copilot Coding Agent
5668

5769
1. **Navigate to the generated Pull Request**
5870
2. **Review the changes:**

languages/actions/custom/src/codeql-pack.lock.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: languages-actions-custom-src
2-
version: 0.0.1
2+
version: 0.0.2
33
library: false
44
dependencies:
55
codeql/actions-all: "*"

languages/actions/custom/test/codeql-pack.lock.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: languages-actions-custom-test
2-
version: 0.0.1
2+
version: 0.0.2
33
dependencies:
4-
languages-actions-custom-src: "*"
4+
languages-actions-custom-src: ${workspace}
55
extractor: actions

languages/actions/tools/src/codeql-pack.lock.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: languages-actions-tools-src
2-
version: 0.0.1
2+
version: 0.0.2
33
library: false
44
dependencies:
55
codeql/actions-all: "*"

languages/actions/tools/test/codeql-pack.lock.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: languages-actions-tools-test
2-
version: 0.0.1
2+
version: 0.0.2
33
dependencies:
44
# This test pack does not actually depend upon `codeql/actions-queries`,
55
# but we declare the dependency to ensure that the queries from the
66
# query pack are downloaded and available locally.
77
codeql/actions-queries: "*"
8-
languages-actions-tools-src: "*"
8+
languages-actions-tools-src: ${workspace}
99
extractor: actions

0 commit comments

Comments
 (0)