Description
When PAC is installed on a repository that has no .tekton/ directory, it still:
- Creates a "pending approval" check run requesting
/ok-to-test on every PR from external contributors
- After
/ok-to-test is granted, creates a second "neutral" check run stating "there is no .tekton folder"
This causes unnecessary noise during the transition period when teams are setting up PAC, or when PAC is installed but not yet configured with any pipeline runs.
Steps to Reproduce
- Install PAC on a repository with no
.tekton/ directory
- Open a PR from an external contributor (not in the OWNERS file)
- Observe: PAC creates a check run requesting
/ok-to-test
- Add
/ok-to-test comment
- Observe: PAC creates a neutral check run saying "there is no .tekton folder"
Real-world Example
tektoncd/pipeline#9778 — PAC is installed on the tektoncd/pipeline repo but the repo has no .tekton/ directory. A contributor opened a PR, PAC requested /ok-to-test, a maintainer added the comment in response to PAC's request, and PAC then created a neutral check run saying there is no .tekton folder.
Expected Behavior
PAC should check whether .tekton/ directory contains any pipeline run templates before requesting /ok-to-test approval or creating any check runs. If there are no .tekton/ pipeline runs, PAC should skip all check run creation silently.
Actual Behavior
PAC creates a "pending approval" check run even when there are no .tekton/ pipeline runs to schedule.
Potential Root Cause
The ACL/approval check appears to run before PAC determines whether the repository has any .tekton/ pipeline run templates. As a result, the "pending approval" status is requested unconditionally for external contributors — even when there's nothing for PAC to run.
Proposed Fix
PAC should only request /ok-to-test approval (and create any check runs) if the repository actually contains .tekton/ pipeline run templates. If no templates are found, PAC should exit silently without creating any status or check run.
Alternatively, a repository-level configuration option could allow teams to opt out of check run creation when no .tekton/ directory is present.
References
Description
When PAC is installed on a repository that has no
.tekton/directory, it still:/ok-to-teston every PR from external contributors/ok-to-testis granted, creates a second "neutral" check run stating "there is no .tekton folder"This causes unnecessary noise during the transition period when teams are setting up PAC, or when PAC is installed but not yet configured with any pipeline runs.
Steps to Reproduce
.tekton/directory/ok-to-test/ok-to-testcommentReal-world Example
tektoncd/pipeline#9778 — PAC is installed on the
tektoncd/pipelinerepo but the repo has no.tekton/directory. A contributor opened a PR, PAC requested/ok-to-test, a maintainer added the comment in response to PAC's request, and PAC then created a neutral check run saying there is no.tektonfolder.Expected Behavior
PAC should check whether
.tekton/directory contains any pipeline run templates before requesting/ok-to-testapproval or creating any check runs. If there are no.tekton/pipeline runs, PAC should skip all check run creation silently.Actual Behavior
PAC creates a "pending approval" check run even when there are no
.tekton/pipeline runs to schedule.Potential Root Cause
The ACL/approval check appears to run before PAC determines whether the repository has any
.tekton/pipeline run templates. As a result, the "pending approval" status is requested unconditionally for external contributors — even when there's nothing for PAC to run.Proposed Fix
PAC should only request
/ok-to-testapproval (and create any check runs) if the repository actually contains.tekton/pipeline run templates. If no templates are found, PAC should exit silently without creating any status or check run.Alternatively, a repository-level configuration option could allow teams to opt out of check run creation when no
.tekton/directory is present.References