Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-otel-to-service
Browse files Browse the repository at this point in the history
  • Loading branch information
dmihalcik-virtru committed Feb 27, 2025
2 parents b444eec + d7b430b commit 8860da6
Show file tree
Hide file tree
Showing 93 changed files with 5,833 additions and 1,922 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ jobs:
if: env.IS_RELEASE_BRANCH == 'true'
working-directory: ${{ matrix.directory }}
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837
with:
version: v1.61
version: v1.64
working-directory: ${{ matrix.directory }}
skip-cache: true
args: --out-format=colored-line-number
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
password: ${{ steps.gcp-auth.outputs.access_token }}

- id: docker_meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
images: ${{ secrets.DOCKER_REPO }}
tags: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
password: ${{ steps.gcp-auth.outputs.access_token }}

- id: docker_meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
images: ${{ secrets.DOCKER_REPO }}
tags: |
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
with:
app-id: "${{ secrets.APP_ID }}"
private-key: "${{ secrets.AUTOMATION_KEY }}"
Expand All @@ -30,7 +30,7 @@ jobs:
- id: todo
if: fromJson(steps.release-please.outputs.releases_created)
run: |
for x in ${{join(fromJson(steps.release-please.outputs.paths_released), ' ')}}; do
<<<"$RELEASED_PATHS" jq -r '.[]'| while IFS= read -r x; do
case "$x" in
lib/ocrypto)
echo "TO_UPDATE=['examples','sdk','service']">>"$GITHUB_OUTPUT"
Expand Down Expand Up @@ -60,7 +60,8 @@ jobs:
;;
esac
done
env:
RELEASED_PATHS: ${{ steps.release-please.outputs.paths_released }}
update-go-mods:
runs-on: ubuntu-latest
needs:
Expand All @@ -78,15 +79,15 @@ jobs:
- run: |
git checkout -b update-go-mods-for-${{matrix.path}}
git push -f -u origin update-go-mods-for-${{matrix.path}}
cd ${{matrix.path}}
for x in ${{join(fromJson(needs.release-please.outputs.paths_released), ' ')}}; do
export pkg=github.com/opentdf/platform/${x}
cd ${{matrix.path}} || exit 1
<<<"$RELEASED_PATHS" jq -r '.[]'| while IFS= read -r x; do
export pkg="github.com/opentdf/platform/${x}"
if go mod edit --json | jq -e '.Replace[] | select(.Old.Path == env.pkg)'; then
go mod edit --dropreplace=$pkg
go mod edit --dropreplace="$pkg"
fi
echo "Should we update [${pkg}] in [${{ matrix.path }}]?"
if go mod edit --json | jq -e '.Require[] | select(.Path == env.pkg)'; then
ver=$(jq -r .\[\"${x}\"\] < "${GITHUB_WORKSPACE}/.release-please-manifest.json")
ver="$(jq -r --arg x "$x" '.[$x]' <"${GITHUB_WORKSPACE}"/.release-please-manifest.json)"
echo "go get ${pkg}@v${ver}"
go get "${pkg}@v${ver}"
fi
Expand All @@ -99,6 +100,7 @@ jobs:
git diff
env:
GONOSUMDB: github.com/opentdf/platform/${{join(fromJson(needs.release-please.outputs.paths_released), ',github.com/opentdf/platform/')}}
RELEASED_PATHS: ${{ needs.release-please.outputs.paths_released }}
- uses: planetscale/ghcommit-action@d4176bfacef926cc2db351eab20398dfc2f593b5
with:
commit_message: "fix(core): Autobump ${{ matrix.path }}"
Expand All @@ -108,7 +110,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
with:
app-id: "${{ secrets.APP_ID }}"
private-key: "${{ secrets.AUTOMATION_KEY }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639
with:
days-before-stale: 120
# negative number means they will never be closed automatically [https://github.com/actions/stale#days-before-close]
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/traffic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ jobs:
matrix:
repo-values:
- {repo: platform, event: ""}
- {repo: otdfctl, event: backend-}
- {repo: spec, event: frontend-}
- {repo: otdfctl, event: otdfctl-}
- {repo: spec, event: spec-}
- {repo: tests, event: tests-}
- {repo: client-web, event: clientweb-}
- {repo: client-cpp, event: cpp-sdk-}
- {repo: web-sdk, event: web-sdk-}
- {repo: java-sdk, event: java-sdk-}
- {repo: charts, event: charts-}
- {repo: nifi, event: nifi-}
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
with:
app-id: "${{ secrets.APP_ID }}"
private-key: "${{ secrets.AUTOMATION_KEY }}"
Expand Down
6 changes: 2 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ linters-settings:
# Such cases aren't reported by default.
# Default: false
check-type-assertions: true
# https://github.com/golangci/golangci-lint/issues/4743
ignore: ''

exhaustive:
# Program elements to check for exhaustiveness.
Expand Down Expand Up @@ -138,7 +136,7 @@ linters:
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
- exhaustive # checks exhaustiveness of enum switch statements
# - exportloopref # checks for pointers to enclosing loop variables Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar."
- exptostd # Added in 1.63. Checks for usages of the deprecated experimental packages
# - fatcontext
- forbidigo # forbids identifiers
- forcetypeassert # finds forced type assertions
Expand Down Expand Up @@ -173,14 +171,14 @@ linters:
# - spancheck # checks for incorrect usage of opentracing.Span # Added in golangci-lint 1.56
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
- stylecheck # is a replacement for golint
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
- testableexamples # checks if examples are testable (have an expected output)
- testifylint
#- testpackage # makes you use a separate _test package
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
- unconvert # removes unnecessary type conversions
- unparam # reports unused function parameters
- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
- usetesting # Replaced tenv in golangci-lint 1.63
- wastedassign # finds wasted assignment statements
- whitespace # detects leading and trailing whitespace

Expand Down
8 changes: 4 additions & 4 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"lib/fixtures": "0.2.10",
"lib/ocrypto": "0.1.7",
"lib/ocrypto": "0.1.8",
"lib/flattening": "0.1.3",
"protocol/go": "0.2.25",
"sdk": "0.3.26",
"service": "0.4.38"
"protocol/go": "0.2.28",
"sdk": "0.3.28",
"service": "0.4.39"
}
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ all: toolcheck clean build lint license test
toolcheck:
@echo "Checking for required tools..."
@which buf > /dev/null || (echo "buf not found, please install it from https://docs.buf.build/installation" && exit 1)
@which golangci-lint > /dev/null || (echo "golangci-lint not found, run 'go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0'" && exit 1)
@which golangci-lint > /dev/null || (echo "golangci-lint not found, run 'go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5'" && exit 1)
@which protoc-gen-doc > /dev/null || (echo "protoc-gen-doc not found, run 'go install github.com/pseudomuto/protoc-gen-doc/cmd/[email protected]'" && exit 1)
@golangci-lint --version | grep "version v\?1.6[123]" > /dev/null || (echo "golangci-lint version must be v1.61 or later [$$(golangci-lint --version)]" && exit 1)
@golangci-lint --version | grep "version v\?1.6[456]" > /dev/null || (echo "golangci-lint version must be v1.64 or later [$$(golangci-lint --version)]" && exit 1)
@which goimports >/dev/null || (echo "goimports not found, run 'go install golang.org/x/tools/cmd/goimports@latest'")

fix: tidy fmt
Expand All @@ -45,8 +45,12 @@ proto-lint:
fi)

go-lint:
for m in $(HAND_MODS); do (cd $$m && golangci-lint run $(LINT_OPTIONS) --path-prefix=$$m) || exit 1; done

status=0; \
for m in $(HAND_MODS); do \
echo "Linting module: $$m"; \
(cd "$$m" && golangci-lint run $(LINT_OPTIONS) --path-prefix="$$m" ) || status=1; \
done; \
exit $$status
proto-generate:
rm -rf protocol/go/[a-fh-z]* docs/grpc docs/openapi
buf generate service
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
- [Podman Compose](https://github.com/containers/podman-compose)
- [Buf](https://buf.build/docs/ecosystem/cli-overview) is used for managing protobuf files.
Required for developing services.
- [golangci-lint](https://golangci-lint.run/) is used for ensuring good coding practices.
Use `make go-lint` to run it before submitting a PR

On macOS, these can be installed with [brew](https://docs.brew.sh/Installation)

```sh
brew install buf go
brew install buf go golangci-lint
```

#### Optional tools

- _Optional_ [Air](https://github.com/cosmtrek/air) is used for hot-reload development
- install with `go install github.com/cosmtrek/air@latest`
- _Optional_ [golangci-lint](https://golangci-lint.run/) is used for ensuring good coding practices
- install with `brew install golangci-lint`
- _Optional_ [grpcurl](https://github.com/fullstorydev/grpcurl) is used for testing gRPC services
- install with `brew install grpcurl`
- _Optional_ [openssl](https://www.openssl.org/) is used for generating certificates
Expand Down
12 changes: 6 additions & 6 deletions buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
version: v2
deps:
- name: buf.build/bufbuild/protovalidate
commit: e097f827e65240ac9fd4b1158849a8fc
digest: b5:beda657a164abf9d1bac222e352f14d9a4a8c913ccdb7e5c3dfeda097690f60e8edb27b518c2d8e73b70aecb6ac47fdc3654a1f62b9e09c3566cd4e620628cfd
commit: 63bb56e204954558946a641ef0d68910
digest: b5:ec5661b2855484eca2043fe61d27eb22673ab926ccd0e849531752eb17b08402fae1382705cee7f7b42d4d9ec56aff72bba7ec6835902cf6f86323c9ac682d16
- name: buf.build/googleapis/googleapis
commit: a86849a25cc04f4dbe9b15ddddfbc488
digest: b5:a77a2082c596ee6800a23d8cecd021d316eb10565d6cb94532f2d7c567fe6c9a177b5bb123b51a3acb4f1f18d4f54a6da883afcb682919a137a8a37c020509a2
commit: 83c0f6c19b2f4ea0b0fd84a80e753659
digest: b5:e9d077ad9d2eaa08a056108a15292a69548880d3a935781c498f2e591e60e531e49e1f5fc1d7356e5f989d3a8540e9885a02df18cb0cecc4ffa439fa4438a09e
- name: buf.build/grpc-ecosystem/grpc-gateway
commit: 3f42134f4c564983838425bc43c7a65f
digest: b5:291b947d8ac09492517557e4e72e294788cb8201afc7d0df7bda80fa10931adb60d4d669208a7696bf24f1ecb2a33a16d4c1e766e6f31809248b00343119569b
commit: 4c5ba75caaf84e928b7137ae5c18c26a
digest: b5:c113e62fb3b29289af785866cae062b55ec8ae19ab3f08f3004098928fbca657730a06810b2012951294326b95669547194fa84476b9e9b688d4f8bf77a0691d
1 change: 1 addition & 0 deletions docs/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ Note: When `exportToJaeger` is false, traces will be written to local files inst

## Advice for Code Contributors

* Make sure to run our linters with `make lint`
* Follow our [Error Guidelines](./Contributing-errors.md)
Loading

0 comments on commit 8860da6

Please sign in to comment.