openshift-pipelines / pipelines-as-code

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

Fix GH installation match verification #1686

Closed enarha closed 1 month ago

enarha commented 1 month ago

Changes

Fix pagignation for listing installation. Fix caching of repoList property in Install. Use the go-github ListInstallations method. Includes a workaround for cases where we fail to obtain a token for installation. If the failure happens early in the loop, we miss the legitimate installation including the matching repo.

Submitter Checklist

chmouel commented 1 month ago

/retest

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 78.94737% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 64.52%. Comparing base (16596b4) to head (9cfd55d). Report is 5 commits behind head on main.

:exclamation: Current head 9cfd55d differs from pull request most recent head a9d15cd

Please upload reports for the commit a9d15cd to get more accurate results.

Files Patch % Lines
pkg/cmd/tknpac/info/install.go 64.70% 4 Missing and 2 partials :warning:
pkg/provider/github/app/token.go 80.64% 4 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1686 +/- ## ========================================== + Coverage 64.41% 64.52% +0.11% ========================================== Files 143 143 Lines 11091 11093 +2 ========================================== + Hits 7144 7158 +14 + Misses 3421 3413 -8 + Partials 526 522 -4 ```

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

enarha commented 1 month ago

generally look good, i am fine merging this but i don't know if it actually works tho (since there is no e2e tests) what is the test strategy here?(altho i understand it's kinda hard to do a e2e tests with that amount of repositories)

Apart from testing with my test app, I also did test the change with 2 other apps, one with ~130 installs and one with ~350 installs. I also tweaked the unit test to find the matching installation on the second page.

chmouel commented 1 month ago

generally look good, i am fine merging this but i don't know if it actually works tho (since there is no e2e tests) what is the test strategy here?(altho i understand it's kinda hard to do a e2e tests with that amount of repositories)

Apart from testing with my test app, I also did test the change with 2 other apps, one with ~130 installs and one with ~350 installs. I also tweaked the unit test to find the matching installation on the second page.

great, let me know about the minor refactoring and it's GTG