Skip to content

fix(github): use provided target ref in GetFileInsideRepo#2696

Merged
zakisk merged 1 commit into
tektoncd:mainfrom
theakshaypant:fix/github-acl-owners-file-fetching
Apr 27, 2026
Merged

fix(github): use provided target ref in GetFileInsideRepo#2696
zakisk merged 1 commit into
tektoncd:mainfrom
theakshaypant:fix/github-acl-owners-file-fetching

Conversation

@theakshaypant

@theakshaypant theakshaypant commented Apr 21, 2026

Copy link
Copy Markdown
Member

📝 Description of the Change

GetFileInsideRepo ignored the caller-supplied target ref and substituted runevent.BaseBranch. This caused OWNERS ACL checks to read from the wrong branch when a PR targets a non-default branch, and remote task fetches to resolve against the PR base instead of the specified ref.

🔗 Linked GitHub Issue

N/A

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

🤖 AI Assistance

AI assistance can be used for various tasks, such as code generation,
documentation, or testing.

Please indicate whether you have used AI assistance
for this PR and provide details if applicable.

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

Important

Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.

If the majority of the code in this PR was generated by an AI, please add a Co-authored-by trailer to your commit message.
For example:

Co-authored-by: Claude noreply@anthropic.com

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

@theakshaypant theakshaypant marked this pull request as ready for review April 21, 2026 03:21

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the GetFileInsideRepo function in the GitHub provider to correctly use the provided target parameter as the reference when it is not empty, instead of defaulting to the base branch. I have no feedback to provide.

@zakisk zakisk force-pushed the fix/github-acl-owners-file-fetching branch from 654ef3b to 0036cd9 Compare April 21, 2026 09:41
@codecov-commenter

codecov-commenter commented Apr 21, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.02%. Comparing base (5c09648) to head (fcb2f52).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2696      +/-   ##
==========================================
+ Coverage   59.01%   59.02%   +0.01%     
==========================================
  Files         208      208              
  Lines       20452    20452              
==========================================
+ Hits        12069    12072       +3     
+ Misses       7609     7607       -2     
+ Partials      774      773       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@theakshaypant

Copy link
Copy Markdown
Member Author

Should be cherry-picked to release-v0.42.x as well.

@zakisk

zakisk commented Apr 21, 2026

Copy link
Copy Markdown
Member

Should be cherry-picked to release-v0.42.x as well.

why? is it asked by anyone?

@zakisk

zakisk commented Apr 21, 2026

Copy link
Copy Markdown
Member

also can you please add unit tests?

@theakshaypant theakshaypant force-pushed the fix/github-acl-owners-file-fetching branch from 0036cd9 to 20a9738 Compare April 21, 2026 10:43
@theakshaypant

Copy link
Copy Markdown
Member Author

also can you please add unit tests?

Added unit tests for the changes in 20a9738

Should be cherry-picked to release-v0.42.x as well.

why? is it asked by anyone?

We can discuss this offline.

GetFileInsideRepo ignored the caller-supplied target ref and
substituted runevent.BaseBranch. This caused OWNERS ACL checks
to read from the wrong branch when a PR targets a non-default
branch, and remote task fetches to resolve against the PR base
instead of the specified ref.

Signed-off-by: Akshay Pant <akpant@redhat.com>
@zakisk zakisk force-pushed the fix/github-acl-owners-file-fetching branch from 05d10ae to fcb2f52 Compare April 24, 2026 10:13
@zakisk zakisk merged commit 47ee286 into tektoncd:main Apr 27, 2026
19 of 23 checks passed
@theakshaypant theakshaypant deleted the fix/github-acl-owners-file-fetching branch April 27, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants