From 525a0f943828410b213543d5da19aebc886bc3b1 Mon Sep 17 00:00:00 2001 From: Michael Hartmeier Date: Mon, 4 Dec 2023 22:46:00 +0100 Subject: [PATCH] repository -> storage --- CHANGELOG.md | 24 +- README.md | 26 +- .../java/net/oneandone/pommes/cli/Base.java | 2 +- .../net/oneandone/pommes/cli/Environment.java | 4 +- .../java/net/oneandone/pommes/cli/Index.java | 81 +++---- .../java/net/oneandone/pommes/cli/Lib.java | 9 +- .../java/net/oneandone/pommes/cli/Main.java | 12 +- .../net/oneandone/pommes/cli/Properties.java | 36 +-- .../java/net/oneandone/pommes/cli/Scope.java | 10 +- .../java/net/oneandone/pommes/cli/Setup.java | 10 +- .../java/net/oneandone/pommes/cli/Status.java | 6 +- .../oneandone/pommes/database/Database.java | 4 +- .../net/oneandone/pommes/database/Field.java | 2 +- .../pommes/database/PommesQuery.java | 22 +- .../oneandone/pommes/database/Project.java | 16 +- .../pommes/descriptor/ComposerDescriptor.java | 12 +- .../pommes/descriptor/Descriptor.java | 20 +- .../pommes/descriptor/ErrorDescriptor.java | 7 +- .../pommes/descriptor/JsonDescriptor.java | 16 +- .../pommes/descriptor/MavenDescriptor.java | 30 +-- .../pommes/descriptor/RawDescriptor.java | 15 +- .../repository/BitbucketRepository.java | 202 ---------------- .../pommes/repository/Constructor.java | 12 - .../pommes/repository/GiteaProject.java | 40 --- .../pommes/repository/NodeRepository.java | 227 ------------------ .../pommes/repository/Repository.java | 113 --------- .../java/net/oneandone/pommes/scm/Scm.java | 2 +- .../java/net/oneandone/pommes/scm/ScmUrl.java | 2 +- .../oneandone/pommes/storage/Artifact.java | 21 ++ .../ArtifactoryStorage.java} | 74 ++++-- .../oneandone/pommes/storage/Bitbucket.java | 121 ++++++++++ .../pommes/storage/BitbucketStorage.java | 100 ++++++++ .../oneandone/pommes/storage/Constructor.java | 11 + .../oneandone/pommes/storage/FileStorage.java | 144 +++++++++++ .../pommes/storage/GiteaProject.java | 45 ++++ .../GiteaStorage.java} | 63 ++++- .../GithubStorage.java} | 82 ++++--- .../GitlabStorage.java} | 88 ++++--- .../JsonStorage.java} | 31 +-- .../net/oneandone/pommes/storage/Storage.java | 91 +++++++ .../oneandone/pommes/storage/TreeStorage.java | 86 +++++++ .../pommes/database/ProjectTest.java | 2 +- .../GithubStorageIT.java} | 20 +- .../GitlabStorageIT.java} | 20 +- 44 files changed, 1032 insertions(+), 929 deletions(-) delete mode 100644 src/main/java/net/oneandone/pommes/repository/BitbucketRepository.java delete mode 100644 src/main/java/net/oneandone/pommes/repository/Constructor.java delete mode 100644 src/main/java/net/oneandone/pommes/repository/GiteaProject.java delete mode 100644 src/main/java/net/oneandone/pommes/repository/NodeRepository.java delete mode 100644 src/main/java/net/oneandone/pommes/repository/Repository.java create mode 100644 src/main/java/net/oneandone/pommes/storage/Artifact.java rename src/main/java/net/oneandone/pommes/{repository/ArtifactoryRepository.java => storage/ArtifactoryStorage.java} (77%) create mode 100644 src/main/java/net/oneandone/pommes/storage/Bitbucket.java create mode 100644 src/main/java/net/oneandone/pommes/storage/BitbucketStorage.java create mode 100644 src/main/java/net/oneandone/pommes/storage/Constructor.java create mode 100644 src/main/java/net/oneandone/pommes/storage/FileStorage.java create mode 100644 src/main/java/net/oneandone/pommes/storage/GiteaProject.java rename src/main/java/net/oneandone/pommes/{repository/GiteaRepository.java => storage/GiteaStorage.java} (73%) rename src/main/java/net/oneandone/pommes/{repository/GithubRepository.java => storage/GithubStorage.java} (76%) rename src/main/java/net/oneandone/pommes/{repository/GitlabRepository.java => storage/GitlabStorage.java} (76%) rename src/main/java/net/oneandone/pommes/{repository/JsonRepository.java => storage/JsonStorage.java} (73%) create mode 100644 src/main/java/net/oneandone/pommes/storage/Storage.java create mode 100644 src/main/java/net/oneandone/pommes/storage/TreeStorage.java rename src/test/java/net/oneandone/pommes/{repository/GithubRepositoryIT.java => storage/GithubStorageIT.java} (80%) rename src/test/java/net/oneandone/pommes/{repository/GitlabRepositoryIT.java => storage/GitlabStorageIT.java} (79%) diff --git a/CHANGELOG.md b/CHANGELOG.md index fec40efc..59cc859d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,18 @@ ### 3.5.0 (pending) +* node storage now only handles checkouts -- local maven repository or svn no longer supported * token handling * load token from environment POMMES_REPOSITORY_TOKEN_ variable, not file * github + gitlab * load github token from "git credentials" - * explicitly declare "§§" if repository needs a token -* default repositories - * the first repository defined in config is the default repository - * setup automatically defines default repository local = $POMMES_ROOT - * changed queries to only search the default repository by default; - prefix a query with "/" to search a different repository; prefix with "/" to search all repositories + * explicitly declare "§§" if storage needs a token +* major repository cleanup, they are now called storage. The config file changed accordingly +* default storage + * the first storage defined in config is the default storage + * setup automatically defines default storage local = $POMMES_ROOT + * changed queries to only search the default storage by default; + prefix a query with "/" to search a different storage; prefix with "/" to search all storages * simplified setup: * root directory is an optional argument to `setup` now * default root directory changed from `Pommes` to `Projects` @@ -22,8 +24,8 @@ * more robust: handle io exception to that user interaction can be continued * tweaks and fixes * normalize git urls to avoid conflicting checkout problems - * fixed repository scm for file repositories - * fixed RawDescriptor to properly set repositoryScm + * fixed file storage scm + * fixed RawDescriptor to properly set storageScm * pom loading: use developer connection instead of connection, because it's usually better maintained * do not abort on pom loading errors, just report them * build @@ -52,9 +54,9 @@ the former POMMES_HOME (i.e `.pommes`); default is 'Pommes' * renamed pommes.properties to config * property `checkouts` is gone, it's now configured via `POMMES_ROOT` - * renamed import to repository + * renamed import to storage * tailing `.git` in git scm url is now optional -* renamed zone to repository +* renamed zone to storage * fixed NodeRepository to detect raw descriptors in none-root directories * fixed NodeRepository to check for trunk/branches/tags only for svn nodes (because ~/Projects/branches confused it) * updates @@ -169,7 +171,7 @@ (and pushed for git projects) now, and it prints an 'X' status if the project is unknwon but in scm. * Improved action selection: return quits without actions now, a applies all actions. * Dumped -svnuser and -svnpassword options. Specify credentials in the url instead. - (I've removed them because I don't want special handling for Subversion repository authentication.) + (I've removed them because I don't want special handling for Subversion storage authentication.) * Improved find argument: use can use query and format macros; the format is appended now; you can merge duplicate lines '-fold'. Merged database-export into find. Find now has an optional output argument (which also accepts files now) and -json and -dump formats to print pretty-printed or raw json. diff --git a/README.md b/README.md index 5689f67c..cb773970 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This command searches the database for `lavender` projects and lets you choose b simply cd into the already existing checkout, choosing `2` also creates the checkout. Technically, Pommes is a command line tool that maintains a database with project metadata. Pommes can: -* index repositories (e.g. github or github) to populate the database +* index storages (e.g. github or github) to populate the database * search the database by coordinates, dependencies, scm location, etc. * perform (bulk-) checkouts for all projects that match a query. @@ -58,25 +58,25 @@ Install the application ## Managing the Database Pommes maintains a [Lucene](http://lucene.apache.org) database to store project metadata. The database is filled -by indexing so-called repositories. The database is stored in `$POMMES_ROOT/.pommes/database`, it's safe to delete this +by indexing so-called storages. The database is stored in `$POMMES_ROOT/.pommes/database`, it's safe to delete this directory to wipe the database. -`.pommes/config` defines databases in the form *repository. = {