Skip to content

destination_files behaviour #75

@mattem

Description

@mattem

I am attempting to use copybara to migrate many standalone repos into a monorepo, and use copybara to keep them in step while we are in the process of migration. However I am hitting an issue with the behaviour of destination_files, or perhaps my understanding of it.

The following in the config used

core.workflow(
    name = "default",
    origin = git.origin(
        url = origin_url,
        ref = "master",
    ),
    destination = git.destination(
        url = dest_url,
        fetch = "master",
        push = "copybara/microtime_import",
    ),
    ask_for_confirmation = True,
    destination_files = glob(["libs/microtime/**"]),
    origin_files = glob(["**"]),
    authoring = authoring.pass_thru("Copybara <cc@internal>"),
    transformations = [
	    core.move("", "libs/microtime"),
    ],
)

When this runs, it removes all other files in the destination repo, unless they are matched by an exclude in destination_files, which seems to go against the line in the docs:

A glob relative to the root of the destination repository that matches files that are part of the migration. Files NOT matching this glob will never be removed, even if the file does not exist in the source.

How can I get copybara to import from the the origin repo and only affect the destination folder?
Using copybara built from ea42789

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions