From 92ef15416308da06ab0279edec6cbaa2af4e35a7 Mon Sep 17 00:00:00 2001 From: Martin Morrison-Grant Date: Thu, 27 Feb 2025 17:56:23 +0000 Subject: [PATCH] Temporarily remove the new workflows for warning about PR migration to intel/llvm. --- .github/workflows/pr-migration-auto-close.yml | 82 ------------------- .github/workflows/pr-migration-warn.yml | 69 ---------------- 2 files changed, 151 deletions(-) delete mode 100644 .github/workflows/pr-migration-auto-close.yml delete mode 100644 .github/workflows/pr-migration-warn.yml diff --git a/.github/workflows/pr-migration-auto-close.yml b/.github/workflows/pr-migration-auto-close.yml deleted file mode 100644 index db94672c48..0000000000 --- a/.github/workflows/pr-migration-auto-close.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Auto-Close PRs - -on: - schedule: - - cron: '0 0 * * *' - workflow_dispatch: - -permissions: - pull-requests: write - issues: write - -jobs: - close-stale-prs: - runs-on: ubuntu-latest - steps: - - name: Close PRs labeled "auto-close" - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { owner, repo } = context.repo; - const label = "auto-close"; - const now = new Date(); - const millisecondsInADay = 24 * 60 * 60 * 1000; - const autoCloseDays = 30; // how many days before PRs should be closed automatically - - // Fetch all open PRs - const prs = await github.paginate(github.rest.pulls.list, { - owner, - repo, - state: "open", - per_page: 100 - }); - - for (const pr of prs) { - // Check if PR has the "auto-close" label - if (!pr.labels.some(l => l.name === label)) continue; - - // Get the PR's label event timeline - const events = await github.paginate(github.rest.issues.listEvents, { - owner, - repo, - issue_number: pr.number - }); - - // Find the label added event - const labelEvent = events.find(e => e.event === "labeled" && e.label.name === label); - - const timeSinceLabeled = Math.floor((now - new Date(labelEvent.created_at)) / millisecondsInADay); - - // If label added event found and is older than autoCloseDays days, close the PR - if (labelEvent && timeSinceLabeled >= autoCloseDays) { - console.log(`Closing PR #${pr.number}`); - - // Close the PR - await github.rest.pulls.update({ - owner, - repo, - pull_number: pr.number, - state: "closed" - }); - - const commentBody = - "# Automatic PR Closure Notice\n" + - "## Information\n" + - "This PR has been closed automatically. It was marked with the `auto-close` [label](https://github.com/oneapi-src/unified-runtime/labels/auto-close) 30 days ago as part of the Unified Runtime source code migration to the intel/llvm repository - https://github.com/intel/llvm/pull/17043.\n\n" + - "All Unified Runtime development should be done in [intel/llvm](https://github.com/intel/llvm/tree/sycl/unified-runtime), details can be found in the updated [contribution guide](https://oneapi-src.github.io/unified-runtime/core/CONTRIB.html).\n" + - "This repository will continue to exist as a mirror and will host the [specification documentation](https://oneapi-src.github.io/unified-runtime/).\n\n" + - "## Next Steps\n" + - "Should you wish to re-open this PR it **must be moved** to [intel/llvm](https://github.com/intel/llvm/tree/sycl/unified-runtime). We have provided a [script to help automate this process](https://github.com/oneapi-src/unified-runtime/blob/main/scripts/move-pr-to-intel-llvm.py), otherwise no actions are required.\n\n" + - "---\n" + - "*This is an automated comment.*"; - - // Comment on the PR - await github.rest.issues.createComment({ - owner, - repo, - issue_number: pr.number, - body: commentBody - }); - } - } diff --git a/.github/workflows/pr-migration-warn.yml b/.github/workflows/pr-migration-warn.yml deleted file mode 100644 index be6292f8e1..0000000000 --- a/.github/workflows/pr-migration-warn.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Warn about intel/llvm migration - -on: - pull_request: - types: [opened, reopened, edited, ready_for_review, synchronize] - pull_request_target: - types: [opened, reopened, edited, ready_for_review, synchronize] - -permissions: - pull-requests: write - issues: write - -jobs: - label-and-comment: - runs-on: ubuntu-latest - steps: - - name: Label and comment on PR - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { owner, repo } = context.repo; - const pr_number = context.payload.pull_request.number; - const label = "auto-close"; - - // Get current labels on the PR - const { data: labels } = await github.rest.issues.listLabelsOnIssue({ - owner, - repo, - issue_number: pr_number - }); - - // Check if label is already present - if (!labels.some(labelObj => labelObj.name === label)) { - // Add the label if not present - await github.rest.issues.addLabels({ - owner, - repo, - issue_number: pr_number, - labels: [label] - }); - - const commentBody = - "# Unified Runtime -> intel/llvm Repo Move Notice\n" + - "## Information\n" + - "The source code of Unified Runtime has been moved to [intel/llvm](https://github.com/intel/llvm) under the [unified-runtime](https://github.com/intel/llvm/tree/sycl/unified-runtime) top-level directory,\n" + - "all future development will now be carried out there. This was done in https://github.com/intel/llvm/pull/17043.\n\n" + - "The code will be mirrored to [oneapi-src/unified-runtime](https://github.com/oneapi-src/unified-runtime) and the specification will continue to be hosted at [oneapi-src.github.io/unified-runtime](https://oneapi-src.github.io/unified-runtime/).\n\n" + - "The [contribution guide](https://oneapi-src.github.io/unified-runtime/core/CONTRIB.html) will be updated with new instructions for contributing to Unified Runtime.\n\n" + - "## PR Migration\n" + - "All open PRs including this one will be marked with the `auto-close` [label](https://github.com/oneapi-src/unified-runtime/labels/auto-close) and shall be **automatically closed after 30 days**.\n\n" + - "Should you wish to continue with your PR **you will need to migrate it** to [intel/llvm](https://github.com/intel/llvm/tree/sycl/unified-runtime).\n" + - "We have provided a [script to help automate this process](https://github.com/oneapi-src/unified-runtime/blob/main/scripts/move-pr-to-intel-llvm.py).\n\n" + - "If your PR should remain open and not be closed automatically, you can remove the `auto-close` label.\n\n" + - "---\n" + - "*This is an automated comment.*"; - - // Add a comment about the migration process and warn the PR will be automatically closed - await github.rest.issues.createComment({ - owner, - repo, - issue_number: pr_number, - body: commentBody - }); - - console.log(`Added label '${label}' and commented on PR #${pr_number}`); - } else { - console.log(`PR #${pr_number} already has the '${label}' label. Skipping.`); - }