openshift-pipelines / pipelines-as-code

Pipelines-as-Code for Tekton
https://pipelinesascode.com
Apache License 2.0
130 stars 80 forks source link

Make sure we get the oldest repository #1639

Closed chmouel closed 5 months ago

chmouel commented 6 months ago

When we have multiple matches for the same repository, we need to make sure we only get the oldest one. This is important since we pac assumes the first one is the one that should be used, to avoid an hijacking scenario.

This should never happen in practice since we have our webhook that make sure we only have one repository per URL per cluster. If for whichever reasons the webhook is crashing or the admin has disabled it then at least we are covered

Changes

Submitter Checklist

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 64.13%. Comparing base (f10ee61) to head (1d4347f). Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1639 +/- ## ========================================== + Coverage 64.11% 64.13% +0.02% ========================================== Files 140 141 +1 Lines 10871 10878 +7 ========================================== + Hits 6970 6977 +7 Misses 3385 3385 Partials 516 516 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

piyush-garg commented 5 months ago

lgtm