Skip to content

Module Index

Overview of all Copybara modules with their primary functions.

ModuleKey FunctionsDescription
coreworkflow, move, replace, remove, copyWorkflows and file transformations
gitorigin, destination, github_origin, github_pr_originGit endpoints and operations
metadatasquash_notes, scrubber, map_author, expose_labelCommit message transformations
authoringpass_thru, overwrite, allowedAuthor handling modes
ModuleKey FunctionsDescription
globglob(include, exclude)File pattern matching
archivecreate, extractZIP, TAR, JAR operations
patchapply, quilt_applyApply patch files
ModuleKey FunctionsDescription
buildozercreate, delete, modify, cmdBazel BUILD manipulation
goGo-specific operationsGo module handling
rustRust-specific operationsCargo/crate handling
pythonparse_metadataPyPI metadata parsing
ModuleKey FunctionsDescription
formatbuildifierCode formatting
tomlTOML parsingConfig file handling
xmlXML operationsXML transformations
htmlxpathHTML element selection
ModuleKey FunctionsDescription
httpHTTP operationsAPI interactions
remotefilesRemote file fetchingDownload dependencies
ModuleKey FunctionsDescription
re2compile, quoteRegex patterns
datetimenow, fromtimestampDate/time handling
hashingpath_sha256_sum, str_sha256_sumChecksums
core.workflow(
name = "default",
origin = git.origin(url = "...", ref = "main"),
destination = git.destination(url = "..."),
origin_files = glob(["src/**"]),
authoring = authoring.pass_thru("Bot <bot@example.com>"),
transformations = [...],
)
transformations = [
core.move("old/path", "new/path"),
core.copy("src/template", "src/generated"),
core.remove(glob(["**/*.bak"])),
core.replace(before = "old", after = "new"),
]
transformations = [
metadata.squash_notes(prefix = "Import:\n"),
metadata.scrubber("CONFIDENTIAL:.*"),
metadata.add_header("Source: internal"),
]
Terminal window
# Run workflow
copybara migrate copy.bara.sky [workflow-name]
# Dry run
copybara migrate copy.bara.sky --dry-run
# From specific revision
copybara migrate copy.bara.sky --last-rev abc123
# Ignore no-op
copybara migrate copy.bara.sky --ignore-noop
# Validate config
copybara validate copy.bara.sky