Skip to content

fix: make default support links respect --docs-url #14176

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

bcpeinhardt
Copy link
Contributor

The default support links previously included a link to Coder's hosted docs, but did not respect the --docs-url deployment value. This meant that on the User Dropdown on the site, there was a link to docs that didn't respect the user's set --docs-url (which is not exactly a bug, but definitely confusing).

This PR updates the default support links to respect the --docs-url deployment value. If the value is not set, it will use the hosted coder docs url as before.

Copy link

alwaysmeticulous bot commented Aug 5, 2024

✅ Meticulous spotted zero visual differences across 1324 screens tested: view results.

Expected differences? Click here. Last updated for commit a756f3a. This comment will update as new commits are pushed.

@bcpeinhardt bcpeinhardt changed the title Make default support links respect --docs-url fix: make default support links respect --docs-url Aug 5, 2024
@bcpeinhardt bcpeinhardt enabled auto-merge (squash) August 7, 2024 17:42
@bcpeinhardt bcpeinhardt requested a review from kylecarbs August 8, 2024 12:47
{
func DefaultSupportLinks(docsURL string) []codersdk.LinkConfig {
if docsURL == "" {
docsURL = "https://coder.com/docs/{CODER_VERSION}"
Copy link
Member

Choose a reason for hiding this comment

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

You could use buildinfo.Version() instead so the frontend doesn't have to replace this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was taking a "do as the Romans do" approach and doing it the way the build info was done, but I agree with your comment below that we have this info on the backend so we might as well do it here.
Let me ping someone for context on why it's set up this way before falling into the classic "refactor and then realize why they did it the original way" trap and get back to you haha.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like we can just have the backend do this :)
https://codercom.slack.com/archives/CJURPL8DN/p1723126779529959

defaultSupportLinks := []codersdk.LinkConfig{
{
Name: "Report a bug",
Target: "https://github.com/coder/coder/issues/new?labels=needs+grooming&body={CODER_BUILD_INFO}",
Copy link
Member

Choose a reason for hiding this comment

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

I know you didn't introduce this, but I think we should be doing this replacement on the backend, not the frontend. We already should have this info anyways.

@bcpeinhardt bcpeinhardt requested a review from kylecarbs August 9, 2024 15:30
@bcpeinhardt
Copy link
Contributor Author

@kylecarbs do you mind re-reviewing when you get a chance?

Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

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

Nice and clean!

@bcpeinhardt bcpeinhardt merged commit 76722a7 into main Aug 12, 2024
30 of 32 checks passed
@bcpeinhardt bcpeinhardt deleted the bcpeinhardt/respect_docs_url_within_default_appearance_config branch August 12, 2024 21:01
@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 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.

3 participants