Skip to content

Commit

Permalink
docs: 📝 add notes about vendor fighting
Browse files Browse the repository at this point in the history
go and jsonnet/jb/tanka fight over the `vendor` directory. This is somewhat fixed with `-mod=readonly` or `-mod=mod` as an explicit flag to go commands, or `GOFLAGS=-mod=mod`, however, Jetbrains GOLAND still has problems if the `vendor` directory exists and doesn't have go files in it. See https://youtrack.jetbrains.com/issue/GO-10952/No-way-to-disable-vendoring-for-Sync-Dependencies-quick-fix. To get Goland to not freak out, `rm -rfd vendor`. This of course breaks all the Jsonnet, so when you are ready to do anything else, run `task jb:install`.

Another possible way to fix this is if tanka supported other vendor directories. See grafana/tanka#356 and grafana/tanka#820.
  • Loading branch information
ghostsquad committed Mar 12, 2023
1 parent 31961e4 commit e8c3edc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ Configuration is done via environment variables. Standard AWS SDK Environment va

1. There's a slew of app optimizations still left, such as separating `/ping` and `/metrics` endpoints onto different listeners (separate for application endpoints), make logging configurable between text/color and JSON and some other things. This was my first time using Gin.
2. I didn't configure test coverage or pay attention to that much. Just wrote a few small unit tests and a sanity-check end2end test (just verifies that the app runs and I can /ping it) via docker-compose.
3. go and jsonnet/jb/tanka fight over the `vendor` directory. This is somewhat fixed with `-mod=readonly` or `-mod=mod` as an explicit flag to go commands, or `GOFLAGS=-mod=mod`, however, Jetbrains GOLAND still has problems if the `vendor` directory exists and doesn't have go files in it. See https://youtrack.jetbrains.com/issue/GO-10952/No-way-to-disable-vendoring-for-Sync-Dependencies-quick-fix. To get Goland to not freak out, `rm -rfd vendor`. This of course breaks all the Jsonnet, so when you are ready to do anything else, run `task jb:install`. Another possible way to fix this is if tanka supported other vendor directories. See https://github.com/grafana/tanka/issues/356 and https://github.com/grafana/tanka/issues/820.
4 changes: 4 additions & 0 deletions taskfile.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ taskfile +
(import "github.com/ghostsquad/practice-layers/taskfile/go.libsonnet") +
(import "./config.libsonnet") +
{
env+: {
// TODO contribute this upstream
GOFLAGS: "-mod=mod",
},
vars+: {
EXPECTED_GO_VERSION: $.config_.go.expectedVersion,
K3D_APP_IMAGE: std.join("/", [$.config_.kubernetes.k3d.registry, $.config_.project.repoShort]) + ":{{.GIT_COMMIT}}"
Expand Down

0 comments on commit e8c3edc

Please sign in to comment.