posit-dev / publisher

MIT License
3 stars 0 forks source link

When Deployments have an unexpected name we throw an error #2136

Closed kgartland-rstudio closed 2 weeks ago

kgartland-rstudio commented 4 weeks ago

When running the bats tests locally I ran into this. We deploy each content and give the deployment a name (ci-deploy.toml). Each deployment succeeds in the CLI but having the extension opened at the same time, I see these errors continually occur:

Unable to retrieve deployment record: An error has occurred at getSelectedContentRecord, contentRecords.get, StatusText=Not Found, Code=ERR_BAD_REQUEST, Msg=project directory not found , URL=http://localhost:61532/api/get/deployments/deployment-1

https://github.com/user-attachments/assets/084b3e33-b0fb-444b-992d-d9d55cd67704

The errors also occur when I don't have the Publisher opened at the time. I'm not sure if this is expected behavior or not.

dotNomad commented 3 weeks ago

The error you are getting here occurs when the dir passed to the API doesn't exist: https://github.com/posit-dev/publisher/blob/e339ab34a4ecff55bd87eae19a0bda71ef38030f/internal/services/api/api_helpers.go#L66

I'm able to rename the deployments locally just fine (including using the name ci-deploy.toml. I may need more information for when these occurring (like what code the tests are running) and what the environment setup is like.

kgartland-rstudio commented 2 weeks ago

Closing, can no longer reproduce.