Skip to content

Conversation

@zakisk
Copy link
Contributor

@zakisk zakisk commented Oct 28, 2025

When the skip-pr-commits setting is enabled, the system skips push events for commits that are part of an open pull request to avoid duplicate pipeline runs. However, this should not apply to tag push events, as tags represent important release points that should always trigger pipelines regardless of PR status.

Changes:

  • Detect tag push events by checking if ref starts with "refs/tags/"
  • Exclude tag push events from skip logic even when skip-pr-commits setting is enabled
  • Add test case verifying tag push events are not skipped
  • Add test case verifying regular push events are still skipped when commit is part of a PR

This ensures that tagging a commit (e.g., for releases) always triggers the associated pipeline runs, while still avoiding duplicate runs for regular branch commits that are part of pull requests.

📝 Description of the Change

👨🏻‍ Linked Jira

https://issues.redhat.com/browse/SRVKP-9111

🔗 Linked GitHub Issue

Fixes #

🚀 Type of Change

  • 🐛 Bug fix (fix:)
  • ✨ New feature (feat:)
  • 💥 Breaking change (feat!:, fix!:)
  • 📚 Documentation update (docs:)
  • ⚙️ Chore (chore:)
  • 💅 Refactor (refactor:)
  • 🔧 Enhancement (enhance:)
  • 📦 Dependency update (deps:)

🧪 Testing Strategy

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

🤖 AI Assistance

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

If you have used AI assistance, please provide the following details:

Which LLM was used?

  • GitHub Copilot
  • ChatGPT (OpenAI)
  • Claude (Anthropic)
  • Cursor
  • Gemini (Google)
  • Other: ____________

Extent of AI Assistance:

  • Documentation and research only
  • Unit tests or E2E tests only
  • Code generation (parts of the code)
  • Full code generation (most of the PR)
  • PR description and comments
  • Commit message(s)

Important

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: Gemini [email protected]
Co-authored-by: ChatGPT [email protected]
Co-authored-by: Claude [email protected]
Co-authored-by: Cursor [email protected]
Co-authored-by: Copilot [email protected]

**💡You can use the script ./hack/add-llm-coauthor.sh to automatically add
these co-author trailers to your commits.

✅ 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

@gemini-code-assist
Copy link

Summary of Changes

Hello @zakisk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the behavior of the skip-pr-commits setting to prevent unintended pipeline skips for tag push events. Previously, if a commit was part of an open pull request and skip-pr-commits was enabled, its associated push event would be skipped. This change introduces an exception for tags, ensuring that critical release-related pipelines are always triggered when a tag is pushed, thereby improving the reliability of release workflows without compromising the efficiency benefits for standard development branches.

Highlights

  • Exclude Tag Push Events: The system will now exclude tag push events from the skip-pr-commits logic, ensuring that pipelines are always triggered for tags, regardless of whether the associated commit is part of an open pull request.
  • Tag Detection Logic: A new check has been implemented to detect tag push events by verifying if the Git reference starts with 'refs/tags/'.
  • New Test Cases: Added comprehensive unit tests to confirm that tag push events are not skipped, while regular push events for commits part of an open PR are still correctly skipped when the skip-pr-commits setting is enabled.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pipelines-as-code
Copy link

pipelines-as-code bot commented Oct 28, 2025

🔍 PR Lint Feedback

Note: This automated check helps ensure your PR follows our contribution guidelines.

⚠️ Items that need attention:

🤖 AI attribution

The following commits lack an explicit AI attribution footer:

  • 0b3f1e9 feat: Exclude tag push events from skip-pr-commits logic

If no AI assistance was used for a commit, you can ignore this warning.
Otherwise add an Assisted-by: or Co-authored-by: footer referencing the AI used.


ℹ️ Next Steps

  • Review and address the items above
  • Push new commits to update this PR
  • This comment will be automatically updated when issues are resolved
🔧 Admin Tools (click to expand)

Automated Issue/Ticket Creation:

  • /issue-create - Generate a GitHub issue from this PR content using AI
  • /jira-create - Create a SRVKP Jira ticket from this PR content using AI

⚠️ Important: Always review and edit generated content before finalizing tickets/issues.
The AI-generated content should be used as a starting point and may need adjustments.

These commands are available to maintainers and will post the generated content as PR comments for review.

🤖 This feedback was generated automatically by the PR CI system

@pipelines-as-code pipelines-as-code bot added feature New feature or request github testing labels Oct 28, 2025
Copy link

@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 correctly implements the feature to exclude tag push events from the skip-pr-commits logic. The changes are straightforward and the added tests cover the new functionality. I've added a few suggestions to improve maintainability and strengthen the tests. Overall, great work!

@zakisk zakisk force-pushed the SRVKP-9111-ignore-tag-push-events-in-skip-push branch 4 times, most recently from 40226fc to b046d1e Compare October 29, 2025 05:11
@zakisk
Copy link
Contributor Author

zakisk commented Oct 29, 2025

/gemini review

Copy link

@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 correctly implements the feature to exclude tag push events from the skip-pr-commits logic, ensuring that release tags always trigger pipelines. The implementation in pkg/provider/github/parse_payload.go is clear and effective. The documentation in docs/content/docs/install/settings.md is updated accordingly, and the new test cases in pkg/provider/github/parse_payload_test.go properly cover the new behavior. I have one minor suggestion to improve the clarity of a test case name for better maintainability.

@zakisk zakisk force-pushed the SRVKP-9111-ignore-tag-push-events-in-skip-push branch from b046d1e to 73ef4af Compare October 29, 2025 10:11
@chmouel
Copy link
Member

chmouel commented Oct 31, 2025

This sounds good to me but really need a E2E, would you have time to do this before release next week or we could add a jira ticket to track this for next

@zakisk zakisk force-pushed the SRVKP-9111-ignore-tag-push-events-in-skip-push branch from 73ef4af to 23a4226 Compare November 3, 2025 05:34
@zakisk
Copy link
Contributor Author

zakisk commented Nov 3, 2025

This sounds good to me but really need a E2E, would you have time to do this before release next week or we could add a jira ticket to track this for next

added E2E test

@zakisk zakisk force-pushed the SRVKP-9111-ignore-tag-push-events-in-skip-push branch from 23a4226 to b48c7a4 Compare November 3, 2025 07:05
When the skip-pr-commits setting is enabled, the system skips push
events for commits that are part of an open pull request to avoid
duplicate pipeline runs. However, this should not apply to tag push
events, as tags represent important release points that should always
trigger pipelines regardless of PR status.

Changes:
- Detect tag push events by checking if ref starts with "refs/tags/"
- Exclude tag push events from skip logic even when
  skip-pr-commits setting is enabled
- Add test case verifying tag push events are not skipped
- Add test case verifying regular push events are still skipped when
  commit is part of a PR

This ensures that tagging a commit (e.g., for releases) always
triggers the associated pipeline runs, while still avoiding duplicate
runs for regular branch commits that are part of pull requests.

Signed-off-by: Zaki Shaikh <[email protected]>
@zakisk zakisk force-pushed the SRVKP-9111-ignore-tag-push-events-in-skip-push branch from b48c7a4 to 0b3f1e9 Compare November 4, 2025 06:20
@chmouel chmouel merged commit b4d37f6 into openshift-pipelines:main Nov 4, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request github testing

Development

Successfully merging this pull request may close these issues.

2 participants