cognitedata / bazel-snapshots

A mechanism for doing incremental deploys with Bazel
Apache License 2.0
10 stars 1 forks source link

Add support for S3 as storage backend #207

Open mikberg opened 9 months ago

mikberg commented 9 months ago

Finally starting to use this project for real again!

Adds support for S3 as storage backend.

Defaults to discovering parameters beyond bucket name and workdir using the AWS config package's LoadDefaultConfig(), which I think is the least surprising way of discovering credentials.

This prerelease seems to work nicely: https://github.com/mikberg/bazel-snapshots/releases/tag/v0.13.0-alpha.1

🚀

psalaberria002 commented 9 months ago

Welcome :rocket:

We need to run gazelle-update-repos for non bzlmod support.

Looks good otherwise.

psalaberria002 commented 7 months ago
diff --git snapshots/dependencies.bzl snapshots/dependencies.bzl
index 62697a0..570cfe3 100644
--- snapshots/dependencies.bzl
+++ snapshots/dependencies.bzl
@@ -59,6 +59,15 @@ def go_dependencies():
     )
     go_repository(
         name = "com_github_aws_aws_sdk_go_v2",
+        build_directives = [
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2//:__subpackages__",
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_feature_s3_manager//:__subpackages__",
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_service_s3//:__subpackages__",
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_service_internal_s3shared//:__subpackages__",
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_credentials//:__subpackages__",
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_service_sso//:__subpackages__",
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_service_sts//:__subpackages__",
+        ],
         build_file_proto_mode = "disable_global",
         importpath = "github.com/aws/aws-sdk-go-v2",
         sum = "h1:+dCJ5W2HiZNa4UtaIc5ljKNulm0dK0vS5dxb5LdDOAA=",
@@ -87,6 +96,9 @@ def go_dependencies():
     )
     go_repository(
         name = "com_github_aws_aws_sdk_go_v2_internal_ini",
+        build_directives = [
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_config//:__subpackages__",
+        ],
         build_file_proto_mode = "disable_global",
         importpath = "github.com/aws/aws-sdk-go-v2/internal/ini",
         sum = "h1:zPxLGWALExNepElO0gYgoqsbqTlt4ZCrhZ7XlfJ+Qlw=",
@@ -94,6 +106,9 @@ def go_dependencies():
     )
     go_repository(
         name = "com_github_aws_aws_sdk_go_v2_service_internal_accept_encoding",
+        build_directives = [
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_service_s3//:__subpackages__",
+        ],
         build_file_proto_mode = "disable_global",
         importpath = "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding",
         sum = "h1:EtQ6hVAgNsWTiO+u9e+ziaEYyOAlEkAwLskpL40U6pQ=",
@@ -101,6 +116,10 @@ def go_dependencies():
     )
     go_repository(
         name = "com_github_aws_aws_sdk_go_v2_service_internal_presigned_url",
+        build_directives = [
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_service_sts//:__subpackages__",
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_service_s3//:__subpackages__",
+        ],
         build_file_proto_mode = "disable_global",
         importpath = "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url",
         sum = "h1:/T5wKsw/po118HEDvnSE8YU7TESxvZbYM2rnn+Oi7Kk=",
@@ -108,6 +127,9 @@ def go_dependencies():
     )
     go_repository(
         name = "com_github_aws_aws_sdk_go_v2_service_internal_s3shared",
+        build_directives = [
+            "gazelle:go_visibility @com_github_aws_aws_sdk_go_v2_service_s3//:__subpackages__",
+        ],
         build_file_proto_mode = "disable_global",
         importpath = "github.com/aws/aws-sdk-go-v2/service/internal/s3shared",
         sum = "h1:j1JV89mkJP4f9cssTWbu+anj3p2v+UWMA7qERQQqMkM=",

for the non bzlmod deps.

We need to apply the same patched to the deps in MODULE.bazel