Skip to content

Web IDE don't pass project url with code suggestions requests

Summary

The web IDE don't seem to send then project path when making an code suggestion request to rails.

Steps to reproduce

  • Make sure your project/group has duo enabled
  • Make you can binding.pry with this command gdk stop rails-web && GITLAB_RAILS_RACK_TIMEOUT_ENABLE_LOGGING=false PUMA_SINGLE_MODE=true gdk rails s
  • add binding.pry under this line
  • Open your webIDE in your duo enabled project and trigger code suggestion (a completion or a generation)
  • In your console running rails you should be in pry mode:
From: /Users/patjes-gitlab/Desktop/main/gdk/gitlab/ee/lib/code_suggestions/task_factory.rb:27 CodeSuggestions::TaskFactory#task:

    19: def task
    20:   trim_context!
    21:
    22:   instruction = extract_instruction(CodeSuggestions::FileContent.new(language, content_above_cursor,
    23:     content_below_cursor))
    24:
    25:   binding.pry
    26:
 => 27:   return code_completion_task unless instruction
    28:
    29:   code_generation_task(instruction)
    30: end

[1] pry(#<CodeSuggestions::TaskFactory>)>

Inspect the project variable and it should be nil. params[:project_path] is null as well eventhough the web IDE should be aware of the project.

Example Project

What is the current bug behavior?

It doesn't send the project path with the code suggestion request.

What is the expected correct behavior?

It should send the project path because it's aware of it.

Relevant logs and/or screenshots

Screenshot_2025-05-27_at_09.31.14

Screenshot_2025-05-27_at_09.31.02

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.