Skip to content

chore: add lint for codersdk dependencies #14638

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 11, 2024

To avoid problems like #14633 in the future, we can recursively get all the direct, indirect, and test dependencies for codersdk to ensure they don't include anything that requires one of our go.mod replace directives.

We could also maintain a list of 'heavy' dependencies and include that in the script, but the replace directives already include tailscale (and therefore gvisor).

e.g. when coderdtest is imported in codersdk_test locally:

~/coder $ ./scripts/check_codersdk_imports.sh
ERROR: codersdk cannot import the following packages being replaced in go.mod:
github.com/alecthomas/chroma/v2
go.opencensus.io
github.com/tcnksm/go-httpstat
github.com/dlclark/regexp2
tailscale.com
github.com/gliderlabs/ssh
github.com/pkg/sftp
github.com/lib/pq

otherwise:

~/coder $ ./scripts/check_codersdk_imports.sh
codersdk imports OK

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 changed the title chore: lint codersdk dependencies for tailscale chore: add lint for codersdk dependencies Sep 11, 2024
@ethanndickson ethanndickson force-pushed the 09-11-chore_lint_codersdk_dependencies_for_tailscale branch 2 times, most recently from b0ea2f9 to 4a1728f Compare September 11, 2024 06:42
@ethanndickson ethanndickson marked this pull request as ready for review September 11, 2024 06:46
@ethanndickson ethanndickson force-pushed the 09-11-chore_lint_codersdk_dependencies_for_tailscale branch from 4a1728f to 438d62b Compare September 11, 2024 13:55
@ethanndickson ethanndickson force-pushed the 09-11-chore_lint_codersdk_dependencies_for_tailscale branch from 438d62b to 9124b8b Compare September 12, 2024 02:48
@ethanndickson ethanndickson force-pushed the 09-11-chore_lint_codersdk_dependencies_for_tailscale branch from 9124b8b to 1ca5222 Compare September 12, 2024 03:54
@ethanndickson ethanndickson merged commit 33e896d into main Sep 12, 2024
29 of 30 checks passed
@ethanndickson ethanndickson deleted the 09-11-chore_lint_codersdk_dependencies_for_tailscale branch September 12, 2024 05:34
@github-actions github-actions bot locked and limited conversation to collaborators Sep 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.

2 participants