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

docs: api root, buildinfo, csp #5493

Merged
merged 31 commits into from
Dec 22, 2022
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Dec 21, 2022

Related: #3522

Changes:

  • docs: API root handler, buildinfo, csp
  • fix: updatecheck security
  • fix: code tags on paremeters and enums

@mtojek mtojek self-assigned this Dec 21, 2022
@mtojek mtojek marked this pull request as ready for review December 21, 2022 15:43
@mtojek mtojek changed the title docs: TBD docs: api root, buildinfo, csp Dec 21, 2022
coderd/apidoc/docs.go Outdated Show resolved Hide resolved
coderd/apidoc/docs.go Outdated Show resolved Hide resolved
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Spotted a few minor things, but looks good in general.

One thing I'd like to note though is that it'd be nice if we kept Go comments optimized for humans instead of computers/code-gen. I think we can find ways to automatically process the comments into pretty API documentation.

Version string `json:"version"`
// URL to download the latest release of Coder.
URL string `json:"url"`
}

// UpdateCheck returns information about the latest release version of
// Coder and whether or not the server is running the latest release.
// UpdateCheck returns information about the latest release version of Coder and whether or not the server is running the latest release.
Copy link
Member

Choose a reason for hiding this comment

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

These comments are somewhat easier to read when there are line-breaks, why do we need to make them a single line (same for the other changes)? (I personally write mine with <=80 char width but we don't enforce it, sub-80 is most prominent in the project though.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I admit that I changed the line length as I stick to <=120 or <=160 chars (widescreen). I believe that times with <=80 chars are already gone :)

As we fixed the bug with <br>, I guess that we can bring the original multi-line comment back.

Copy link
Member

Choose a reason for hiding this comment

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

😅. For me it's not about the space, I just find long lines harder to read because my eye needs to travel more sideways.

I also admit I like it when comments align closely to the thing they describe 😆 (like this):
image

Copy link
Member Author

Choose a reason for hiding this comment

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

In theory, we could involve one more formatter, golines, to enforce a specific line length limit, but maybe let's leave it aside from this PR.

coderd/csp.go Outdated Show resolved Hide resolved
docs/api/schemas.md Outdated Show resolved Hide resolved
docs/api/templates.md Outdated Show resolved Hide resolved
docs/api/templates.md Outdated Show resolved Hide resolved
coderd/coderd.go Show resolved Hide resolved
@mtojek mtojek requested a review from mafredri December 22, 2022 10:03
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@mtojek mtojek merged commit cfd02d9 into coder:main Dec 22, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2022
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.

None yet

3 participants