Skip to content

Commit 4a70290

Browse files
authored
fix(tests): use MinimalFieldValue for GraphQL field value assertions
1 parent 3c43de0 commit 4a70290

9 files changed

Lines changed: 73 additions & 19 deletions

File tree

.github/workflows/code-scanning.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ jobs:
7878
go-version: ${{ fromJSON(steps.resolve-environment.outputs.environment).configuration.go.version }}
7979
cache: false
8080

81-
- name: Set up Node.js (for JavaScript CodeQL)
82-
if: matrix.language == 'javascript'
83-
uses: actions/setup-node@v6
81+
- name: Set up Node.js
82+
if: matrix.language == 'go' || matrix.language == 'javascript'
83+
uses: actions/setup-node@v4
8484
with:
8585
node-version: "20"
8686
cache: "npm"
8787
cache-dependency-path: ui/package-lock.json
8888

8989
- name: Build UI
9090
if: matrix.language == 'go'
91-
uses: ./.github/actions/build-ui
91+
run: script/build-ui
9292

9393
- name: Autobuild
9494
uses: github/codeql-action/autobuild@v4

.github/workflows/docker-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
# https://github.com/sigstore/cosign-installer
4747
- name: Install cosign
4848
if: github.event_name != 'pull_request'
49-
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 #v4.1.2
49+
uses: sigstore/cosign-installer@ba7bc0a3fef59531c69a25acd34668d6d3fe6f22 #v4.1.0
5050
with:
5151
cosign-release: "v2.2.4"
5252

@@ -60,7 +60,7 @@ jobs:
6060
# https://github.com/docker/login-action
6161
- name: Log into registry ${{ env.REGISTRY }}
6262
if: github.event_name != 'pull_request'
63-
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
63+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
6464
with:
6565
registry: ${{ env.REGISTRY }}
6666
username: ${{ github.actor }}
@@ -93,7 +93,7 @@ jobs:
9393
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
9494

9595
- name: Inject go-build-cache
96-
uses: reproducible-containers/buildkit-cache-dance@5422eac04292c961a382e0f584ea0f03ad9da723 # v3.4.0
96+
uses: reproducible-containers/buildkit-cache-dance@1b8ab18fbda5ad3646e3fcc9ed9dd41ce2f297b4 # v3.3.2
9797
with:
9898
cache-map: |
9999
{

.github/workflows/docs-check.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v6
1818

19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "20"
23+
cache: "npm"
24+
cache-dependency-path: ui/package-lock.json
25+
1926
- name: Build UI
20-
uses: ./.github/actions/build-ui
27+
run: script/build-ui
2128

2229
- name: Set up Go
2330
uses: actions/setup-go@v6

.github/workflows/go.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@ jobs:
2525
- name: Check out code
2626
uses: actions/checkout@v6
2727

28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: "20"
32+
cache: "npm"
33+
cache-dependency-path: ui/package-lock.json
34+
2835
- name: Build UI
29-
uses: ./.github/actions/build-ui
36+
shell: bash
37+
run: script/build-ui
3038

3139
- name: Set up Go
3240
uses: actions/setup-go@v6

.github/workflows/goreleaser.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ jobs:
1616
- name: Check out code
1717
uses: actions/checkout@v6
1818

19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "20"
23+
cache: "npm"
24+
cache-dependency-path: ui/package-lock.json
25+
1926
- name: Build UI
20-
uses: ./.github/actions/build-ui
27+
run: script/build-ui
2128

2229
- name: Set up Go
2330
uses: actions/setup-go@v6
@@ -28,7 +35,7 @@ jobs:
2835
run: go mod download
2936

3037
- name: Run GoReleaser
31-
uses: goreleaser/goreleaser-action@5daf1e915a5f0af01ddbcd89a43b8061ff4f1a89
38+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a
3239
with:
3340
distribution: goreleaser
3441
# GoReleaser version
@@ -40,7 +47,7 @@ jobs:
4047
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4148

4249
- name: Generate signed build provenance attestations for workflow artifacts
43-
uses: actions/attest-build-provenance@v4
50+
uses: actions/attest-build-provenance@v3
4451
with:
4552
subject-path: |
4653
dist/*.tar.gz

.github/workflows/license-check.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@ jobs:
3232
GH_TOKEN: ${{ github.token }}
3333
run: gh pr checkout ${{ github.event.pull_request.number }}
3434

35+
- name: Set up Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: "20"
39+
cache: "npm"
40+
cache-dependency-path: ui/package-lock.json
41+
3542
- name: Build UI
36-
uses: ./.github/actions/build-ui
43+
run: script/build-ui
3744

3845
- name: Set up Go
3946
uses: actions/setup-go@v6

.github/workflows/lint.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v6
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: "20"
20+
cache: "npm"
21+
cache-dependency-path: ui/package-lock.json
1722
- name: Build UI
18-
uses: ./.github/actions/build-ui
23+
run: script/build-ui
1924
- uses: actions/setup-go@v6
2025
with:
2126
go-version: '1.25'

.github/workflows/mcp-diff.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
2227
- name: Build UI
23-
uses: ./.github/actions/build-ui
28+
run: script/build-ui
2429

2530
- name: Run MCP Server Diff
2631
uses: SamMorrowDrums/mcp-server-diff@v2.3.5
@@ -34,6 +39,8 @@ jobs:
3439
[
3540
{"name": "default", "args": ""},
3641
{"name": "read-only", "args": "--read-only"},
42+
{"name": "dynamic-toolsets", "args": "--dynamic-toolsets"},
43+
{"name": "read-only+dynamic", "args": "--read-only --dynamic-toolsets"},
3744
{"name": "toolsets-repos", "args": "--toolsets=repos"},
3845
{"name": "toolsets-issues", "args": "--toolsets=issues"},
3946
{"name": "toolsets-context", "args": "--toolsets=context"},
@@ -43,7 +50,20 @@ jobs:
4350
{"name": "toolsets-all", "args": "--toolsets=all"},
4451
{"name": "tools-get_me", "args": "--tools=get_me"},
4552
{"name": "tools-get_me,list_issues", "args": "--tools=get_me,list_issues"},
46-
{"name": "toolsets-repos+read-only", "args": "--toolsets=repos --read-only"}
53+
{"name": "toolsets-repos+read-only", "args": "--toolsets=repos --read-only"},
54+
{"name": "toolsets-all+dynamic", "args": "--toolsets=all --dynamic-toolsets"},
55+
{"name": "toolsets-repos+dynamic", "args": "--toolsets=repos --dynamic-toolsets"},
56+
{"name": "toolsets-repos,issues+dynamic", "args": "--toolsets=repos,issues --dynamic-toolsets"},
57+
{
58+
"name": "dynamic-tool-calls",
59+
"args": "--dynamic-toolsets",
60+
"custom_messages": [
61+
{"id": 10, "name": "list_toolsets_before", "message": {"jsonrpc": "2.0", "id": 10, "method": "tools/call", "params": {"name": "list_available_toolsets", "arguments": {}}}},
62+
{"id": 11, "name": "get_toolset_tools", "message": {"jsonrpc": "2.0", "id": 11, "method": "tools/call", "params": {"name": "get_toolset_tools", "arguments": {"toolset": "repos"}}}},
63+
{"id": 12, "name": "enable_toolset", "message": {"jsonrpc": "2.0", "id": 12, "method": "tools/call", "params": {"name": "enable_toolset", "arguments": {"toolset": "repos"}}}},
64+
{"id": 13, "name": "list_toolsets_after", "message": {"jsonrpc": "2.0", "id": 13, "method": "tools/call", "params": {"name": "list_available_toolsets", "arguments": {}}}}
65+
]
66+
}
4767
]
4868
4969
- name: Add interpretation note

pkg/github/issues_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ func Test_SearchIssues_FieldValuesEnrichment(t *testing.T) {
11861186
require.Equal(t, 2, *response.Total)
11871187
require.Len(t, response.Items, 2)
11881188
assert.Equal(t, 42, *response.Items[0].Number)
1189-
assert.Equal(t, []MinimalIssueFieldValue{
1189+
assert.Equal(t, []MinimalFieldValue{
11901190
{Field: "priority", Value: "P1"},
11911191
{Field: "estimate", Value: "2.5"},
11921192
}, response.Items[0].FieldValues)
@@ -1976,9 +1976,9 @@ func Test_ListIssues(t *testing.T) {
19761976
// (including float formatting); #789 has no field values.
19771977
switch issue.Number {
19781978
case 123:
1979-
assert.Equal(t, []MinimalIssueFieldValue{{Field: "priority", Value: "P1"}}, issue.FieldValues)
1979+
assert.Equal(t, []MinimalFieldValue{{Field: "priority", Value: "P1"}}, issue.FieldValues)
19801980
case 456:
1981-
assert.Equal(t, []MinimalIssueFieldValue{
1981+
assert.Equal(t, []MinimalFieldValue{
19821982
{Field: "due", Value: "2026-06-01"},
19831983
{Field: "estimate", Value: "2.5"},
19841984
{Field: "notes", Value: "needs triage"},

0 commit comments

Comments
 (0)