Skip to content

Commit

Permalink
Merge pull request #1686 from getsops/dependabot/go_modules/go-380d35…
Browse files Browse the repository at this point in the history
…66d7

build(deps): Bump the go group across 1 directory with 18 updates
  • Loading branch information
felixfontein authored Dec 1, 2024
2 parents 92651ed + 0406503 commit f76921b
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 138 deletions.
77 changes: 77 additions & 0 deletions .github/utils/patch-go.mod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
"""
Patch go.mod so that the lines 'go xxx' to 'toolchain xxx' are as in git's
HEAD.
This is necessary since newer 'go mod tidy' versions tend to modify these
lines. Since we check in CI that 'go mod tidy' does not change go.mod, this
causes CI to fail.
"""

import subprocess


def split_go_mod(contents: str) -> tuple[list[str], list[str], list[str]]:
"""
Given the contents of go.mod, splits it into three lists of lines
(with endings):
1. The lines before 'go';
2. The lines starting with 'go' and ending with 'toolchain';
3. The lines after 'toolchain'.
"""
parts: tuple[list[str], list[str], list[str]] = ([], [], [])
index = 0
for line in contents.splitlines(keepends=True):
next_index = index
if line.startswith('go '):
index = next_index = 1
if line.startswith('toolchain '):
next_index = 2
parts[index].append(line)
index = next_index
return parts


def get_file_contents_from_git_revision(filename: str, revision: str) -> str:
"""
Get the file contents of ``filename`` from Git revision ``revision``.
"""
p = subprocess.run(
['git', 'show', f'{revision}:{filename}'],
stdout=subprocess.PIPE,
check=True,
encoding='utf-8',
)
return p.stdout


def read_file(filename: str) -> str:
"""
Read the file's contents.
"""
with open(filename, 'r', encoding='utf-8') as f:
return f.read()


def write_file(filename: str, contents: str) -> None:
"""
Write the file's contents.
"""
with open(filename, 'w', encoding='utf-8') as f:
f.write(contents)


def main():
"""
Patches go.mod.
"""
filename = 'go.mod'
_, go_versions, __ = split_go_mod(
get_file_contents_from_git_revision(filename, 'HEAD')
)
head, _, tail = split_go_mod(read_file(filename))
lines = head + go_versions + tail
write_file(filename, ''.join(lines))


if __name__ == '__main__':
main()
3 changes: 3 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
- name: Vendor Go Modules
run: make vendor

- name: Restore go/toolchain lines of go.mod
run: python3 .github/utils/patch-go.mod.py

- name: Ensure clean working tree
run: git diff --exit-code

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ jobs:
# target, which includes a lot more than just the Go files we want to
# scan.
- name: Build
run: make install
run: |
make vendor
make install
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
Expand Down
91 changes: 45 additions & 46 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
module github.com/getsops/sops/v3

go 1.22

toolchain go1.22.5
toolchain go1.22.9

require (
cloud.google.com/go/kms v1.20.1
cloud.google.com/go/storage v1.45.0
cloud.google.com/go/storage v1.47.0
filippo.io/age v1.2.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.2.0
github.com/ProtonMail/go-crypto v1.1.0-beta.0-proton
github.com/aws/aws-sdk-go-v2 v1.32.2
github.com/aws/aws-sdk-go-v2/config v1.28.0
github.com/aws/aws-sdk-go-v2/credentials v1.17.41
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.34
github.com/aws/aws-sdk-go-v2/service/kms v1.37.2
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.1
github.com/aws/aws-sdk-go-v2/service/sts v1.32.2
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.3.0
github.com/ProtonMail/go-crypto v1.1.2
github.com/aws/aws-sdk-go-v2 v1.32.5
github.com/aws/aws-sdk-go-v2/config v1.28.5
github.com/aws/aws-sdk-go-v2/credentials v1.17.46
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.40
github.com/aws/aws-sdk-go-v2/service/kms v1.37.6
github.com/aws/aws-sdk-go-v2/service/s3 v1.68.0
github.com/aws/aws-sdk-go-v2/service/sts v1.33.1
github.com/blang/semver v3.5.1+incompatible
github.com/fatih/color v1.18.0
github.com/getsops/gopgagent v0.0.0-20240527072608-0c14999532fe
Expand All @@ -34,51 +33,51 @@ require (
github.com/ory/dockertest/v3 v3.11.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
github.com/urfave/cli v1.22.16
golang.org/x/net v0.30.0
golang.org/x/sys v0.26.0
golang.org/x/term v0.25.0
google.golang.org/api v0.203.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53
google.golang.org/grpc v1.67.1
google.golang.org/protobuf v1.35.1
golang.org/x/net v0.31.0
golang.org/x/sys v0.27.0
golang.org/x/term v0.26.0
google.golang.org/api v0.209.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f
google.golang.org/grpc v1.68.0
google.golang.org/protobuf v1.35.2
gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v3 v3.0.1
)

require (
cel.dev/expr v0.16.1 // indirect
cloud.google.com/go v0.116.0 // indirect
cloud.google.com/go/auth v0.9.9 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/auth v0.10.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.5 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect
cloud.google.com/go/iam v1.2.1 // indirect
cloud.google.com/go/longrunning v0.6.1 // indirect
cloud.google.com/go/monitoring v1.21.1 // indirect
cloud.google.com/go/iam v1.2.2 // indirect
cloud.google.com/go/longrunning v0.6.2 // indirect
cloud.google.com/go/monitoring v1.21.2 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 // indirect
github.com/aws/smithy-go v1.22.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.24 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.5 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 // indirect
github.com/aws/smithy-go v1.22.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
Expand All @@ -104,7 +103,7 @@ require (
github.com/google/s2a-go v0.1.8 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/googleapis/gax-go/v2 v2.14.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
Expand Down Expand Up @@ -139,13 +138,13 @@ require (
go.opentelemetry.io/otel/sdk v1.29.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.7.0 // indirect
google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/time v0.8.0 // indirect
google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit f76921b

Please sign in to comment.