feat: Pre-flight validate the entrypoint file exists#3395
feat: Pre-flight validate the entrypoint file exists#3395
Conversation
|
I'm a soft -1 on making this change be a hard-stop error for two reasons (1) we don't have an actionable way for someone to resolve this (2) if we get any of the detection wrong, we prevent people from deploying. While these deployments aren't in a good state, they do actually function (e.g. if you have a static website that you send up, say that As for (2):
But even without doing a check for a 2XX, we could make this be a warning (or even an error) at the end of the deploy rather than forcing a positive stop in the deploy process. That way someone has a way out of this and aren't stuck. as for (1): |
|
Thinking through your feedback @jonkeane On point 1Great points. Do you think its beneficial to use all the same tooling here to warn (rather than fail) that the On point 2
We left We should be able to use the Content configuration to determine its type and have additional logic if its static since that should always be a 2xx response (if valid). Thanks for re-upping that comment publisher/internal/clients/connect/client_connect.go Lines 478 to 499 in 785e085 |
Yeah, that would be fine. We still have the problem of "if the entrypoint field is wrong how are you going to fix it" but at least it doesn't prevent someone for using the publisher entirely.
This might actually be FUD/YAGNI actually. For Plumber, FastAPI, and FlaskAPIs connect will actually redirect / check for docs paths in order for
|
6b9d065 to
44ccd36
Compare
Adds a pre-flight check to validate that the entrypoint file, specified in the configuration, exists prior to deploying to Connect.
Intent
Resolves #2964
Type of Change
Approach
Added
checkEntrypointvalidation alongside where we docheckRequirementsFile.It does skip validation on any module references, which happens with Shiny Express. The entrypoint looks like
shiny.express.app:app_2e_pyin that case so entrypoints containing:are skipped.I skipped them rather than attempting to see if that file exists or refactoring the order in which we swap out the
EntrypointFile. To swap in the module reference for Shiny Express, the file has to be read - so we know it exists already.User Impact
Users will now receive an immediate, clear error message when attempting to deploy with a missing entrypoint file, rather than having the deployment fail on the server.
Automated Tests
Unit tests were added for the new functionality 🎉
Directions for Reviewers
Checklist