Skip to content

fix(e2e): correct team slugs for permission check#2625

Merged
zakisk merged 1 commit intotektoncd:mainfrom
zakisk:fix-team-names-in-permission-check
Mar 31, 2026
Merged

fix(e2e): correct team slugs for permission check#2625
zakisk merged 1 commit intotektoncd:mainfrom
zakisk:fix-team-names-in-permission-check

Conversation

@zakisk
Copy link
Copy Markdown
Member

@zakisk zakisk commented Mar 31, 2026

this corrects the team slugs env to check correct team in tektoncd to run e2e and adds check for member as well before it was only maintainers.

📝 Description of the Change

🔗 Linked GitHub Issue

Fixes #

🧪 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

this corrects the team slugs env to check correct
team in tektoncd to run e2e and adds check for member
as well before it was only maintainers.

Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
@zakisk zakisk requested a review from chmouel March 31, 2026 09:56
Copy link
Copy Markdown

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

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 modifies the .github/scripts/check-pr-permissions.js script to include explicit role checks for team members. The review feedback points out that these checks are redundant since an 'active' membership state already implies the specified roles. Furthermore, the reviewer noted that the changes do not address the intended goal of supporting cross-organization team checks, as the organization remains hardcoded to the repository owner.

Comment on lines +77 to +78
membership.data.state === "active" &&
(membership.data.role === "maintainer" || membership.data.role === "member")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The addition of the explicit role check is redundant because membership.data.state === 'active' already confirms the user is a member of the team (which, according to the GitHub API, must be either the 'member' or 'maintainer' role). The PR description's claim that it was 'only maintainers' before is incorrect based on the existing code.

Furthermore, the PR's stated goal of checking teams in the tektoncd organization is not addressed here. The script uses targetOrg (hardcoded to context.repo.owner at line 23), so it will only look for teams within the openshift-pipelines organization. To support teams from tektoncd, the organization handling logic needs to be updated to allow cross-org checks.

Suggested change
membership.data.state === "active" &&
(membership.data.role === "maintainer" || membership.data.role === "member")
membership.data.state === "active"
References
  1. Error messages and logs in scripts must be consistent with the actual data being processed.

@chmouel
Copy link
Copy Markdown
Member

chmouel commented Mar 31, 2026

/lgtm

Copy link
Copy Markdown

@pipelines-as-code pipelines-as-code bot left a comment

Choose a reason for hiding this comment

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

Congrats @zakisk your PR Has been approved 🎉

✅ Pull Request Approved

Approval Status:

  • Required Approvals: 1
  • Current Approvals: 1

👥 Reviewers Who Approved:

Reviewer Permission Level Approval Status
@chmouel admin

📝 Next Steps

  • Ensure all required checks pass
  • Comply with branch protection rules
  • Request a maintainer to merge using the /merge command (or merge it
    directly if you have repository permission).

Automated by the PAC Boussole 🧭

@zakisk zakisk merged commit 1ce8d6f into tektoncd:main Mar 31, 2026
22 of 23 checks passed
@zakisk zakisk deleted the fix-team-names-in-permission-check branch March 31, 2026 10:29
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.

2 participants