-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcopy.bara.sky
More file actions
45 lines (40 loc) · 1.74 KB
/
Copy pathcopy.bara.sky
File metadata and controls
45 lines (40 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
Copybara configuration for syncing commits from dagster-io/skills master to internal monorepo.
"""
def _skip_synced_from_internal(ctx):
"""Skip commits that originated from dagster-io/internal so we don't double-commit them."""
if ctx.find_label("Internal-RevId"):
core.fail_with_noop("Skipping commit that originated from dagster-io/internal.")
core.workflow(
name = "sync-internal",
origin = git.origin(
url = "file:///workspace/build/buildkite",
ref = "master",
),
destination = git.destination(
url = "https://github.com/dagster-io/internal.git",
fetch = "master",
push = "master",
),
origin_files = glob(["**"]),
destination_files = glob(["public/skills/**"]),
authoring = authoring.pass_thru("Dagster Devtools <devtools@dagsterlabs.com>"),
transformations = [
# Skip any commit that originated from dagster-io/internal. This
# prevents echoing the same commit back to dagster-io/internal.
core.dynamic_transform(impl = _skip_synced_from_internal),
# Mount all contents of dagster-io/skills on the public/skills
# subdirectory for the dagster-io/internal commit.
core.move("", "public/skills"),
],
mode = "ITERATIVE",
# This will cause the sync to fail if any transformations are not
# reversible (i.e. can be run in reverse and arrive at the original commit
# diff).
reversible_check = True,
# Commits written to dagster-io/internal record the corresponding
# dagster-io/skills commit hash under "Skills-RevId" instead of the default
# "GitOrigin-RevId". This ensures ITERATIVE mode tracking and loop
# prevention are scoped to this sync pair.
custom_rev_id = "Skills-RevId",
)