Skip to content

PAC should not request /ok-to-test approval or create check runs when no .tekton/ pipeline runs exist in the repository #2692

@chmouel

Description

@chmouel

Description

When PAC is installed on a repository that has no .tekton/ directory, it still:

  1. Creates a "pending approval" check run requesting /ok-to-test on every PR from external contributors
  2. 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

  1. Install PAC on a repository with no .tekton/ directory
  2. Open a PR from an external contributor (not in the OWNERS file)
  3. Observe: PAC creates a check run requesting /ok-to-test
  4. Add /ok-to-test comment
  5. 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions