feat: add LinkVulnerabilityToMergeRequest tool
What does this merge request do and why?
Adds LinkVulnerabilityToMergeRequest tool to agentic chat
Screenshots
How to set up and validate locally
- You'll need a project in the
gitlab-duo
group that has vulnerabilities. You can seed an existing project with the following:bin/rake 'gitlab:seed:vulnerabilities[gitlab-duo/<your-project>]'
- Visit vulnerability report such as
http://127.0.0.1:3000/gitlab-duo/<your-project>/-/security/vulnerability_report
to verify that there are vulnerabilities - Get the ID of one of the vulnerabilities in the list. You can copy this from the URL of one of the vulnerability detail pages.
- Open a merge request on that same project.
- In duo agentic chat for the project, ask the following:
Can you give me a list of the open MRs for this project?
- Duo will give you a list of the open MRs, which will include the MR IID
- Ask duo to link the MR to the vulnerability:
Can you link MR <MR IID> to vulnerability <vulnerability ID>
- Verify that Duo uses the correct tool and uses the MR ID (instead of the IID you gave it).
- Approve the tool and verify that it succeeds
- Go to the vulnerability details page for the vulnerability you linked and verify that the MR shows up in the description.
Merge request checklist
-
Tests added for new functionality. If not, please raise an issue to follow up. -
Documentation added/updated, if needed. -
If this change requires executor implementation: verified that issues/MRs exist for both Go executor and Node executor or confirmed that changes are backward-compatible and don't break existing executor functionality.
Edited by Scott Hampton