Use more suitable completion prompt
What does this MR do and why?
This prompt is more likely to produce a valid response since it is more typical code.
Fixes #424293 (closed)
Test results
Run from my machine against gitlab.com
I cut most of the log messages so it just shows the test ran successfully
bundle exec bin/qa Test::Instance::All https://gitlab.com qa/specs/features/ee/api/14_model_ops/code_suggestions_spec.rb
==> Base URL: https://gitlab.com
ModelOps
Code Suggestions
on the GitLab API with PAT auth
returns a suggestion
Finished in 0.98961 seconds (files took 3.83 seconds to load)
1 example, 0 failures
Run from my machine against staging.gitlab.com
I cut most of the log messages so it just shows the test ran successfully
bundle exec bin/qa Test::Instance::All https://staging.gitlab.com qa/specs/features/ee/api/14_model_ops/code_suggestions_spec.rb
==> Base URL: https://staging.gitlab.com
ModelOps
Code Suggestions
on the GitLab API with PAT auth
returns a suggestion
Finished in 2.47 seconds (files took 2.64 seconds to load)
1 example, 0 failures
How to set up and validate locally
You can run the tests against staging.gitlab.com using the gitlab-qa
user as the tests do, or by using your own user. If you use gitlab-qa
you can skip below to running the tests, otherwise enable the Code Suggestions user preference (see https://docs.gitlab.com/ee/user/project/repository/code_suggestions.html#enable-code-suggestions-for-an-individual-user)
To run the tests, from the qa
directory:
export GITLAB_USERNAME=gitlab-qa # or your own username if you have Code Suggestions enabled in your preferences and via the feature flag
export GITLAB_QA_ACCESS_TOKEN=<from 1Password> # or your own access token
export GITLAB_QA_USER_AGENT=<from 1Password>
bundle install
bundle exec bin/qa Test::Instance::All https://staging.gitlab.com qa/specs/features/ee/api/14_model_ops/code_suggestions_spec.rb
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.