Skip to content

refactor(coderd): move healthcheck report structs to codersdk #12279

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
merged 3 commits into from
Feb 23, 2024

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Feb 23, 2024

Needed by #12161 to avoid an import cycle when adding a codersdk.Client method to hit /api/v2/debug/health.

Moves healthcheck report-related structs from coderd/healthcheck to codersdk

@johnstcn johnstcn force-pushed the cj/healthcheck-codersdk-refactor branch 2 times, most recently from 2e7faa6 to e6b7428 Compare February 23, 2024 11:13
@johnstcn johnstcn force-pushed the cj/healthcheck-codersdk-refactor branch from e6b7428 to 621fa13 Compare February 23, 2024 11:24
@johnstcn johnstcn marked this pull request as ready for review February 23, 2024 11:46
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

+5,560 −5,548

Is it only because of the generator?

@johnstcn
Copy link
Member Author

+5,560 −5,548

Is it only because of the generator?

Unfortunately, yes. Most of the changes are in generated files.

Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

As long as linter does not complain about violating enterprise rules, it is 👍 from me.

@johnstcn
Copy link
Member Author

Also smoke-tested that:

  • Workspace builds OK
  • Health page loads and renders OK in the UI

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.

Except for the removal of recover I flagged, LGTM!

"tailscale.com/net/netcheck"
"tailscale.com/tailcfg"

"github.com/coder/coder/v2/coderd/healthcheck/health"
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this also should be a part of codersdk. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I started doing that but then started to realize how big this PR would be 😅
I can open a new PR for this, but it's not a real blocker for now.

Comment on lines +31 to +37
baseDirs = [...]string{"./codersdk"}
// externalTypes are types that are not in the baseDirs, but we want to
// support. These are usually types that are used in the baseDirs.
// Do not include things like "Database", as that would break the idea
// of splitting db and api types.
// Only include dirs that are client facing packages.
externalTypeDirs = [...]string{"./cli/clibase", "./coderd/healthcheck/health", "./coderd/healthcheck/derphealth"}
externalTypeDirs = [...]string{"./cli/clibase", "./coderd/healthcheck/health"}
Copy link
Member Author

Choose a reason for hiding this comment

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

review: no longer need to generate coderd/healthcheck and coderd/healthcheck/derphealth.

@johnstcn johnstcn merged commit 2cb9bfd into main Feb 23, 2024
@johnstcn johnstcn deleted the cj/healthcheck-codersdk-refactor branch February 23, 2024 13:13
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 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.

4 participants