Large scale VCS change management
Project description
Silver-Platter makes it possible to contribute automatable changes to source code in a version control system (codemods).
It automatically creates a local checkout of a remote repository, makes user-specified changes, publishes those changes on the remote hosting site and then creates a pull request.
In addition to that, it can also perform basic maintenance on branches that have been proposed for merging - such as restarting them if they have conflicts due to upstream changes.
Silver-Platter powers the Debian Janitor (https://janitor.debian.org/) and Kali Janitor (https://kali.janitor.org/). However, it is an independent project and can be used fine as a standalone tool. The UI is still a bit rough around the edges, I’d be grateful for any feedback from people using it - please file bugs in the issue tracker at https://github.com/jelmer/silver-platter/issues/new.
Getting started
To log in to a code-hosting site, use svp login:
svp login https://github.com/
The simplest way to create a change as a merge proposal is to run something like:
svp run --mode=propose ./framwork.sh https://github.com/jelmer/dulwich
where framwork.sh makes some modifications to a working copy and prints the commit message and body for the pull request to standard out. For example:
#!/bin/sh sed -i 's/framwork/framework/' README.rst echo "Fix common typo: framwork ⇒ framework"
If you leave pending changes, silver-platter will automatically create a commit and use the output from the script as the commit message. Scripts also create their own commits if they prefer - this is especially useful if they would like to create multiple commits.
Recipes
To make this process a little bit easier to repeat, recipe files can be used. For the example above, we could create a framwork.yaml with the following contents:
--- name: framwork command: |- sed -i 's/framwork/framework/' README.rst echo "Fix common typo: framwork ⇒ framework" mode: propose merge-request: commit-message: Fix a typo description: markdown: |- I spotted that we often mistype *framework* as *framwork*.
To execute this recipe, run:
svp run --recipe=framwork.yaml https://github.com/jelmer/dulwich
See example.yaml for an example recipe with plenty of comments.
In addition, you can run a particular recipe over a set of repositories by specifying a candidate list. For example, if candidates.yaml looked like this:
--- - url: https://github.com/dulwich/dulwich - url: https://github.com/jelmer/xandikos
then the following command would process each repository in turn:
svp run --recipe=framwork.yaml --candidates=candidates.yaml
Batch Mode
Use batch mode when you’re going to make a large number of changes and would like to review or modify the diffs before sending them out:
svp batch generate --recipe=framwork.yaml --candidates=candidate.syml framwork
This will then create a directory called “framwork”, with a file called batch.yaml with all the pending changes:
name: framwork work: - url: https://github.com/dulwich/dulwich name: dulwich description: I spotted that we often mistype *framework* as *framwork*. commit-message: Fix a typo mode: propose - url: https://github.com/jelmer/xandikos name: dulwich description: I spotted that we often mistype *framework* as *framwork*. commit-message: Fix a typo mode: propose recipe: ../framwork.yaml
For each of the candidates, a clone with the changes is created. You can introspect and modify the clones as appropriate.
After you review the changes, edit batch.yaml as you see fit - remove entries that don’t appear to be correct, edit the details for the merge requests, etc.
Once you’re happy, you can publish the results:
svp batch publish framwork
This will publish all the changes, using the mode and parameters specified in batch.yaml.
batch.yaml is automatically stripped of any entries in work that have fully landed, i.e. where the pull request has been merged or where the changes were pushed to the origin.
To check up on the status of your changes, run svp batch status:
svp batch status framwork
And to refresh any merge proposals that may have become out of date, run publish again:
svp batch publish framwork
Supported hosters
At the moment, the following code hosters are supported:
GitLab instances, such as Debian’s Salsa or GNOME’s GitLab
Working with Debian packages
Several common operations for Debian packages have dedicated subcommands under the debian-svp command. These will also automatically look up packaging repository location for any Debian package names that are specified.
upload-pending: Build and upload a package and push/propose the changelog updates.
run: Similar to svp run but specific to Debian packages: it ensures that the upstream and pristine-tar branches are available as well, can optionally update the changelog, and can test that the branch still builds.
Some Debian-specific example recipes are provided in examples/debian/:
lintian-fixes.yaml: Run the lintian-brush command to fix common issues reported by lintian.
new-upstream-release.yaml: Merge in a new upstream release.
multi-arch-hints.yaml: Apply multi-arch hints.
orphan.yaml: Mark a package as orphaned, update its Maintainer field and move it to the common Debian salsa group.
rules-requires-root.yaml: Mark a package as “Rules-Requires-Root: no”
cme.yaml: Run “cme fix dpkg”, from the cme package.
debian-svp run takes package name arguments that will be resolved to repository locations from the Vcs-Git field in the package.
See debian-svp COMMAND --help for more details.
Examples running debian-svp:
# Create merge proposal running lintian-brush against Samba debian-svp run --recipe=examples/lintian-brush.yaml samba # Upload pending changes for tdb debian-svp upload-pending tdb # Upload pending changes for any packages maintained by Jelmer, # querying vcswatch. debian-svp upload-pending --vcswatch --maintainer jelmer@debian.org # Import the latest upstream release for tdb, without testing # the build afterwards. debian-svp run --recipe=examples/debian/new-upstream-release.yaml \ --no-build-verify tdb # Apply multi-arch hints to tdb debian-svp run --recipe=examples/debian/multiarch-hints.yaml tdb
The following environment variables are provided for Debian packages:
DEB_SOURCE: the source package name
DEB_UPDATE_CHANGELOG: indicates whether a changelog entry should be added. Either “leave” (leave alone) or “update” (update changelog).
Credentials
The svp hosters subcommand can be used to display the hosting sites that silver-platter is aware of:
svp hosters
And to log into a new hosting site, simply run svp login BASE-URL, e.g.:
svp login https://launchpad.net/
Exit status
svp run will exit 0 if no changes have been made, 1 if at least one repository has been changed and 2 in case of trouble.
Python API
Other than the command-line API, silver-platter also has a Python API. The core class is the Workspace context manager, which exists in two forms:
silver_platter.workspace.Workspace (for generic projects)
silver_platter.debian.Workspace (for Debian packages)
An example, adding a new entry to a changelog file in the dulwich Debian package and creating a merge proposal with that change:
from silver_platter.debian import Workspace import subprocess with Workspace.from_apt_package(package="dulwich") as ws: subprocess.check_call(['dch', 'some change'], cwd=ws.path) ws.commit() # Behaves like debcommit ws.publish(mode='propose')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file silver_platter-0.5.36.tar.gz
.
File metadata
- Download URL: silver_platter-0.5.36.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8827031392d3fa00c36bc029a6674d48f22c14681d123c23d62e8ca036e09684 |
|
MD5 | 4da6f441734bac990f3e11b250d591af |
|
BLAKE2b-256 | 02185a3a25d20af121851c82c315f94a5586117b59a2b9526ba6f7ec287a7025 |
File details
Details for the file silver_platter-0.5.36-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59547db3d8e82d7f87d92d62676a8c02cae63c8513a3f55e0dbdc1dfbf9b73fc |
|
MD5 | 283b5b3c3d96727c4a2ddf75bd16cd57 |
|
BLAKE2b-256 | 667989346d5ef15da9d8b25c7a5212335d9cd07a7e98d23855c0fea67aa8dfaf |
File details
Details for the file silver_platter-0.5.36-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec7a119a4ce79d6ddeed4057a9218049663f3dbfd57bc98adad348186a62de1e |
|
MD5 | 420dcdcae383932fbe187872bc8cd86e |
|
BLAKE2b-256 | 57a9f73d1cfd0ef97c3a75b7ee7c1280e30dc76007869993e3824525b4de07be |
File details
Details for the file silver_platter-0.5.36-cp313-cp313-macosx_11_0_arm64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ca741aa6b465a34f6d6e5439f91e78d606ed8c02d5490f2317425afd5b89d2a |
|
MD5 | 90194567160accc42d51d6e5bd2aa46c |
|
BLAKE2b-256 | 251a523a9459b9b571f7a5b18ca12b0e805a2737222ea026b97d2a06cfaacaf9 |
File details
Details for the file silver_platter-0.5.36-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbb0abf5744140a838d94cb520e741a822f3b557c2664b6b489ff855e7df0f4d |
|
MD5 | d1ea1ca518d8885bb53bd82838e284f1 |
|
BLAKE2b-256 | b8570dd7ab93aa92961b80572dc4c1d72cdbbfa1565cd410b8eac8a3a14d3f9b |
File details
Details for the file silver_platter-0.5.36-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 972946181d1f72a7197899ed18ea9e9de4dd0c2f498be77466faf340cce64ce1 |
|
MD5 | 8500cee0ed3859eb015ec32048a7fc2b |
|
BLAKE2b-256 | c3d2dec1a2da97364f37d3b5576aaa3af22db9329d584133f280ee99f4d35fce |
File details
Details for the file silver_platter-0.5.36-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77d81c58bf04a1ca02877d9c553f75e1578799ff789d9139efd06aa9687b8ad5 |
|
MD5 | cf7900419131cb4da3d7f63518a2aaac |
|
BLAKE2b-256 | e873b6d3bbd012039653614ac09bcee473d48656f3f60147afd9b7247ca2ebc5 |
File details
Details for the file silver_platter-0.5.36-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 495eb01a4af09ef76158e5014426279c3c763a3baf9d63badcd9d8a3c411ff6f |
|
MD5 | 80642e9813d4feec598f72649259a0db |
|
BLAKE2b-256 | 6393d2a2033343856fdce8ef57cf5c01e1fd9fae6023af64f6ec79527ade299f |
File details
Details for the file silver_platter-0.5.36-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f172a128f577e9fac0ea81322c395576fca77bf84c1431fb4675ebf03baaf14d |
|
MD5 | f6dab07495fa61b2743ea301ba2044f5 |
|
BLAKE2b-256 | be2a62503923bb86eb859ee6df5219bfc6c4c5cdb862c5fa69c6089a5f54d569 |
File details
Details for the file silver_platter-0.5.36-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f559e3dbc150eaac6f5a5c423137fa7fe89fc831b0e9a7e64a47e4df063851b6 |
|
MD5 | 4e7567111ffa6cc4f4d4ae4eed8762b8 |
|
BLAKE2b-256 | 03470117efd8732ea6b766e03224556ba09dbed940cd5f0b60f6195ac5155a49 |
File details
Details for the file silver_platter-0.5.36-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b80ae6044f76d895330bf19103ea77a2d9a74c69aedc51decc47f7f1e8ddd294 |
|
MD5 | ccb68c3f067bce84da81ad6923d23f24 |
|
BLAKE2b-256 | eb7fec2472acb7f6fbcffa333b3a4b3cfce1a2bedb74b20c2f321342c6c92394 |
File details
Details for the file silver_platter-0.5.36-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be644bd07fcd3836abecf0b0cde64fb0d04491d31191cb813d9483eaed2e2874 |
|
MD5 | 26e73eace818820f90bef7279d0cadea |
|
BLAKE2b-256 | d17b7e26db7021c9d67ac8d401e9efb481559f4bf1c32be8f47b0db223ce3cde |
File details
Details for the file silver_platter-0.5.36-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa2f6ecf9058431ac0f9af8ad6bd1fdb391b60fbfd22ee43dafcb63eca7cc415 |
|
MD5 | 68b30c2b5d9efb8158b32fc756812234 |
|
BLAKE2b-256 | f523a1cd9fca24b4b9379bbe1c647f7e7488b553e97b99ab78ce137361a98611 |
File details
Details for the file silver_platter-0.5.36-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06b593c5f2bab4952cb1b8986e4b0c89eee3eb3487004a4b14a1cedd57eafd63 |
|
MD5 | c129d33a6c0d3b8f2ea09967a07eebcf |
|
BLAKE2b-256 | b1021efdee194890139b5fcb878bcc1b6bd41be98511e1df0dfebac9bfef4418 |
File details
Details for the file silver_platter-0.5.36-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b27ad2111ded1efc222a7755ccd8bdb77c34d9dfd7ee0b23219aa3413f7133bb |
|
MD5 | ca0491902c7f5a0b17fcf2d6d6187ae1 |
|
BLAKE2b-256 | 4edf6cdde11702e451f741da0deaea948f549cf2dd01570548c0031fe94015be |
File details
Details for the file silver_platter-0.5.36-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dcbb955327ee077e587014bf24b64a9e412637fa86cd6aaf6bbabc21139e92a |
|
MD5 | 0eaef5431a45849237fec3a5c5647853 |
|
BLAKE2b-256 | 1851dfbd159580558bc85c4d93bd568863ad221e1d79cbb1d2c574f145fb662c |
File details
Details for the file silver_platter-0.5.36-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d264b6f6a7629f619c17c6eac165c0ff61cb3832b89c5aa8a1d8f848e5c185a |
|
MD5 | ecb8f73d223480c68295c8bd3b9e3ca9 |
|
BLAKE2b-256 | c0892982fb3fce6040064ff292562baf429929236e491436d02ee94997baea40 |
File details
Details for the file silver_platter-0.5.36-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cb5470dc86de3298653c15bc85d4e937b1ffca0cbb89a224dd5f2dc92b3f469 |
|
MD5 | 00e304c0ab5afaaa23bc5c3459d6ae3b |
|
BLAKE2b-256 | 653ebf16360fa92c2a6c40e1aac19f7f78556723efff65af21e3510e6345acb0 |
File details
Details for the file silver_platter-0.5.36-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: silver_platter-0.5.36-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c753bae6a111f4e86dc5c972a252aac18a78c7f1d674a3e904e3119fc26752e6 |
|
MD5 | 23fa1b5381ddb4ee8c6a46150d766b05 |
|
BLAKE2b-256 | 627531e9627b1842a7c039eb907d583646c2fa57d96dfd196a54e6220d0702ea |