Repository navigation
Expand file tree
/
Copy pathcopy.bara.sky
More file actions
80 lines (74 loc) · 2.51 KB
/
Copy pathcopy.bara.sky
File metadata and controls
80 lines (74 loc) · 2.51 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copybara config: "push" = forward sync on internal merge, "upstream-pr" =
# /upstream reverse import (.github/workflows/upstream-pr.yml).
INTERNAL_URL = "https://github.com/evidence-dev/studio.git"
PUBLIC_URL = "https://github.com/evidence-dev/evidence.git"
PUBLIC_BRANCH = "main"
# The oss/ overlay holds the public repo's root files; the rest of the
# internal root stays behind.
OSS_FILES = glob(
include = [
"cli/**",
"core/**",
"docs/**",
"patches/**",
"vitest.config.ts",
"oss/**",
],
)
# Per-file moves so core.reverse() maps public root files back into oss/ only.
# IGNORE_NOOP: revisions that predate an overlay file must still replay.
TRANSFORMS = [
core.transform(
[
core.move("oss/LICENSE", "LICENSE"),
core.move("oss/README.md", "README.md"),
core.move("oss/CONTRIBUTING.md", "CONTRIBUTING.md"),
core.move("oss/AGENTS.md", "AGENTS.md"),
core.move("oss/CLAUDE.md", "CLAUDE.md"),
core.move("oss/package.json", "package.json"),
core.move("oss/pnpm-workspace.yaml", "pnpm-workspace.yaml"),
core.move("oss/pnpm-lock.yaml", "pnpm-lock.yaml"),
core.move("oss/.npmrc", ".npmrc"),
core.move("oss/.gitignore", ".gitignore"),
core.move("oss/.github", ".github"),
core.move("oss/copy.bara.sky", "copy.bara.sky"),
],
noop_behavior = "IGNORE_NOOP",
),
]
# Replays each internal commit touching OSS files, preserving author and message.
core.workflow(
name = "push",
origin = git.origin(
url = INTERNAL_URL,
ref = "main",
),
destination = git.destination(
url = PUBLIC_URL,
fetch = PUBLIC_BRANCH,
push = PUBLIC_BRANCH,
),
origin_files = OSS_FILES,
destination_files = glob(["**"]),
authoring = authoring.pass_thru("Evidence <support@evidence.dev>"),
mode = "ITERATIVE",
transformations = TRANSFORMS,
)
# Imports a public PR as an internal branch; ref and push branch come per-run.
core.workflow(
name = "upstream-pr",
origin = git.origin(
url = PUBLIC_URL,
ref = PUBLIC_BRANCH,
),
destination = git.destination(
url = INTERNAL_URL,
fetch = "main",
push = "oss/upstream-pr",
),
origin_files = glob(["**"]),
destination_files = OSS_FILES,
authoring = authoring.pass_thru("Evidence <support@evidence.dev>"),
mode = "CHANGE_REQUEST",
transformations = core.reverse(TRANSFORMS),
)