Use selected text in base prompt if present
What does this MR do and why?
When user selects some code, it makes sense to include this in the prompt (and prefer over blob from referrer).
Related to #431359 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- In rails console enable code_tasks
Feature.enable(:code_tasks)
- Open gitlab duo chat UI
- In a separate browser tab open graphql-explorer and send message request below:
mutation {
aiAction(input: {chat: {content: "Refactor selected code", currentFile: {
fileName: "test.py",
selectedText: "
def extract
lines = content.to_s.lines
comment_block = []
trimmed_lines = 0
end
",
contentAboveCursor: "
module CodeSuggestions
class InstructionsExtractor
EMPTY_LINES_LIMIT = 1
MIN_LINES_OF_CODE = 5
",
}}}) {
clientMutationId
errors
}
}
- check in chat UI that an answer relevant to the selected text is returned
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
changed milestone to %16.6
added Category:Code Suggestions backend groupcode creation labels
assigned to @jprovaznik
added devopscreate sectiondev labels
1 Warning featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.
For more information, see:
- The Handbook page on merge request types.
- The definition of done documentation.
1 Message CHANGELOG missing: If this merge request needs a changelog entry, add the
Changelog
trailer to the commit message you want to add to the changelog.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend @thutterer
(UTC+1, same timezone as author)
@engwan
(UTC+8, 7 hours ahead of author)
Please check reviewer's status!
Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger- Resolved by Gosia Ksionek
- Resolved by 🤖 GitLab Bot 🤖
Proper labels assigned to this merge request. Please ignore me.
@jprovaznik - please see the following guidance and update this merge request.1 Error Please add typebug typefeature, or typemaintenance label to this merge request. Edited by 🤖 GitLab Bot 🤖
Allure report
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for 3d67c48cexpand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Plan | 55 | 0 | 0 | 0 | 55 | ✅ | | Verify | 32 | 0 | 0 | 0 | 32 | ✅ | | Govern | 48 | 0 | 0 | 0 | 48 | ✅ | | Monitor | 4 | 0 | 0 | 0 | 4 | ✅ | | Create | 40 | 0 | 7 | 0 | 47 | ✅ | | Data Stores | 22 | 0 | 0 | 0 | 22 | ✅ | | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | | Package | 0 | 0 | 1 | 0 | 1 | ➖ | | Manage | 0 | 0 | 1 | 0 | 1 | ➖ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 201 | 0 | 10 | 0 | 211 | ✅ | +------------------+--------+--------+---------+-------+-------+--------+
e2e-package-and-test:
test report for 3d67c48cexpand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Create | 539 | 0 | 88 | 0 | 627 | ✅ | | Govern | 6 | 0 | 0 | 0 | 6 | ✅ | | Monitor | 8 | 0 | 0 | 0 | 8 | ✅ | | Framework sanity | 0 | 0 | 2 | 0 | 2 | ➖ | | Plan | 8 | 0 | 0 | 0 | 8 | ✅ | | Data Stores | 4 | 0 | 0 | 0 | 4 | ✅ | | Package | 0 | 0 | 2 | 0 | 2 | ➖ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 565 | 0 | 92 | 0 | 657 | ✅ | +------------------+--------+--------+---------+-------+-------+--------+
added featureaddition label
added typefeature label
added 195 commits
-
102a1802...fba3d2a0 - 194 commits from branch
master
- c819fa71 - Use selected text in base prompt if present
-
102a1802...fba3d2a0 - 194 commits from branch
- Resolved by Gosia Ksionek
@nicolasdular could you please review?
requested review from @nicolasdular
- Resolved by Gosia Ksionek
- Resolved by Gosia Ksionek
@nicolasdular
, thanks for approving this merge request.This is the first time the merge request has been approved. To ensure we don't only run predictive pipelines, and we don't break
master
, a new pipeline will be started shortly.Please wait for the pipeline to start before resolving this discussion and set auto-merge for the new pipeline. See merging a merge request for more details.
added pipeline:mr-approved label
requested review from @mksionek
mentioned in commit 9cdc7b76
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added releasedcandidate label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label