Skip to content

Commit 8a7680c

Browse files
midlemanclaude
andauthored
ci: add test tags in auto-update extension PRs (#13715)
### Summary Auto-update extension PRs now add e2e test tags in QA Notes, driven by a checked-in extension -> tag map. - New `extensions-tag-map.json` maps each bootstrap extension to its e2e tags - Empty tags render as `n/a`; unmapped extensions get a prompt to add an entry - Output also written to the run's Summary tab so dryruns are self-evidencing ### QA Notes Verified via [dryrun](https://github.com/posit-dev/positron/actions/runs/26289005769) dispatch. Please review the mapping for correctness.🙏 I made my best guess. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4899a3e commit 8a7680c

2 files changed

Lines changed: 79 additions & 7 deletions

File tree

.github/workflows/extensions-check-nightly.yml

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,54 @@ jobs:
138138
git --no-pager diff product.json
139139
fi
140140
141+
- name: Render test tags
142+
id: render-tags
143+
run: |
144+
UPDATED=$(jq -rn \
145+
--argjson old "$(git show HEAD:product.json)" \
146+
--argjson new "$(cat product.json)" \
147+
'($old.bootstrapExtensions | map({(.name): .version}) | add) as $ov |
148+
($new.bootstrapExtensions | map({(.name): .version}) | add) as $nv |
149+
[$nv | to_entries[] | select(.value != $ov[.key]) | .key] | join(" ")')
150+
if [ -z "$UPDATED" ]; then
151+
echo "No bootstrap extension version changes detected."
152+
echo "updated=" >> "$GITHUB_OUTPUT"
153+
exit 0
154+
fi
155+
TAG_MAP=.github/workflows/extensions-tag-map.json
156+
TAG_BULLETS=$(echo "$UPDATED" | tr ' ' '\n' | jq -R -s -r --slurpfile map "$TAG_MAP" '
157+
(split("\n") | map(select(length > 0))) as $exts |
158+
$map[0] as $m |
159+
$exts | map(
160+
. as $e | $m[$e] as $entry |
161+
if $entry == null then
162+
"- " + $e + " -> (unmapped; add to extensions-tag-map.json)"
163+
elif ($entry.tags | length) > 0 then
164+
"- " + $e + " -> " + ($entry.tags | join(", "))
165+
else
166+
"- " + $e + " -> n/a"
167+
end
168+
) | join("\n")
169+
')
170+
COMBINED_TAGS=$(echo "$UPDATED" | tr ' ' '\n' | jq -R -s -r --slurpfile map "$TAG_MAP" '
171+
split("\n") | map(select(length > 0)) | map($map[0][.].tags // []) | flatten | unique | join(" ")
172+
')
173+
UNMAPPED=$(echo "$UPDATED" | tr ' ' '\n' | jq -R -s -r --slurpfile map "$TAG_MAP" '
174+
split("\n") | map(select(length > 0)) | map(select($map[0][.] == null)) | join(", ")
175+
')
176+
{
177+
echo "### Suggested test tags"
178+
echo ""
179+
echo "$TAG_BULLETS"
180+
if [ -n "$COMBINED_TAGS" ]; then
181+
echo ""
182+
echo "Combined: $COMBINED_TAGS"
183+
fi
184+
} >> "$GITHUB_STEP_SUMMARY"
185+
echo "updated=$UPDATED" >> "$GITHUB_OUTPUT"
186+
echo "combined_tags=$COMBINED_TAGS" >> "$GITHUB_OUTPUT"
187+
echo "unmapped=$UNMAPPED" >> "$GITHUB_OUTPUT"
188+
141189
- name: Commit and push
142190
id: push
143191
if: inputs.dryrun != true
@@ -172,13 +220,11 @@ jobs:
172220
GH_TOKEN: ${{ steps.bot-token.outputs.token }}
173221
BRANCH: ${{ steps.push.outputs.branch }}
174222
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
223+
MAP_URL: ${{ github.server_url }}/${{ github.repository }}/blob/main/.github/workflows/extensions-tag-map.json
224+
UPDATED: ${{ steps.render-tags.outputs.updated }}
225+
COMBINED_TAGS: ${{ steps.render-tags.outputs.combined_tags }}
226+
UNMAPPED: ${{ steps.render-tags.outputs.unmapped }}
175227
run: |
176-
UPDATED=$(jq -rn \
177-
--argjson old "$(git show HEAD~1:product.json)" \
178-
--argjson new "$(cat product.json)" \
179-
'($old.bootstrapExtensions | map({(.name): .version}) | add) as $ov |
180-
($new.bootstrapExtensions | map({(.name): .version}) | add) as $nv |
181-
[$nv | to_entries[] | select(.value != $ov[.key]) | .key] | join(" ")')
182228
EXT_BULLETS=$(echo "$UPDATED" | tr ' ' '\n' | sed 's/^/- /')
183229
# Truncate title if more than 3 extensions to stay within GitHub's limit
184230
EXT_ARRAY=($UPDATED)
@@ -189,6 +235,16 @@ jobs:
189235
FIRST3="${EXT_ARRAY[0]},${EXT_ARRAY[1]},${EXT_ARRAY[2]}"
190236
TITLE="chore: update bootstrap extensions ($FIRST3 +$((COUNT - 3)) more)"
191237
fi
238+
TAGS_LINE=""
239+
if [ -n "$COMBINED_TAGS" ]; then
240+
TAGS_LINE="${COMBINED_TAGS}
241+
"
242+
fi
243+
UNMAPPED_LINE=""
244+
if [ -n "$UNMAPPED" ]; then
245+
UNMAPPED_LINE="[Unmapped](${MAP_URL}): ${UNMAPPED}
246+
"
247+
fi
192248
PR_URL=$(gh pr create \
193249
--base main \
194250
--head "$BRANCH" \
@@ -199,7 +255,7 @@ jobs:
199255
${EXT_BULLETS}
200256
201257
### QA Notes
202-
Triggered by [nightly extensions check](${RUN_URL}).")
258+
${TAGS_LINE}${UNMAPPED_LINE}Triggered by [nightly extensions check](${RUN_URL}).")
203259
echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"
204260
echo "updated=$UPDATED" >> "$GITHUB_OUTPUT"
205261
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"charliermarsh.ruff": { "tags": ["@:pyrefly"] },
3+
"GitHub.vscode-pull-request-github": { "tags": [] },
4+
"meta.pyrefly": { "tags": ["@:pyrefly"] },
5+
"ms-python.debugpy": { "tags": ["@:debug"] },
6+
"ms-toolsai.jupyter": { "tags": ["@:positron-notebooks"] },
7+
"ms-toolsai.jupyter-keymap": { "tags": ["@:positron-notebooks"] },
8+
"ms-toolsai.jupyter-renderers": { "tags": ["@:positron-notebooks"] },
9+
"ms-toolsai.vscode-jupyter-cell-tags": { "tags": ["@:positron-notebooks"] },
10+
"ms-toolsai.vscode-jupyter-slideshow": { "tags": ["@:positron-notebooks"] },
11+
"posit.air-vscode": { "tags": ["@:ark"] },
12+
"posit.assistant": { "tags": ["@:assistant", "@:posit-assistant"] },
13+
"posit.publisher": { "tags": ["@:workbench"] },
14+
"posit.shiny": { "tags": ["@:apps"] },
15+
"quarto.quarto": { "tags": ["@:quarto"] }
16+
}

0 commit comments

Comments
 (0)