Skip to content

Commit f1783a9

Browse files
authored
fix: correct schema URL path in nightly-schema-updater workflow prompt (#1496)
The `nightly-schema-updater` workflow prompt described `validation_schema.go`'s `schemaURL` as using the `pkg/workflow/schemas` path, but the file actually uses `docs/public/schemas` (the same path as `rules/rules.go`). This caused the agent to verify a non-existent URL, make unintended changes to the guard-policies workaround, and produce a patch that failed with `sha1 information is lacking or useless` during `git am --3way`. ## Changes - **Correct URL path** — `validation_schema.go` pattern updated from `pkg/workflow/schemas` → `docs/public/schemas` in Steps 2 and 5 - **Simplify Step 4 verification** — removed the non-existent `pkg/workflow/schemas` curl check; only one URL to verify now - **Scope-limit Step 5** — explicit instruction to only change the URL string value, not surrounding code (prevents spurious guard-policies diffs) - **Add test file coverage** — Step 5 now instructs the agent to check and update hardcoded URLs in `validation_schema_test.go` - **Cleanup** — removed stale `/pkg` reference from Step 3's version-extraction description
2 parents 15741ee + 4e5c135 commit f1783a9

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

.github/workflows/nightly-schema-updater.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,51 +78,59 @@ grep -n "schemaURL\|SchemaURL\|raw.githubusercontent.com/github/gh-aw" \
7878
The files and variables to update are:
7979

8080
- **`internal/config/validation_schema.go`** — variable `schemaURL` (around line 45)
81-
- Current pattern: `https://raw.githubusercontent.com/github/gh-aw/main/pkg/workflow/schemas/mcp-gateway-config.schema.json`
82-
- Target pattern: `https://raw.githubusercontent.com/github/gh-aw/<TAG>/pkg/workflow/schemas/mcp-gateway-config.schema.json`
81+
- Current pattern: `https://raw.githubusercontent.com/github/gh-aw/main/docs/public/schemas/mcp-gateway-config.schema.json`
82+
- Target pattern: `https://raw.githubusercontent.com/github/gh-aw/<TAG>/docs/public/schemas/mcp-gateway-config.schema.json`
8383

8484
- **`internal/config/rules/rules.go`** — constant `SchemaURL` (around line 15)
8585
- Current pattern: `https://raw.githubusercontent.com/github/gh-aw/main/docs/public/schemas/mcp-gateway-config.schema.json`
8686
- Target pattern: `https://raw.githubusercontent.com/github/gh-aw/<TAG>/docs/public/schemas/mcp-gateway-config.schema.json`
8787

88+
- **`internal/config/validation_schema_test.go`** — may contain hardcoded schema URLs that also need updating
89+
- Run `grep -n "raw.githubusercontent.com/github/gh-aw" internal/config/validation_schema_test.go` to check
90+
8891
## Step 3: Compare Versions
8992

90-
Parse the current URL to extract the version segment (the part between `gh-aw/` and `/pkg` or `/docs`).
93+
Parse the current URL to extract the version segment (the part between `gh-aw/` and `/docs`).
9194

9295
- If the current version is already the latest tag, **stop here** — no changes needed, exit successfully.
9396
- If the current version is `main` or an older tag, proceed to update.
9497

9598
## Step 4: Verify the Schema Exists at the New Tag
9699

97-
Before making changes, confirm the schema files actually exist at the new tag URL:
98-
99-
```bash
100-
curl -s -o /dev/null -w "%{http_code}" \
101-
"https://raw.githubusercontent.com/github/gh-aw/<TAG>/pkg/workflow/schemas/mcp-gateway-config.schema.json"
102-
```
100+
Before making changes, confirm the schema file actually exists at the new tag URL:
103101

104102
```bash
105103
curl -s -o /dev/null -w "%{http_code}" \
106104
"https://raw.githubusercontent.com/github/gh-aw/<TAG>/docs/public/schemas/mcp-gateway-config.schema.json"
107105
```
108106

109-
Both should return `200`. If either returns non-200, **stop** and create an issue instead of a PR:
107+
This should return `200`. If it returns non-200, **stop** and create an issue instead of a PR:
110108

111109
```
112110
Schema file not found at tag <TAG>. Skipping update.
113111
```
114112

115113
## Step 5: Update the Schema URLs
116114

117-
Update both files using the `edit` tool:
115+
Update the URL-bearing files using the `edit` tool. **Important**: only change the URL string value itself — do not modify any surrounding code, comments (except those described below), or other logic.
118116

119117
### Update `internal/config/validation_schema.go`
120118

121-
Replace the `schemaURL` value with the new versioned URL. If the file contains a comment line matching `// Current schema version: ...`, update it to reflect the new version; otherwise skip the comment update.
119+
Replace only the `schemaURL` value with the new versioned URL. If the file contains a comment line matching `// Current schema version: ...`, update it to reflect the new version; otherwise skip the comment update.
122120

123121
### Update `internal/config/rules/rules.go`
124122

125-
Replace the `SchemaURL` constant value with the new versioned URL.
123+
Replace only the `SchemaURL` constant value with the new versioned URL.
124+
125+
### Update `internal/config/validation_schema_test.go` (if needed)
126+
127+
Check if the test file contains hardcoded schema URLs and update them to use the new tag:
128+
129+
```bash
130+
grep -n "raw.githubusercontent.com/github/gh-aw" internal/config/validation_schema_test.go
131+
```
132+
133+
If any URLs reference `main` or an older tag, update them to `<TAG>`.
126134

127135
## Step 6: Validate the Changes
128136

@@ -153,6 +161,7 @@ Updates the MCP Gateway JSON schema validation URL from the previous version to
153161

154162
- `internal/config/validation_schema.go``schemaURL` variable updated to `<TAG>`
155163
- `internal/config/rules/rules.go``SchemaURL` constant updated to `<TAG>`
164+
- `internal/config/validation_schema_test.go` — hardcoded schema URLs updated to `<TAG>` (if present)
156165

157166
### Why
158167

0 commit comments

Comments
 (0)