Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 8 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
common --enable_bzlmod
common --enable_bzlmod --noincompatible_sandbox_hermetic_tmp
build --nolegacy_external_runfiles
build --remote_download_all
build --verbose_failures
build --@io_bazel_rules_go//go/config:pure
build --@rules_go//go/config:pure
test --test_output=errors

common --incompatible_enable_proto_toolchain_resolution
# Ensure that we don't accidentally build protobuf or gRPC
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.2
8.2.1
16 changes: 0 additions & 16 deletions .fasterci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,19 @@ workflows:
steps:
- name: Build & test
bazel:
build_flags:
- --enable_bzlmod=false
build_targets:
- //...
test_targets:
- //...
- name: Build & test e2e
working-directory: e2e
bazel:
build_flags:
- --enable_bzlmod=false
build_targets:
- //...
test_targets:
- //...
test_flags:
- --test_size_filters=-large,-enormous
- name: Build & test e2e with bzlmod
working-directory: e2e
bazel:
build_targets:
- //...
build_flags:
- --enable_bzlmod
test_targets:
- //...
test_flags:
- --enable_bzlmod
- --test_size_filters=-large,-enormous

- <<: *build_workflow
name: Faster CI / build (7.4.1)
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/** linguist-vendored
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: main
skipInvalidTags: true

- name: Create Release
uses: ncipollo/release-action@v1.12.0
with:
allowUpdates: true
draft: false
makeLatest: true
name: ${{ steps.semver.outputs.next }}
body: Changelog Contents
token: ${{ github.token }}
28 changes: 1 addition & 27 deletions .github/workflows/workspace_snippet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,6 @@ use_repo(kustomize, "kustomize_bin")

## Using WORKSPACE:

\`\`\`starlark

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "rules_gitops",
sha256 = "${SHA}",
strip_prefix = "${PREFIX}",
urls = ["https://github.com/fasterci/rules_gitops/releases/download/${TAG}/${ARCHIVE}"],
)

load("@rules_gitops//gitops:deps.bzl", "rules_gitops_dependencies")

rules_gitops_dependencies()

load("@rules_gitops//gitops:repositories.bzl", "rules_gitops_repositories")

rules_gitops_repositories()

load("@rules_gitops//skylib:k8s.bzl", "kubeconfig")

kubeconfig(
name = "k8s_dev_test",
cluster = "it_kubernetes_cluster_name",
use_host_config = True,
)
\`\`\`
`WORKSPACE` file is not supported in this version. The latest version with `WORKSPACE` support is [v0.32.13](https://github.com/fasterci/rules_gitops/releases/tag/v0.32.13)
EOF

51 changes: 0 additions & 51 deletions BUILD

This file was deleted.

51 changes: 51 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2020 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.

# gazelle:build_tags darwin,linux
# gazelle:exclude examples e2e
# gazelle:proto disable_global
# gazelle:go_naming_convention import_alias

# gazelle:resolve go github.com/fasterci/rules_gitops/gitops/blaze_query //gitops/blaze_query:blaze_query
# gazelle:resolve go github.com/fasterci/rules_gitops/gitops/analysis //gitops/analysis:analysis

load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load("@gazelle//:def.bzl", "gazelle")

# gazelle:prefix github.com/fasterci/rules_gitops
gazelle(
name = "gazelle",
build_tags = [
"integration",
"debug",
],
command = "fix",
extra_args = [
"-build_file_name",
"BUILD,BUILD.bazel",
],
)

buildifier(
name = "buildifier",
lint_mode = "warn",
lint_warnings = [
"-module-docstring",
"-function-docstring",
"-function-docstring-header",
"-function-docstring-args",
"-function-docstring-return",
],
)

buildifier(
name = "buildifier-fix",
lint_mode = "fix",
)
60 changes: 39 additions & 21 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
module(
name = "rules_gitops",
version = "0.50.0",
bazel_compatibility = [">=7.1.0"],
compatibility_level = 0,
)

bazel_dep(name = "aspect_bazel_lib", version = "2.7.1")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_oci", version = "1.7.2")
bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(name = "rules_go", version = "0.44.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "aspect_bazel_lib", version = "2.15.3")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_oci", version = "2.2.6")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_go", version = "0.54.0")

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.21.5")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.23.9")

bazel_dep(name = "gazelle", version = "0.37.0", repo_name = "bazel_gazelle")
bazel_dep(name = "gazelle", version = "0.43.0")

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_bradleyfalzon_ghinstallation_v2",
"com_github_ghodss_yaml",
"com_github_golang_protobuf",
"com_github_google_go_cmp",
"com_github_google_go_github_v32",
"com_github_google_go_containerregistry",
"com_github_google_go_github_v68",
"com_github_xanzy_go_gitlab",
"io_k8s_api",
"io_k8s_apimachinery",
"io_k8s_client_go",
"org_golang_google_protobuf",
"org_golang_x_oauth2",
"org_golang_x_sync",
)

toolchains = use_extension(
Expand All @@ -39,13 +43,27 @@ use_repo(toolchains, "kustomize_bin", "kustomize_toolchains")

register_toolchains("@kustomize_toolchains//:all")

# Uncomment this part when bazel 6 is deprecated. Supported in bazel 7
# kubeconfig = use_repo_rule("@rules_gitops//skylib:k8s.bzl", "kubeconfig")
kubeconfig = use_repo_rule("@rules_gitops//skylib:k8s.bzl", "kubeconfig")

# kubeconfig(
# name = "k8s_test",
# cluster = "mycluster",
# use_host_config = True,
# )
kubeconfig(
name = "k8s_test",
cluster = "mycluster",
use_host_config = True,
)

bazel_dep(name = "buildifier_prebuilt", version = "8.0.3", dev_dependency = True)

bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "toolchains_protoc", version = "0.4.1")

protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
protoc.toolchain(
# Creates a repository to satisfy well-known-types dependencies such as
# deps=["@com_google_protobuf//:any_proto"]
google_protobuf = "com_google_protobuf",
# Pin to any version of protoc
version = "v27.1",
)
use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub")

bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
register_toolchains("@toolchains_protoc_hub//:all")
Loading