Skip to main content

Large scale VCS change management

Project description

Silver-Platter logo

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

silver_platter-0.5.30.tar.gz (15.4 kB view details)

Uploaded Source

Built Distributions

silver_platter-0.5.30-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

silver_platter-0.5.30-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ i686

silver_platter-0.5.30-cp313-cp313-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

silver_platter-0.5.30-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

silver_platter-0.5.30-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

silver_platter-0.5.30-cp312-cp312-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

silver_platter-0.5.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

silver_platter-0.5.30-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

silver_platter-0.5.30-cp311-cp311-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

silver_platter-0.5.30-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

silver_platter-0.5.30-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

silver_platter-0.5.30-cp310-cp310-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

silver_platter-0.5.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

silver_platter-0.5.30-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

silver_platter-0.5.30-cp39-cp39-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

silver_platter-0.5.30-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

silver_platter-0.5.30-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

silver_platter-0.5.30-cp38-cp38-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

File details

Details for the file silver_platter-0.5.30.tar.gz.

File metadata

  • Download URL: silver_platter-0.5.30.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

Hashes for silver_platter-0.5.30.tar.gz
Algorithm Hash digest
SHA256 83ea0d7c751450f9e1bf8b635d34047629bb70b45268a2b7b0169b7f2582cc96
MD5 28b82b8629c87893891bd6b0c1609050
BLAKE2b-256 6580ebe074893b9c23a647b0f72ae03bc0ef5f03908909af18eaa12e66a095b7

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0f989e80d0637bf9d8b0926a0792874bb672b3703d4b2163dc6627b19dcad085
MD5 e1b3840c9c4b0943e4dcb40bd52d7b15
BLAKE2b-256 dc8ae2398ec5500585310c0ad4685cc7c80b4e36d8f9b2ff30f5f51af6ffe822

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ba81679136cf3658e5da7c17333b9af3af4836ba76c29e2b170677c2de8875f8
MD5 208b3fd136fd0f839d5a30c71fdfef00
BLAKE2b-256 b633af701f749b69262e25f87dcbf1094afd6d12b53154d1f0130e1abecd837b

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a04391d59f61e15fb74ac90d2b2ce5087647883c5c6cab921ee2cef08184b43
MD5 f7333f1ba24a723b3ffe05a009987fc3
BLAKE2b-256 8d2dea008a8a2706f6fbd0f424ded1154bda684a15dce6e3fa664d8dcd25ea29

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a235a75a7b01a7fc5e1cedb540427ef3ea0fa0ac65e6a5870a3686b3556da22
MD5 4638b4e5e8865ab45f77a20d974b9485
BLAKE2b-256 ef08543779ecde0dd4a510bba11b523fd4d7b864670f4037c7e1b09709b9bc39

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 313d75e3df39680992ee03ad54a235c2093a323eeee585c3d4238f0745849c34
MD5 303479d5f05cad111595ca9bd8140de3
BLAKE2b-256 58e09e8d35df4cc32ba9ac502410c623619d629dc5fbb2017952d8c0319c35a9

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 40d387cc976394d511f7c663ba9191166ee9e88495a80f8aa6671a3ad61be7ed
MD5 9209e8e0ab4cdc5d57bde92770da1f79
BLAKE2b-256 4576aaed76fcf4d8762e0a2547debd712f74625cb8a734bebc922c8c77b832cb

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ebde38902cc11e3a865ff54393fdf519b7329b3d175ca66210c2f67602c4cc3
MD5 804b003f710fb11aed14add1235045c3
BLAKE2b-256 b7f70fe0add2e85c8e72cb8062519dd727468fe890bc8dbcc3f3ed7e245bad3f

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 9f58b20e23588711e005e08154509a0abb69043cf719573bd544169d36024790
MD5 90cfebee508521acba5f5de78793ce17
BLAKE2b-256 54ce0cec49194e233856e182c8d027ef74bde62da4559edf3d8f7313a78f3220

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 378285a96f97c22a61aa08b339a0d9fcdfa943ce958668b60ff72d3a10a775d0
MD5 39522b1c469b1e2ef771c11dd152a5dd
BLAKE2b-256 1f122f4e65b3af9ed8f1df5370117299a28a73420dfc48122525d2a24bdcced9

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72c823c8cac04b0b9fc08aaea2fa050d9affee38b2effb69027fc04d499001d2
MD5 b619cef22d18fe320ea7771210014d7b
BLAKE2b-256 bd84f2bdf408361233963ca2a0bf8a94814d213ca98f3f4916fce6351459859b

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 92919f4ea4cc12954cf505cab6c82af29d5a432dae22f1e2c312c5a6461ede12
MD5 d2578e5e9666011b3d95c2abd423f60e
BLAKE2b-256 7e1ee977ef1adb6e5c930e6770a75761e9e809fbe6ace670d7e6617089bc55de

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8f652c19f04c539e8516b07f224440c15eccef8f88c755384dbcdb0c1a22a0bb
MD5 a76ceb03d9dfa894e3532d5c71390d02
BLAKE2b-256 3f75f01338d04285f5ea84933541861a9d31dcff8695f81bdd1325ffc91dc595

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5650f1543f81cb0b623f545ea91abb3212e65d0424f1fb44c4ee693cae32c2b
MD5 86ac0032c408a4bf27d190f094d3a702
BLAKE2b-256 5b2a05298f4818df7c45a0b57035c5d536c9770eb2d2fc5084ee69766a464e24

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 31ed244b05ec270a073e48404dbe85719bcf154707f07ee22611d82d928cc64f
MD5 19500bfd3438f9a7b4e183d613ba6826
BLAKE2b-256 2fc5124f92f7400536f73fb1e0ae344d472b2daea27d2ee3a8fabef4588b819e

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3464c4bd11846a175d1a71bda844d1d03208a5913fcbf85394f25a3c402f248d
MD5 985589f3714e157ecf297861773e87fd
BLAKE2b-256 0a7a177a0924fb9ac75bae351a10b6dab404c71ae4419373ac953cf27fb6462b

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 538a49a92030c6bbb3b4ba31e895ffea9000eb4462b204bd6e7a7723ae0941a5
MD5 058aa8325a35bb3399ee519eaf1e6f2b
BLAKE2b-256 5387d6d053941a120a2dd9c45e7a30bb1c75bb2158609a98b77c86136735391f

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a18a52ad8e43bd80c9adf5432a7460ba70b2ef1f310e50ea5c811c0fbfcc03af
MD5 fcefcb4ebc8ce158ab1faa5b4afd89ad
BLAKE2b-256 89df092295c163ed415bea2f4e382942750c5ef4b2fd5f8ac70a8d0f02364006

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.30-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.30-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4bf2fec3ac61329206fe782b382c8e2da5cc8ace60417d9d8bcf18654d8d84f5
MD5 ca64079ce78b0d97b2d7a5d228e1e37d
BLAKE2b-256 ff62c6c4a8f4f5a2e8d943db8dc5055d8270c8b4eda8bf077d643350ebf93bf8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page