Skip to content

fix: make cli respect deployment --docs-url #14568

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

Merged

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Sep 5, 2024

With #14548, it's a lot more likely for a user to see a documentation link when using the CLI.

Assuming admins of airgapped Coder deployments aren't giving regular users permission to view the deployment config, we'll need to make the docs URL available on the more permissive /appearance endpoint.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ethanndickson and the rest of your teammates on Graphite Graphite

@ethanndickson ethanndickson marked this pull request as ready for review September 5, 2024 06:38
@ethanndickson ethanndickson force-pushed the 09-05-fix_make_cli_respect_deployment_--docs-url branch from 3ac949f to 75cd7be Compare September 10, 2024 05:38
@ethanndickson
Copy link
Member Author

(No changes in previous push, just rebase)

@ethanndickson ethanndickson force-pushed the 09-05-fix_make_cli_respect_deployment_--docs-url branch from 75cd7be to 1c80204 Compare September 10, 2024 05:41
@ethanndickson
Copy link
Member Author

If we're going to fetch the deployment config on startup, I think making it optional middlware, instead of making it part of say, initClient is better - no CLI command has needed anything from the deployment config up until now.

@ethanndickson
Copy link
Member Author

I only just noticed these tests failed, because viewing deployment config is restricted - I still think just having a docsURL function that fetches and otherwise defaults to the main docs is the best way to do this.

@ethanndickson ethanndickson force-pushed the 09-05-fix_make_cli_respect_deployment_--docs-url branch from 1c80204 to 87ea95c Compare September 12, 2024 13:41
@ethanndickson
Copy link
Member Author

ethanndickson commented Sep 12, 2024

Nah, I had to rethink it all - most admins are probably not giving regular users permissions to view the deployment config, so it needs to be included on /appearance, enterprise only, but presumably they're the only ones using offline docs. Basically a new PR altogether, so ignore the force push diff :D

I think I've missed a few doc links, so I'll get to those next

@ethanndickson ethanndickson force-pushed the 09-05-fix_make_cli_respect_deployment_--docs-url branch 2 times, most recently from 24a9a36 to 4c276e6 Compare September 13, 2024 06:33
@ethanndickson
Copy link
Member Author

This approach is definitely better, but since opening this PR we've added a docs link to a help command. We can't plumb the fetched appearance config there (nor would we want to do a fetch before a help command), so I'm not totally sure what to do about that. It would be nice if we could just an additional field to a local config, but the cli stores session and url as whole files, and it feels a bit ridiculous to add a new file just for the docs url.

@ethanndickson ethanndickson force-pushed the 09-05-fix_make_cli_respect_deployment_--docs-url branch 2 times, most recently from c9e34ea to 5bfb3ad Compare September 18, 2024 08:47
@ethanndickson ethanndickson force-pushed the 09-05-fix_make_cli_respect_deployment_--docs-url branch from 5bfb3ad to 57a7f5c Compare September 18, 2024 11:32
@ethanndickson ethanndickson merged commit 37885e2 into main Sep 18, 2024
29 of 31 checks passed
@ethanndickson ethanndickson deleted the 09-05-fix_make_cli_respect_deployment_--docs-url branch September 18, 2024 11:47
@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants