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

LocalRepoFinder and RemoteRepoFinder that allow repo name changes #5

Open
terabyte opened this issue Mar 1, 2018 · 0 comments
Open
Assignees
Labels
enhancement qbt impacts code in the qbt repo

Comments

@terabyte
Copy link
Member

terabyte commented Mar 1, 2018

Some open source projects have invalid repo names, such as with dashes. We can support this by making repofinders automatically translate a valid name into the invalid one by, e.g., accepting a list of rename mappings or a code snippet of a transform to perform on names.

The goal is to have the "bad name" be present on the git server and on the local filesystem, while the manifest still contains the valid repo name.

@terabyte terabyte added enhancement qbt impacts code in the qbt repo labels Mar 1, 2018
@terabyte terabyte self-assigned this Mar 1, 2018
terabyte added a commit that referenced this issue 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 #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",
        ),
    ]),
    // ...
);
terabyte added a commit that referenced this issue 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 #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
enhancement qbt impacts code in the qbt repo
Projects
None yet
Development

No branches or pull requests

1 participant