line/centraldogma

Provide an easy way to import a directory into Central Dogma programmatically

オープン

#963 opened on 2024/06/19

 (6 件のコメント) (1 件のリアクション) (0 人の担当者)Java (133 件のフォーク)auto 404
good first issuenew feature

Repository metrics

Stars
 (664 個のスター)
PR merge metrics
 (PR metrics pending)

説明

A user often needs to import the files in a filesytem into Central Dogma for testing. At the moment, a user need to create a project and a repository, build a commit and push it using the client API. Their life could be simplified a lot by providing the APIs like the following:

public interface CentralDogma {
    // Imports the files in the given directory into Central Dogma.
    // First component in the path becomes the project name.
    // Second component in the path becomes the repository name.
    // e.g. foo/bar/alice.json will create a new project 'foo' and
    //      a new repository 'bar' under the project 'foo', and
    //      add 'alice.json' to the root directory of the repository 'bar'.
    //
    // Placeholder files like '.keep' and '.gitkeep' could be ignored automatically.
    CompletableFuture<ImportResult> importDir(Path dir);
    CompletableFuture<ImportResult> importResourceDir(String dir);
    CompletableFuture<ImportResult> importResourceDir(String dir, ClassLoader classLoader);
}

public interface CentralDogmaRepository {
    // Imports the files in the given directory into the repository.
    // Placeholder files like '.keep' and '.gitkeep' could be ignored automatically.
    CompletableFuture<ImportResult> importDir(Path dir);
    CompletableFuture<ImportResult> importResourceDir(String dir);
    CompletableFuture<ImportResult> importResourceDir(String dir, ClassLoader classLoader);
}

コントリビューターガイド