GoogleCloudPlatform / cloud-code-vscode

Cloud Code for Visual Studio Code: Issues, Documentation and more
Other
416 stars 111 forks source link

build.jibGradle.project not specified in the configuration 'Cloud Run: Run/Debug Locally' in .vscode/launch.json #775

Open postngsb opened 1 year ago

postngsb commented 1 year ago

Environment: (Hint: "Report Extension Issue on Github" command will fill these out for you.)

MacOS, VSCode Version information

Cloud Code Extension version: v1.21.5 VSCode version: 1.77.3 (Universal) OS:

Cloud SDK:

Skaffold:

Kubectl:

Description:

I tried to use Cloud Code for Spring Boot project generated from https://start.spring.io/ with Gradle-Groovy

The project only has one rootProject.

launch.json generated "Cloud Code: Run on Cloud Run Emulater" has the following error:

build.jibGradle.project not specified in the configuration 'Cloud Run: Run/Debug Locally' in .vscode/launch.json

I tried to provide a project field with the rootProject name of 'hello-world' or ".", or literal "rootProject", none of them works.

Sample errors like:

Can build.jibGradle.project be optional ? How to specify it for rootProject-only project?

Repro step:

davidponder commented 1 year ago

Hello!

Thank you for filing this issue; we will take a look on our end and reach out as needed!

Thanks!

SKrupa commented 1 year ago

Hi @postngsb, could you share the dockerfile you're using for this as well as the cloudcode.cloudrun config that got generated in launch.json? rootProject shouldn't be set via that config, so I'm curious where that is coming from. Thanks!

postngsb commented 1 year ago

HI @SKrupa This issue is about Jib, no Dockerfile is required.

In the launch.json:

      "build": {
        "jibGradle": {
          "project": "?",
          "path": "build.gradle"
        }
      },

The error message indicates the project field must be a gradle rootProject. It better to support a gradle project also. Many Cloud Run services based on Spring Boot are single project (no rootProject) Thanks!

SKrupa commented 1 year ago

It looks like this is not supported by the extension at this time, you currently need a subproject within your root project you can point to. I've added a feature request for this to remove this requirement as it shouldn't be necessary to have a subproject.