use of com.google.copybara.config.LabelsAwareModule in project copybara by google.
the class MigrateCmd method updateEnvironment.
private void updateEnvironment(String migrationName) {
for (Object module : moduleSet.getModules().values()) {
// We mutate the module per file loaded. Not ideal but it is the best we can do.
if (module instanceof LabelsAwareModule) {
LabelsAwareModule m = (LabelsAwareModule) module;
m.setWorkflowName(migrationName);
}
}
}
use of com.google.copybara.config.LabelsAwareModule in project copybara by google.
the class GitOriginTest method checkPartialFetchGitRepoName.
@Test
public void checkPartialFetchGitRepoName() throws Exception {
String migrationName = "test_name";
ModuleSet moduleSet = skylark.createModuleSet();
for (Object module : moduleSet.getModules().values()) {
// We mutate the module per file loaded. Not ideal but it is the best we can do.
if (module instanceof LabelsAwareModule) {
LabelsAwareModule m = (LabelsAwareModule) module;
m.setWorkflowName(migrationName);
}
}
origin = skylark.evalWithModuleSet("result", "result = git.origin(\n" + " url = 'https://my-server.org/copybara',\n" + " partial_fetch = True" + ")", moduleSet);
Path gitDir = origin.getRepository().getGitDir();
assertThat(gitDir.getFileName().toString()).isEqualTo("copy%2Ebara%2Esky%3A" + migrationName + "https%3A%2F%2Fmy-server%2Eorg%2Fcopybara");
}
Aggregations