Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add troubleshooting link to documentation when publish/failure occurs #2546

Merged
merged 7 commits into from
Jan 22, 2025

Conversation

dotNomad
Copy link
Collaborator

This PR adds:

  • a new Troubleshooting document linked from our docs/index.md
    • The start of this document includes information for how to address the "Unrecognized app mode" error during deployment.
  • a change to the window.showErrorMessage call on publish/failure to include a new "See Troubleshooting docs for help."
    • The Troubleshooting docs text will link to the new troubleshooting document.
Preview

CleanShot 2025-01-21 at 18 42 50

Intent

Resolves #2476

Type of Change

    • Bug Fix
    • New Feature
    • Breaking Change
    • Documentation
    • Refactor
    • Tooling

Approach

I only included the troubleshooting link at our window.showErrorMessage call from publish/failure as opposed to always showing the Troubleshooting link because the only content in our troubleshooting doc has to do with publish failure.

As we add more to the document we can easily replace window.showErrorMessage usage with usage of the new showErrorMessageWithTroubleshoot helper I created here.

I can change this based on feedback on this PR.

User Impact

Users will now see a handy Troubleshoot docs link when deploying to a Connect server without Gradio support - and really for any publish/failure error message they receive.

Directions for Reviewers

The easiest way I found to test this is to change our two schemas to support a type that is not supported like "nonsense".

Then use that in a configuration file and attempt to deploy - leading to the error notification above. Note that the app mode isn't listed. That is due to #2542

@dotNomad dotNomad requested a review from m-- January 22, 2025 02:50
@dotNomad dotNomad changed the title Dotnomad/troubleshooting link Add troubleshooting link to documentation when publish/failure occurs Jan 22, 2025
Comment on lines 11 to 47
It is likely due to Posit Connect, on the server you are deploying to, being
older than the version that introduced support for the `type` set in your
configuration file.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is good, but we should have a section above it with other common type mismatches. This is definitely one possible one — and folks who use our inspection is only one of two possible situations they could get themselves into, but there is also the possibility that someone edited the config file to put some other type that's unknown.

I would structure it like this:

There's an issue with the type ...

Unknown / unset type

In this scenario you will need to find the type and set it...

Using a type that isn't supported by your server

Connect might be out of date ...

A typo in type

If you hand edited the configuration file, you might have had a typo in the type field. Check that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is good, but we should have a section above it with other common type mismatches.

Thank you, and fantastic idea. I added two more sections in 0a100d6

I kept the organization of

### Errors

> Exact error text

#### Solutions

let me know if you think that is working well.

The two sections I added capture:

  • The "Failed to deploy. The Configuration has a schema error" which occurs when there is a typo, missing section (like no [python] section when the Configuration is set to type = "python-fastapi" for example), or incorrect values
  • A new solution section under "Unrecognized app mode" when using type = 'unknown'

Copy link
Collaborator

@marcosnav marcosnav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from Jon suggestions, looks good to me 👍

docs/troubleshooting.md Outdated Show resolved Hide resolved
extensions/vscode/src/utils/window.ts Show resolved Hide resolved
Copy link
Collaborator

@sagerb sagerb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jon's recommendations make sense to me.

Base automatically changed from dotnomad/gradio to main January 22, 2025 18:54
@dotNomad dotNomad force-pushed the dotnomad/troubleshooting-link branch from d378c81 to 0a100d6 Compare January 22, 2025 21:53
@dotNomad dotNomad requested review from sagerb and jonkeane January 22, 2025 21:55
Copy link
Collaborator

@jonkeane jonkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for this!

docs/troubleshooting.md Outdated Show resolved Hide resolved
@dotNomad dotNomad force-pushed the dotnomad/troubleshooting-link branch from e9be268 to c4c8573 Compare January 22, 2025 23:40
Copy link
Collaborator

@sagerb sagerb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great to me.

@dotNomad dotNomad merged commit 00b9a5d into main Jan 22, 2025
14 checks passed
@dotNomad dotNomad deleted the dotnomad/troubleshooting-link branch January 22, 2025 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle deploying to a Connect server without Gradio support
4 participants