posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.83k stars 91 forks source link

improve Run App url matching and fix preview timeout issue #5349

Closed sharon-wang closed 1 week ago

sharon-wang commented 1 week ago

Cherry-picks https://github.com/posit-dev/positron/pull/5336 to bring the fix from the 2024.11 patch branch to the main branch. The below description is copied from #5336 and modified to remove the AppUrlString type changes.

The prerelease branch will need to be updated again to include the additional changes.

Addresses

Implementation Notes

URL Matching

Shell Integration Warning Message

This PR should also fix a timing issue where the didPreviewUrlTimeout would time out before terminalOutputTimeout, causing the shell integration warning message to show. We now set didPreviewUrlTimeout to be 5 seconds longer than terminalOutputTimeout, so that it doesn't timeout before the app preview is done.

QA Notes

This PR fixes Run App in Terminal url detection for non-local URLs. One way to get a non-local url is by running the shiny-py-example in Positron on Workbench (see https://github.com/posit-dev/positron/issues/5197).

Other app types like Dash, Streamlit, Fastapi, Flask and Gradio should continue to work on Desktop, Server Web and Positron on Workbench.

This PR should also fix the issue seen in #5306, which can be tested by running the Dash Py Example several times to check that the issue does not occur.

sharon-wang commented 1 week ago

I'm realizing that the Python CI tasks don't run in the other branches, so I missed the prettier formatting checks in the patch branch PR. I opened https://github.com/posit-dev/positron/pull/5352 to add the prerelease branches to the PR CI workflow.

The version of prettier used in the Python extension doesn't support string template types :( Instead of upgrading prettier, which results in a bunch of formatting fixes across multiple files, I've removed the string template type.

I'll need to backport any fixes here to the patch branch.

Full test suite run: https://github.com/posit-dev/positron/actions/runs/11821745434