From a6bdf888ee4a03621266fad38844aee517f6db9d Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 20 Mar 2026 10:49:26 -0700 Subject: [PATCH] Fix template sync: limit to 48h PRs, prevent duplicate issues - Only consider template PRs merged in the last 48 hours instead of last 50 - Check open AND closed issues and PRs before creating duplicates - Use full URLs for template PR references to avoid cross-repo confusion Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/extension-template-sync.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/extension-template-sync.md b/.github/workflows/extension-template-sync.md index 56d4e92..1635d19 100644 --- a/.github/workflows/extension-template-sync.md +++ b/.github/workflows/extension-template-sync.md @@ -65,8 +65,8 @@ Key **mypy-specific areas** that are NOT expected to match the template: ### Step 1: Fetch recent template PRs -- List the last 50 merged PRs in `microsoft/vscode-python-tools-extension-template`. -- If there are no merged PRs, stop. +- List merged PRs in `microsoft/vscode-python-tools-extension-template` that were merged in the **last 48 hours**. Ignore any PRs merged before that window. +- If there are no recently merged PRs, stop. ### Step 2: For each merged PR, detect missing changes @@ -96,7 +96,7 @@ For each unsynced template PR, use the `create-issue` safe output with: Changes from the upstream [vscode-python-tools-extension-template](https://github.com/microsoft/vscode-python-tools-extension-template) have not yet been incorporated into this repository. #### Source PR -- microsoft/vscode-python-tools-extension-template# +- [microsoft/vscode-python-tools-extension-template#<NUMBER> — <title>](https://github.com/microsoft/vscode-python-tools-extension-template/pull/<NUMBER>) #### Summary <Brief summary of what the template PR changed and why.> @@ -114,10 +114,12 @@ Changes from the upstream [vscode-python-tools-extension-template](https://githu 🤖 This issue was auto-generated by the [`extension-template-sync`](.github/workflows/extension-template-sync.md) workflow. ``` +**IMPORTANT**: When referencing a template PR anywhere in the issue (title, body, or comments), always use the **full URL** (e.g., `https://github.com/microsoft/vscode-python-tools-extension-template/pull/123`), never the shorthand `#123` or `microsoft/vscode-python-tools-extension-template#123`, to avoid confusion with this repository's own issues and PRs. + ### Step 4: Handle edge cases - **CI/workflow files** (`.github/workflows/`, Azure Pipelines): These are often shared — still assess relevance. - **Large refactors**: Flag differing files and summarize in the issue body. - **Dependency updates** (`requirements.in`, `requirements.txt`, `package.json`): Only consider shared dependencies, not tool-specific ones. - **No unsynced changes found**: Do nothing — do not create any issues. -- **Already-open issues**: Before creating a new issue, search for existing open issues in this repository with the same title pattern (`Template Sync: <title>`). If one already exists for the same template PR, skip it to avoid duplicates. +- **Duplicate prevention**: Before creating a new issue, search for existing issues **and** pull requests in this repository — both **open and closed** — with the same title pattern (`Template Sync: <title>`) or that reference the same template PR number. If a matching issue or PR already exists, skip it to avoid duplicates.