PolyRepo
Keep repos organized locally the same as on GitLab
Bird icons created by Mihimihi - Flaticon
Installation and Use
As a WIP, PolyRepo supports only the groups command, which lists a group and all its subgroups.
To install: pipx install polyrepo
To configure, create a ~/.polyrepo.yml file that looks like this:
gitlab:
host: gitlab.com
token: glpat-aaaaaaaaaaaaaaaaaaaa
(The token is optional if you're just pulling public groups/subgroups)
Then:
polyrepo groups gitlab-org
... with the path to the group you want to examine.
Proposed functionality
polyrepo sync steampunk-wizard
In a subdirectory called steampunk-wizard, clone all its subgroups and projects.
If a subdirectory doesn't exist, create it to hold the clone.
If a subdirectory exists for a project:
- Confirm that the default git remote points to the correct path in GitLab
- Optionally, fetch everything, including tags
If a subdirectory exists that does NOT correspond to a GitLab repo, remove it?
Output in text
/steampunk-wizard/busy Created
/steampunk-wizard/labcrawler Disjoin
/steampunk-wizard/mypyref Correct Changed
/steampunk-wizard/sandbox/ci-sandbox Fetched
/steampunk-wizard/sandbox/play-around Missing
Statuses:
- Created The repo did not previously exist locally, and now has been cloned and fetched.
- Fetched The repo did exist, and has been fetched
- Correct Was already up to date; no changes
- Missing There is no repo in GitLab, but there's a local folder with content
- Disjoin A local directory exists, but either isn't a git repo or has the wrong default remote
Then Changed means local changes exist, which could include
- Local branches still to be pushed
- Commits in a branch beyond what was fetched
- Local changes to be committed
Note that PolyRepo doesn't pull or merge anything, doesn't touch the working directory except in the case of creation, and ...
There's a .polyrepo file (optional) to specify the subgroups/repos to consider.
Questions
- How to handle moves of repos between namespaces?
- Any operation to polyrepo every namespace the user can access?
Development
make clear
poetry install
export GITLAB_TOKEN=$(op item get "Gitlab.com (personal) [2FA]" --fields label=/steampunk-wizard)
python -m polyrepo --config test/files/.polyrepo.yml groups steampunk-wizard
Metadata
Release files for polyrepo 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polyrepo-0.3.2.tar.gz | 3.5 kB | Without provenance | Details for polyrepo-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polyrepo-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for polyrepo-0.3.2-py3-none-any.whl |
Total release size: 8.9 kB
Release files / polyrepo-0.3.2.tar.gz
| Download URL | polyrepo-0.3.2.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da4444938b642168ebcf461b91c0bac3e27cea9a36a2b20c421cb4c37a490182
|
|
BLAKE2b-256 checksum How to use checksums |
cb06fc65e013c4d237cd8f7c86c2fe5ede892559471897ed4e9bbe9238074d30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.0 CPython/3.11.6 Linux/5.4.109+
|
Release files / polyrepo-0.3.2-py3-none-any.whl
| Download URL | polyrepo-0.3.2-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd366b48806c1647d7e6056bcb6eeb9bb7745c063adcb0b4604631d4263be38b
|
|
BLAKE2b-256 checksum How to use checksums |
0490d7772aee00583999c2017cd31d09cd7d8eb94bcf13127c4de55d53c58b96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.0 CPython/3.11.6 Linux/5.4.109+
|
Security for polyrepo 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.