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.24.tar.gz (34.7 kB view details)

Uploaded Source

Built Distributions

silver_platter-0.5.24-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.24-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (4.8 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

silver_platter-0.5.24-cp312-cp312-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

silver_platter-0.5.24-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.24-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (4.8 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

silver_platter-0.5.24-cp311-cp311-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

silver_platter-0.5.24-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.24-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (4.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

silver_platter-0.5.24-cp310-cp310-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

silver_platter-0.5.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

silver_platter-0.5.24-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (4.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

silver_platter-0.5.24-cp39-cp39-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

silver_platter-0.5.24-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

silver_platter-0.5.24-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (4.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

silver_platter-0.5.24-cp38-cp38-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

silver_platter-0.5.24-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

silver_platter-0.5.24-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (4.8 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

File details

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

File metadata

  • Download URL: silver_platter-0.5.24.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for silver_platter-0.5.24.tar.gz
Algorithm Hash digest
SHA256 9e3694259cc680476af97d909f2ad2e356289e1286a4ca097fadc68d52b1821b
MD5 7433e2b7c190cf9bd569daaf5554a82c
BLAKE2b-256 dc61becab4d11f1c3435e99bb8adcf3464377be88e9772c623e3073d7f53d1af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 398d177419e78df1320b0ea22bc23bf015943e2e223d391257305543261ddc06
MD5 df2224d4c00cc5cac9bf93dcacdc178c
BLAKE2b-256 9d6012aacf71d052fe393c78a4aaca5dc714504f425235361fcb1845fba0e602

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8edd001ed0cf2476c03c27fd0997e5a4aca5dc66906d5b2706a422c6248dd502
MD5 5e0d91b225708ac0577a61d4ec652083
BLAKE2b-256 e5da24863cb2d0b2efe8a25a5953c1bc89f8117b5cd765a6631bf4c131db11cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0722d9e41131dde217e467faba74a05093b7bc5b8b541eb6be0cdbd8d804789b
MD5 efe0072b032f531153c719b403c83a9f
BLAKE2b-256 150a951225d772e1f9c2dccb4b38ad120b7efd4a327fa2e554d139d3279b9c2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9569252b1ef79ed8edc348cd8897abe7df6980602ea36a9668e9fc0a63eda62a
MD5 885b241c658516b5d7aaf4de1bd3b5a4
BLAKE2b-256 308f9a249424f783526d0020be7038de2210f34f1004ae673043d8e7ae37bb2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 492906c9604c756bb1cefd00cbf9404cf00cf8eaf3efac3a01bcea8220a3c3bb
MD5 392f2f118eb0331f13e28cad5e509c72
BLAKE2b-256 4dacd0095ea178a4bca735d6260847663002d3e450889deaeec7129f7b18daf2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d720e54c1d9e0bc8b3fef5a793c758ccd713c75791c3143bee43cd980add7c8d
MD5 124e30d86c8ebc04b7b3e53330a6e918
BLAKE2b-256 4066b939fea5272f9082b34183d1b50d26ccfeb3b6036784c03b4cc26a0cbb08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7181327c16fe6063e623d1ed5880da88f6a81686421c8772c62914b56037eaf7
MD5 b4c9169ba0fa6103a59fc97807df8501
BLAKE2b-256 0b385d0186754affc39ce223de627f190f77a37694cb9fcfed7473c9bf52cc90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c43cd54e9d9293eb1c67bf8ae62fa5cf07a764ee877989f848e9ff2d49cabbc5
MD5 09abde50ff5724db0f5ae1475c1bf805
BLAKE2b-256 d142b1f28565c8e4e14ddbddba5c9b56ab99316fafc461849d7587db85cbbb3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5283dfaf1da1a2614424e7e15f490d4c011b27825759d0099bd53d0d3bbad35
MD5 db897b7708eefe56d0531721598403bd
BLAKE2b-256 57457e518de3b1e67aaba97860b6d968b36672822f429bb953e1f6e9c956d071

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 236f5e13ec94891e1375ff958d24d49448ea8e0e2ccd57342cd6acaccffb443c
MD5 9ab151a88cf98b28dd139c2ba8e9a02c
BLAKE2b-256 e4fa149eb4f0a79990c743094a4426a4f8e582cd7763909f8d5aad556731a69a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b2cb9f5ac5bf2cd3c228e8c83f6d5a463f6f979cde0b02d19632eb9f68d28bca
MD5 54ff473fa49b7732687277a80fbe858e
BLAKE2b-256 c39008e9bf229ba32cc6aac3233cdd4e2e7299c98c9886f03b3593229aa1c10f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a35dc0228900fe657a5a21fc211d3cb5959570bbbd638a2953fd82e7d74c0fe
MD5 adb9cb5ca3512852952726d9a80760ca
BLAKE2b-256 497a6331d299757156815411abb12c6618e537480a893a138f87cd59d7a4bdc2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 62e46ac2060c00e2717fdf928bb31c65c41a726dab3820344053892a50e6722d
MD5 614aaf9686ef06d15b484c242e14f42e
BLAKE2b-256 c38df05c21575185a043b130da49dac491e5cc981c0b8e0d8efcbca15c01f31c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b8122968dbd76bc74a48ae69bf96983078ff703dcb4feaabaac270e760312902
MD5 de31edef26ee037cbf783e04a80a12b9
BLAKE2b-256 52785c830d47a6bf2206ea17dc145b285b5183abdc0e68f662ef90469d54ef92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 05bb90713ae7fb4ac8e983702a8b057aa44e077a610077622dd9c9f2ae661364
MD5 ca3be37d77e48248c21692488a632409
BLAKE2b-256 e431682c60911105ccefe0283e4726fa12a97c65fd396d200c53f0d2b3d2e7e8

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.24-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0a20e8890a615a574403d36ab5c159904485af1c120c0cea3da6b64dfc8a35f1
MD5 bce0caefbfc8dd3232137f052c6e61a7
BLAKE2b-256 2d954eea667afbe02417711057f5b387289d7e6f6d5bac90b0fa5c6a0d55f8d0

See more details on using hashes here.

File details

Details for the file silver_platter-0.5.24-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for silver_platter-0.5.24-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a43b1d0dd11a810a9b10cc5119936fc625d71fea7f9bf6ad210efca5f7b712c8
MD5 fce94a9ece557ecf825329ff9415d896
BLAKE2b-256 56a4ff244c5097345aa8badfc92894c7096a8a8fcf8d62b97c6e08b44f1e89b7

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