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

Uploaded Source

Built Distributions

silver_platter-0.5.35-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.35-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.35-cp313-cp313-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

silver_platter-0.5.35-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.35-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.35-cp312-cp312-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

silver_platter-0.5.35-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.35-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.35-cp311-cp311-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

silver_platter-0.5.35-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

silver_platter-0.5.35-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.35-cp310-cp310-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

silver_platter-0.5.35-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.35-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.35-cp39-cp39-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

silver_platter-0.5.35-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.35-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.35-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.35.tar.gz.

File metadata

  • Download URL: silver_platter-0.5.35.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.35.tar.gz
Algorithm Hash digest
SHA256 9e3ecbb44d3e94897157918ac6d2e040fb05d12ea33f110a81f3f4826a882dfd
MD5 dcedb6e0bd90793fefa5d9a3610d38d2
BLAKE2b-256 8e29c1e8999e2dd3f69af2bc65d4cb64104c45f7b4859a27482a0ec3c0b99ce2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 03190ce68096138527b0cf2cc55da55362c17613156b1a5dabcec209d22ad19c
MD5 dcda15fd1628d3bcf54a6644eac48d55
BLAKE2b-256 47ec1f9a77eb77c3cc6786b2948a41f0a90e187ac94bdef26c7496dcecf11181

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 cf9a2c7fc2cb552d6b439f2fca855b3d622e558ecddc0b21858a098b892f74c9
MD5 2e87d208b862feddd911da1265f0a93f
BLAKE2b-256 20da1d3380442df8ccc081bef0c8c577946408099b5717903c98dd09642b59f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f902cba9a1300c8571cbdee512d696c9bca9244a8ead1eacb877cdff3dcd21c4
MD5 cf1533b0be652523f7d186e1dd060f19
BLAKE2b-256 2aa295bbf948227791a4aaf5ff827f231d3082e3f3dc0a4b33d5aa8c5490f110

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 94e5f8b8e91c14c95196400a2dcccc9a6f75cf6fb5e7f6e4effd4e3b708238f5
MD5 ddff5f4b0b9836e83a18bb41b15ae162
BLAKE2b-256 5a050e31e060829ee9c93ce2ad4e4f6564a28ae5113aeeae92376435d98d5506

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 28bdc2a8436c475aefec2fce6cc4e4cb4bd159ec84ba649b1b10e92e73a3133c
MD5 409437810fcbe60db3d1c20fecdce960
BLAKE2b-256 c026893c0c9aabce52c74ef3f22f3f591a92f3e28c85328cad53241b15956a2b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d3e2494452597cf4a90eeb69b0512b891734c25c6c472fc7646e15447317b48e
MD5 d7a1455434a2c7cb0f6349fa8d880487
BLAKE2b-256 2b581d85e36a0577c11122d413c7f9389596183b4859a7eed39198cd2ecd725e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d7bec3b0136f9cf84c665909d04cae961bcef7dc462b67498f2e46b6de35c931
MD5 ae33b1defe71c9cc8d7f85c8f80eba39
BLAKE2b-256 ffab5654137bbdba7633e3f1c5be47411179c949ebada11345cc202dfad4e501

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 fe67b8f43b9e7038ebd1e32fec36e4317dfeaab8e185569f58972d536b66c2cb
MD5 42279f878168195b13b9a05586a98c07
BLAKE2b-256 897289b68ecb042a8cba58d8b0785b8049cdf377550ba50667d5a10b58619fc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c36d17e1d94c2f81f9504604d65adf3db8d389110ce7ab6c9b4d260c56943b45
MD5 1d72d394a8d963fc84053e6c32f41f7f
BLAKE2b-256 0822038ed0cf90e1a5c9828aff8d317a4264e70ba47d9bfe5de4a5eb3af11328

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 84349880df9352be70596af36a2b16ea6619989236f3f478bdc57d74ffbcd18b
MD5 131a7ff6835bcf1cd39074d55080a6f5
BLAKE2b-256 480ef4981d875378487b12bbc08098df5a06479d51f8ef91958ce8178f4dfe73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e8df2e11e37fc3b0733f2b374dc30dd8408f3bc8dd4f3f62b93d384ae6380d51
MD5 7941610f6c96b5c7010c32becc8224f8
BLAKE2b-256 f624685c0a6df63155152740e44e7f918887ad8c32263f0d84c3a2d70496b23e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d11418d06b7038940d5a9f12793ba213faad467256fca6b6e58678b4834632d4
MD5 b906f408a6376e2b585ebbf27cc10afc
BLAKE2b-256 43039cec8d1bd300cc2587e09756e4993a30865b5929a70e1ad74a14b42f9685

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be0bc94312a63162ac18145549bdeec643501b39b90f95a1176d8a32c2795939
MD5 9ab013abecd39ba81d9c1f4086a54acf
BLAKE2b-256 958062b862b705667a0137f8ff40c08a191d8a933d23486e1a6f85a1983d659c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 bfb38482b290f74873146f5790df77254982a2a62fe62f08442e5f7593b6355a
MD5 c31c6c49d54c64bc9e59fd83d1a3a24e
BLAKE2b-256 465ab887fd9e35387193b53c484de1e925e2bf03f3ee9f133e9f7a8b7772b1da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6553b850fe6bf3c594b4156ee127418fc782e7a3e196360be8fba21e1aaa1f35
MD5 62205c7ea32e0586b08cf7eb573eb940
BLAKE2b-256 eeab2e7ad8887d6ce019df338eb97e7963d0745cb91fdcb664da081307256e89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18c3463577a0c13c0a173edca0e5ad04151b0f407423070a32aa05def810c000
MD5 ffa52c20c3a60e85c861cda066129d46
BLAKE2b-256 a7b02b694541cdea0085f38973b2577523bde4d83844ed2bc827c72057dd8a98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 496d5024052fd723e01fe23f3ae73f1c4d84494403f80ecbdf90948414b89b50
MD5 161a2757266837d29331e57b2d6d39bf
BLAKE2b-256 f6695cadfbaa60a59d51622204c2fa5ada06337a1b1c084ee0d811df42fb8311

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.35-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8a4a4cfbfe4b9407d8dc39515cca394e1bcf6ac69c6c2abbe231c174421ba26c
MD5 82b6f548e9b1d4d9763f665eeb52853e
BLAKE2b-256 441c783c7f3288b8e149ae38f3c8c65947f1a8fc14e3acfb3c9f2c6175e1488a

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