Skip to content

Conversation

chmouel
Copy link
Member

@chmouel chmouel commented Oct 10, 2025

📝 Description of the Change

Previously, the GitLab provider only checked the top-level comment of a discussion for the /ok-to-test command. This limited where the command could be effectively used. The /ok-to-test command is now recognized when posted as a reply within a merge request discussion thread. An E2E test was added to verify this behavior, and the README.md was updated to reflect the new capability.

👨🏻‍ Linked Jira

Jira: https://issues.redhat.com/browse/SRVKP-8324

🔗 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

@Copilot Copilot AI review requested due to automatic review settings October 10, 2025 10:13
Copy link

Summary of Changes

Hello @chmouel, 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 introduces a significant improvement to the GitLab provider by enabling the /ok-to-test command to be processed from replies within merge request discussion threads. This change enhances the flexibility and integration of GitOps workflows within GitLab, allowing for more natural and contextual command usage. The update includes modifications to the ACL logic, new testing utilities, and a dedicated E2E test to ensure robust functionality.

Highlights

  • GitLab /ok-to-test Command Enhancement: The GitLab provider now recognizes the /ok-to-test command when it is posted as a reply within a merge request discussion thread, expanding its usability beyond top-level comments.
  • New End-to-End Test: An end-to-end test has been added to specifically verify that the /ok-to-test command functions correctly when used in discussion thread replies.
  • Documentation Update: The README.md file for the GitLab provider has been updated to reflect this new capability, removing the previous limitation note.
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 pipelines-as-code bot added e2e feature New feature or request gitlab labels Oct 10, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the GitLab provider to honor /ok-to-test commands when posted as replies within merge request discussion threads, rather than only checking top-level comments.

  • Added support for processing /ok-to-test commands in thread replies
  • Enhanced ACL checking to iterate through all notes in discussion threads
  • Added comprehensive E2E testing for the new functionality

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/provider/gitlab/acl.go Modified ACL logic to check all notes in discussion threads instead of only the first note
pkg/provider/gitlab/acl_test.go Added test case to verify /ok-to-test works in thread replies
pkg/provider/gitlab/test/test.go Added helper function to simulate discussion threads with replies
test/gitlab_oktotest_thread_reply_test.go Added E2E test to verify the new thread reply functionality
pkg/provider/gitlab/README.md Removed documentation note about thread comments not being supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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

The pull request enhances the GitLab provider to recognize the /ok-to-test command when posted as a reply within a merge request discussion thread. An E2E test was added to verify this behavior, and the README.md was updated to reflect the new capability. The code changes primarily involve modifying the acl.go file to iterate through all notes in a discussion thread, adding a new test case in acl_test.go to verify the new functionality, and creating a new E2E test file gitlab_oktotest_thread_reply_test.go.

Previously, the GitLab provider only checked the top-level comment of a
discussion for the `/ok-to-test` command. This limited where the command
could be effectively used. The `/ok-to-test` command is now recognized
when posted as a reply within a merge request discussion thread.
An E2E test was added to verify this behavior, and the `README.md` was
updated to reflect the new capability.

Jira: https://issues.redhat.com/browse/SRVKP-8324

Co-authored-by: Gemini <[email protected]>
Signed-off-by: Chmouel Boudjnah <[email protected]>
@chmouel chmouel force-pushed the SRVKP-8324-feat-gitlab-honor-ok-to-test-in-thread-replies-and branch from e579cdc to d8d9ffa Compare October 10, 2025 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e feature New feature or request gitlab

Development

Successfully merging this pull request may close these issues.

1 participant