Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transforming LocalRepoFinder and QbtRemote classes. #7

Closed

Conversation

terabyte
Copy link
Contributor

@terabyte terabyte commented Mar 1, 2018

These classes allow the user to map a repo to a different name locally on disk
and on the server, allowing those places to use names which contain otherwise
invalid characters for repo names.

Resolves TerabyteQbt#5 and mitigates TerabyteQbt#4.

See commit message for example QbtConfig

These classes allow the user to map a repo to a different name locally on disk
and on the server, allowing those places to use names which contain otherwise
invalid characters for repo names.

Resolves #5 and mitigates #4.

QbtConfig might look like this:

Function<String, String> transformNames = new Function<String, String>() {
    public String apply(String name) {
        return name.replace("flume_ng", "flume-ng").replace("hadoop_lzo", "hadoop-lzo");
    }
}

return new QbtConfig(
    new TransformingFormatLocalRepoFinder(gitLocalVcs, transformNames, workspaceRoot.toString()),
    // ...
    new MapQbtRemoteFinder([
        formatremote: new TransformingFormatQbtRemote(
            gitRemoteVcs,
            transformNames,
            "ssh://git@github.mtv.cloudera.com/TerabyteQbt/%r.git",
        ),
        githubremote: new TransformingGithubQbtRemote(
            gitRemoteVcs,
            transformNames,
            githubToken,
            "TerabyteQbt",
            "%r",
        ),
    ]),
    // ...
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant