Skip to content

feat: Implement script to mirror external PRs for E2E tests #2125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

chmouel
Copy link
Member

@chmouel chmouel commented Jun 12, 2025

Changes

  • Added hack/mirror-pr.sh script.
  • Added documentation to docs/content/docs/dev/_index.md.
  • Script allows maintainers to mirror external contributor pull requests to
    their fork.
  • This enables running E2E tests which may be blocked by security
    restrictions on external PRs.
  • Creates a draft pull request in the upstream repository with a
    do-not-merge label.
  • Adds a comment to the original pull request linking to the mirrored version.

image

Submitter Checklist

  • 📝 Ensure your commit message is clear and informative. Refer to the How to write a git commit message guide. Include the commit message in the PR body rather than linking to an external site (e.g., Jira ticket).

  • ♽ Run make test lint before submitting a PR to avoid unnecessary CI processing. Consider installing pre-commit and running pre-commit install in the repository root for an efficient workflow.

  • ✨ We use linters to maintain clean and consistent code. Run make lint before submitting a PR. Some linters offer a --fix mode, executable with make fix-linters (ensure markdownlint and golangci-lint are installed).

  • 📖 Document any user-facing features or changes in behavior.

  • 🧪 While 100% coverage isn't required, we encourage unit tests for code changes where possible.

  • 🎁 If feasible, add an end-to-end test. See README for details.

  • 🔎 Address any CI test flakiness before merging, or provide a valid reason to bypass it (e.g., token rate limitations).

  • If adding a provider feature, fill in the following details:

    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

    (update the provider documentation accordingly)

*   Added `hack/mirror-pr.sh` script.
*   Added documentation to `docs/content/docs/dev/_index.md`.
*   Script allows maintainers to mirror external contributor pull requests to
their fork.
*   This enables running E2E tests which may be blocked by security
restrictions on external PRs.
*   Creates a draft pull request in the upstream repository with a
`do-not-merge` label.
*   Adds a comment to the original pull request linking to the mirrored version.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@Copilot Copilot AI review requested due to automatic review settings June 12, 2025 10:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new script to mirror external contributor pull requests for E2E testing and updates documentation to explain its usage.

  • Adds the mirror-pr.sh script that checks out an external PR locally, pushes it to a fork under a unique branch name, and creates a draft mirrored PR with a "do-not-merge" label.
  • Updates the developer documentation with instructions for using the mirror-pr.sh script.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
hack/mirror-pr.sh Adds the script for mirroring external PRs for E2E tests.
docs/content/docs/dev/_index.md Documents the usage and purpose of the new mirror-pr.sh script.
Comments suppressed due to low confidence (2)

hack/mirror-pr.sh:46

  • The usage example in the subsequent line includes an extra parameter (the upstream repository) that could confuse users. Consider updating the usage message and example to consistently require only PR number and fork remote.
echo "Usage: $0 <PR_NUMBER> <YOUR_REMOTE_FORK>"

hack/mirror-pr.sh:35

  • The script assumes that fzf is installed for interactive selection but does not verify its presence. It would be beneficial to add a prerequisite check for fzf to provide a clearer error message if missing.
if [[ -z ${PR_NUMBER} ]]; then

@PuneetPunamiya
Copy link
Contributor

/merge

@pipelines-as-code pipelines-as-code bot merged commit 54151f7 into openshift-pipelines:main Jun 12, 2025
4 checks passed
Copy link

✅ PR Successfully Merged

Approvals Summary:

Reviewer Permission Status
@zakisk admin
@PuneetPunamiya admin

Thank you @chmouel for your valuable contribution! 🎉

Automated by the PAC Boussole 🧭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants