Skip to content

Fix ok-to-test comment issue for external user on GitHub #1899

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

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

zakisk
Copy link
Contributor

@zakisk zakisk commented Jan 31, 2025

Issue: when an external user sends a pull request on a repository PAC create a pending check-run but after ok-to-test comment from an authorized user if there is not matching PipelineRun on in the repositoy the pending status of the check-run created by PAC still there and it hinders pull request to be merged automatically if auto-merge is setup on the repository.

Solution: If ok-to-test comment is sent on a pull request and there is no matching PipelineRun in .tekton directory then create neutral check-run on the pull request letting auto-merge work in its way.

https://issues.redhat.com/browse/KONFLUX-6565

Changes

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:

Git Provider Supported
GitHub App ✅️
GitHub Webhook ❌️
Gitea ❌️
GitLab ❌️
Bitbucket Cloud ❌️
Bitbucket Server ❌️

(update the documentation accordingly)

@zakisk
Copy link
Contributor Author

zakisk commented Jan 31, 2025

/test

@chmouel
Copy link
Member

chmouel commented Jan 31, 2025

can we have a e2e test for this using github ? and same for unittest

@zakisk
Copy link
Contributor Author

zakisk commented Feb 1, 2025

can we have a e2e test for this using github ? and same for unittest

for e2e test, it needs 3 users one repo owner, one in owners file and one outsider. if we try it could be with users but still need an extra user.

@zakisk zakisk force-pushed the KONFLUX-6565 branch 2 times, most recently from 8678903 to 3bb8e9a Compare February 1, 2025 05:09
@chmouel
Copy link
Member

chmouel commented Feb 3, 2025

/retest

@zakisk
Copy link
Contributor Author

zakisk commented Feb 3, 2025

/retest go-testing

@zakisk zakisk force-pushed the KONFLUX-6565 branch 2 times, most recently from 01cc8d7 to 7353cfd Compare February 5, 2025 04:32
Issue: when an external user sends a pull request on
a repository PAC create a pending check-run but after ok-to-test
comment from an authorized user if there is not matching PipelineRun
on in the repositoy the pending status of the check-run created
by PAC still there and it hinders pull request to be merged
automatically if auto-merge is setup on the repository.

Solution: If ok-to-test comment is sent on a pull request and
there is no matching PipelineRun in .tekton directory then
create neutral check-run on the pull request letting auto-merge
work in its way.

https://issues.redhat.com/browse/KONFLUX-6565

Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
@zakisk
Copy link
Contributor Author

zakisk commented Feb 5, 2025

/test

When a repository owner issues the `/ok-to-test` command on a pull request raised by an unauthorized user, and no PipelineRun exists in the .tekton directory for `pull_request` event,
Pipelines-as-Code will create a neutral check-run status. This status serves to indicate that no PipelineRun has been matched, preventing any workflows from being blocked such as auto-merge, will proceed as expected.

{{< hint info >}}
Copy link
Member

Choose a reason for hiding this comment

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

we need to slow down on the hint everywhere..... it's fine now but next time let's just use a normal tone part of the documentation....

@chmouel chmouel merged commit ecce161 into openshift-pipelines:main Feb 5, 2025
7 checks passed
@zakisk zakisk deleted the KONFLUX-6565 branch February 6, 2025 03:46
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.

2 participants