Skip to content

Commit

Permalink
refactor: update rules to all start with workflows_ prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Feb 21, 2024
1 parent 35c487e commit 01661a7
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 44 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ load("@aspect_rules_workflows//workflows:dependencies.bzl", "rules_workflows_dep

rules_workflows_dependencies()

load("@aspect_rules_workflows//workflows:repositories.bzl", "LATEST_WORKFLOWS_VERSION", "fetch_workflows_tools")
load("@aspect_rules_workflows//workflows:repositories.bzl", "LATEST_WORKFLOWS_VERSION", "workflows_tools")

fetch_workflows_tools(workflows_version = LATEST_WORKFLOWS_VERSION)
workflows_tools(workflows_version = LATEST_WORKFLOWS_VERSION)

load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")

Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# When --enable_bzlmod is set, this file replaces WORKSPACE.bazel.

load("@aspect_rules_workflows//workflows:repositories.bzl", "LATEST_WORKFLOWS_VERSION", "fetch_workflows_tools")
load("@aspect_rules_workflows//workflows:repositories.bzl", "LATEST_WORKFLOWS_VERSION", "workflows_tools")

fetch_workflows_tools(workflows_version = LATEST_WORKFLOWS_VERSION)
workflows_tools(workflows_version = LATEST_WORKFLOWS_VERSION)

load("@aspect_rules_lint//format:repositories.bzl", "fetch_shfmt")

Expand Down
26 changes: 13 additions & 13 deletions docs/rules.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions e2e/smoke/.circleci/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load("@aspect_rules_workflows//workflows:defs.bzl", "circleci_aspect_workflows_config", "circleci_merged_config")
load("@aspect_rules_workflows//workflows:defs.bzl", "workflows_circleci_config", "workflows_circleci_merged_config")

circleci_aspect_workflows_config(
workflows_circleci_config(
name = "aspect-workflows-config",
circleci_org = "aspect-build",
stamp = True,
)

circleci_merged_config(
workflows_circleci_merged_config(
name = "config",
circleci_config_files = [
":user-config.yml",
Expand Down
4 changes: 2 additions & 2 deletions e2e/smoke/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ load("@aspect_rules_workflows//workflows:dependencies.bzl", "rules_workflows_dep

rules_workflows_dependencies()

load("@aspect_rules_workflows//workflows:repositories.bzl", "LATEST_WORKFLOWS_VERSION", "fetch_workflows_tools")
load("@aspect_rules_workflows//workflows:repositories.bzl", "LATEST_WORKFLOWS_VERSION", "workflows_tools")

fetch_workflows_tools(workflows_version = LATEST_WORKFLOWS_VERSION)
workflows_tools(workflows_version = LATEST_WORKFLOWS_VERSION)
4 changes: 2 additions & 2 deletions e2e/smoke/WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#########################
# rules_workflows setup #
#########################
load("@aspect_rules_workflows//workflows:repositories.bzl", "LATEST_WORKFLOWS_VERSION", "fetch_workflows_tools")
load("@aspect_rules_workflows//workflows:repositories.bzl", "LATEST_WORKFLOWS_VERSION", "workflows_tools")

fetch_workflows_tools(workflows_version = LATEST_WORKFLOWS_VERSION)
workflows_tools(workflows_version = LATEST_WORKFLOWS_VERSION)
6 changes: 3 additions & 3 deletions examples/circleci/merged_stamped_config/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load("@aspect_rules_workflows//workflows:defs.bzl", "circleci_aspect_workflows_config", "circleci_merged_config")
load("@aspect_rules_workflows//workflows:defs.bzl", "workflows_circleci_config", "workflows_circleci_merged_config")

circleci_aspect_workflows_config(
workflows_circleci_config(
name = "aspect-workflows-config",
circleci_org = "aspect-build",
stamp = True,
)

circleci_merged_config(
workflows_circleci_merged_config(
name = "config",
circleci_config_files = [
":user-config-a.yml",
Expand Down
6 changes: 3 additions & 3 deletions examples/circleci/merged_stamped_config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Example of a merging the Aspect Workflows generated CircleCI with other non-Work
configs.

In this example, the Aspect Workflows CircleCI config is generated with the
`circleci_aspect_workflows_config` rule and then merged with non-Workflows CircleCI config,
`user-config-a.yml` and `user-config-b.yml`, with the `circleci_merged_config` rule.
`workflows_circleci_config` rule and then merged with non-Workflows CircleCI config,
`user-config-a.yml` and `user-config-b.yml`, with the `workflows_circleci_merged_config` rule.

Set `diff_test` to `False` to disable the diff test that keeps the stamped
`aspect-workflows-config.yml` file up-to-date with the generated file. Disabling the diff test
allows for custom modifications to the generated config. On changes to
`.aspect/workflows/config.yaml` or when upgrading to a newer version of Aspect Workflows, be sure to
`bazel run` the `circleci_aspect_workflows_config` target to update the stamped file and re-apply
`bazel run` the `workflows_circleci_config` target to update the stamped file and re-apply
your custom changes.
6 changes: 3 additions & 3 deletions examples/circleci/merged_unstamped_config/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("@aspect_rules_workflows//workflows:defs.bzl", "circleci_aspect_workflows_config", "circleci_merged_config")
load("@aspect_rules_workflows//workflows:defs.bzl", "workflows_circleci_config", "workflows_circleci_merged_config")

circleci_aspect_workflows_config(
workflows_circleci_config(
name = "aspect-workflows-config",
circleci_org = "aspect-build",
)

circleci_merged_config(
workflows_circleci_merged_config(
name = "config",
circleci_config_files = [
":user-config-a.yml",
Expand Down
4 changes: 2 additions & 2 deletions examples/circleci/merged_unstamped_config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Example of a merging the Aspect Workflows generated CircleCI with other non-Work
configs.

In this example, the Aspect Workflows CircleCI config is generated with the
`circleci_aspect_workflows_config` rule and then merged with non-Workflows CircleCI configs,
`user-config-a.yml` and `user-config-b.yml`, with the `circleci_merged_config` rule.
`workflows_circleci_config` rule and then merged with non-Workflows CircleCI configs,
`user-config-a.yml` and `user-config-b.yml`, with the `workflows_circleci_merged_config` rule.
4 changes: 2 additions & 2 deletions examples/circleci/standalone_config/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@aspect_rules_workflows//workflows:defs.bzl", "circleci_aspect_workflows_config")
load("@aspect_rules_workflows//workflows:defs.bzl", "workflows_circleci_config")

circleci_aspect_workflows_config(
workflows_circleci_config(
name = "config",
circleci_org = "aspect-build",
)
2 changes: 1 addition & 1 deletion examples/circleci/standalone_config/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Stand-alone CircleCI config example

Example of a stand-alone generated Aspect Workflows CircleCI config that is written to the source
tree with the `circleci_aspect_workflows_config` rule. In this case, the name of the rule must be
tree with the `workflows_circleci_config` rule. In this case, the name of the rule must be
`config` so that the generated file is `config.yml`.

Follow this example if there are no other CircleCI configuration other than Aspect Workflows.
6 changes: 3 additions & 3 deletions workflows/defs.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"Public API re-exports"

load("@aspect_rules_workflows//workflows/private:circleci.bzl", _circleci_aspect_workflows_config = "circleci_aspect_workflows_config", _circleci_merged_config = "circleci_merged_config")
load("@aspect_rules_workflows//workflows/private:circleci.bzl", _workflows_circleci_config = "workflows_circleci_config", _workflows_circleci_merged_config = "workflows_circleci_merged_config")

circleci_aspect_workflows_config = _circleci_aspect_workflows_config
circleci_merged_config = _circleci_merged_config
workflows_circleci_config = _workflows_circleci_config
workflows_circleci_merged_config = _workflows_circleci_merged_config
4 changes: 2 additions & 2 deletions workflows/private/circleci.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file")

def circleci_aspect_workflows_config(
def workflows_circleci_config(
name,
circleci_org,
aspect_workflows_config_file = "//.aspect/workflows:config.yaml",
Expand Down Expand Up @@ -52,7 +52,7 @@ def circleci_aspect_workflows_config(
actual = update_target,
)

def circleci_merged_config(
def workflows_circleci_merged_config(
name,
circleci_config_files):
"""Merges multiple CircleCI config files into one.
Expand Down
2 changes: 1 addition & 1 deletion workflows/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("//workflows/private:versions.bzl", "CIRCLECI_CONFIG_MERGE_VERSIONS", "ROSE
LATEST_WORKFLOWS_VERSION = ROSETTA_VERSIONS.keys()[0]

# buildifier: disable=function-docstring
def fetch_workflows_tools(workflows_version):
def workflows_tools(workflows_version):
if workflows_version not in ROSETTA_VERSIONS.keys():
fail("Aspect Workflows version {} not supported".format(workflows_version))

Expand Down

0 comments on commit 01661a7

Please sign in to comment.