Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a4c5a23
Merge branch 'main' of https://github.com/microsoft/typespec into tes…
l0lawrence Jun 23, 2026
358e13e
test: trigger regen diff workflow
l0lawrence Jun 23, 2026
cf710e2
fix: pass diff title via env var to avoid shell quoting error
l0lawrence Jun 23, 2026
e4e8317
fix: guard against oversized diffs in render-diff (RangeError)
l0lawrence Jun 23, 2026
3110edd
feat: render diff as navigable per-file pages instead of one giant HTML
l0lawrence Jun 23, 2026
5c3b600
fix: ignore CRLF/LF noise in regen diff; store baseline as LF
l0lawrence Jun 23, 2026
4a7536c
feat: group regen diff index by folder tree with aggregated counts
l0lawrence Jun 23, 2026
bfc8798
Merge branch 'l0lawrence/python-regen-html-diff' into testing
l0lawrence Jun 23, 2026
e4101ca
Merge branch 'l0lawrence/python-regen-html-diff' into testing
l0lawrence Jun 23, 2026
548fc4e
test(python): add comment to version template to demo regen diff
l0lawrence Jun 23, 2026
2dded30
Merge branch 'l0lawrence/python-regen-html-diff' into testing
l0lawrence Jun 23, 2026
3fdced7
Merge branch 'l0lawrence/python-regen-html-diff' into testing
l0lawrence Jun 23, 2026
53c91ee
test: bump python regen baseline to spec-aligned tag 481763e148
l0lawrence Jun 23, 2026
35f35d0
render-diff: show modified files as modified, not renamed
l0lawrence Jun 23, 2026
cc9ba36
render-diff: add local --open flow and convenience scripts
l0lawrence Jun 23, 2026
1f139d4
add --vscode native diff mode to render-diff
l0lawrence Jun 29, 2026
23d4a22
feat: generalize regen-diff into a shared config-driven tool
l0lawrence Jun 29, 2026
0d05094
refactor(regen-diff): drop diff2html, self-render colorized unified diff
l0lawrence Jun 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 0 additions & 157 deletions .github/workflows/python-regen-diff-publish.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/python-regen-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ jobs:
- name: Regenerate tests
run: npm run regenerate

- name: Install regen-diff tool
working-directory: eng/common/scripts/regen-diff
run: npm install --no-package-lock

- name: Render HTML diff
env:
DIFF_TITLE: "Python emitter generated test diff (PR #${{ github.event.pull_request.number || 'manual' }})"
Expand All @@ -72,6 +76,6 @@ jobs:
- name: Upload diff site
uses: actions/upload-artifact@v7
with:
name: python-regen-diff
name: regen-diff-site
path: ${{ runner.temp }}/diff-site
retention-days: 7
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Python Regen Diff Cleanup
name: Regen Diff Cleanup

# Removes a PR's published diff preview from GitHub Pages when the PR is closed.
# Uses pull_request_target (closed) so it runs in the base-repo context with a
# write token even for fork PRs. It does NOT check out or run any PR code — it
# only deletes the pr/<num>/ folder from gh-pages and updates the sticky comment.
# Shared, language-agnostic cleanup. Removes a PR's published diff previews from
# GitHub Pages when the PR is closed. Uses pull_request_target (closed) so it
# runs in the base-repo context with a write token even for fork PRs. It does
# NOT check out or run any PR code — it only deletes the pr/<num>/ folder from
# gh-pages and updates the sticky comment(s).

on:
pull_request_target:
types: [closed]
paths:
- "packages/http-client-python/**"
- "packages/http-client-java/**"
- "packages/http-client-csharp/**"
- "packages/http-client-js/**"

permissions:
contents: write
Expand Down Expand Up @@ -41,10 +45,10 @@ jobs:
git -C "$tmp" rm -r "pr/${PR}" >/dev/null
git -C "$tmp" config user.name "github-actions[bot]"
git -C "$tmp" config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git -C "$tmp" commit -m "Remove diff preview for closed PR #${PR}"
git -C "$tmp" commit -m "Remove diff previews for closed PR #${PR}"
git -C "$tmp" push origin gh-pages

- name: Update PR comment
- name: Update PR comments
uses: actions/github-script@v7
env:
PR: ${{ github.event.pull_request.number }}
Expand All @@ -53,16 +57,17 @@ jobs:
const prNumber = Number(process.env.PR);
const owner = context.repo.owner;
const repo = context.repo.repo;
const marker = '<!-- python-regen-diff -->';
const markerPrefix = '<!-- regen-diff:';
const comments = await github.paginate(github.rest.issues.listComments, {
owner, repo, issue_number: prNumber, per_page: 100,
});
const existing = comments.find((c) => c.body && c.body.includes(marker));
if (!existing) return;
const body = [
marker,
'### 🐍 Python emitter — generated test diff',
'',
'_The diff preview for this PR was removed because the PR is now closed._',
].join('\n');
await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });
for (const c of comments) {
if (!c.body || !c.body.includes(markerPrefix)) continue;
const firstLine = c.body.split('\n', 1)[0];
const body = [
firstLine,
'',
'_The diff preview for this PR was removed because the PR is now closed._',
].join('\n');
await github.rest.issues.updateComment({ owner, repo, comment_id: c.id, body });
}
Loading