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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 macOS 11.0+ ARM64

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

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

silver_platter-0.5.23-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.23-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.23-cp38-cp38-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

silver_platter-0.5.23-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.23-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

File details

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

File metadata

  • Download URL: silver_platter-0.5.23.tar.gz
  • Upload date:
  • Size: 26.6 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.23.tar.gz
Algorithm Hash digest
SHA256 36bb83f6578c2ea505fc816690d22ccf2b1fa329304339072a153b3d79643dae
MD5 c435bea9dcdae3e1366bf396bb04c6e1
BLAKE2b-256 15ae195c2ce90157c3f2df769c08035f833b406281d5ce79e062fc9622aa2a45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 647dd1543e1d7dbb67ef7d6b210a4011638e3e22c017d7e85c959e9c9c00f142
MD5 5ab9a181009549ba8a3abda559a59873
BLAKE2b-256 500d92697ef7f2ed1096e1770b00e1a232bcc93262dcbfdc076e14eb2229960b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4b70b4f22bc0c18875e77299e5021d99e97bff213511bc6251abd9f4e35a8847
MD5 bdb1f98fb02510eb765b7124799b9deb
BLAKE2b-256 796b572e81f76893bc3a87f38e4aa37be6bbda511aa773c62ddea936f79b816d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3dc14acaacae68bf8eb2e802d886c816eb118baf5aabf5f258d304e3cf795658
MD5 235842417b675fb07196688efb878330
BLAKE2b-256 3d0637a0a6586050e22d949a426bf85dc3465bfa77a867c97b0e53722fac3761

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ccf36d06db7410c01c3a7991a4be98968cdf6e83ed35e2cbe7e0cef49813c9ee
MD5 d42af126cf55872d193c892e96d6e56a
BLAKE2b-256 bf7ebcb686069f2d1849a950116a535534a5a3dc99bb074b9be2bf194485976d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 90f60bf871883a0412173771116465d123ece555befc8525274ea155ebfe8996
MD5 cef8f8fa4933d76d752d764b9cdf7568
BLAKE2b-256 42e296dc70d4614788753349acf5ed77aff222ffc6c8d95ea26ce0a45a9a8794

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 643d2c802c561e293ba518cb4ecd0496bc816de82fcb2f8d23a3df870c3576a7
MD5 862531349516c458816b3b7da03a94eb
BLAKE2b-256 19d30e05171fccfb68b349fa838042a12d67da9034ab73f1bb40d9c37c759d32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d57a0d18a5e6e42578a55814ced8abda7e2b1990612afb76d3f0c38c9808204
MD5 eebf0c240b1e8a925bb90b03a720c25a
BLAKE2b-256 5ece66275330aa120b05d25035527a63264a0dd0c6e0d094081ef80899c15bdb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 71dcea81a27512fafdebf4f75b40fc2a93383a968bb3ecfff522c7b69a1668f7
MD5 4972b66008aca2f41a2332b048a9657e
BLAKE2b-256 9be771cd46864c7a89c340c701db4be91dd5ee30a9a4a1395dfa1b6cb6c8c59e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67159da8dfd5222b41b81f104b4eae26353be50d1556b47bc06bdb1a8b300c33
MD5 4e3c794108a18c9fdce9f431b08a88a7
BLAKE2b-256 2717e44eace62323a9d759214a026fda5084e3410cb6cd563da4485afd826abf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 86b962f0b4d6dd9e8ac674c61e426f0f86bce36f8ecfafc46aa594034b80d3c2
MD5 8fe860bc7544c95908a72d60b44ed065
BLAKE2b-256 061584a9450d6cac6f7261c1f6d062641861f18fdc0db1d9db1e92070093bff1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 9a77c52dba3c2fe6c1d2c86b93bbf6e68a69276d59cab2f6311dc37cc432b2e3
MD5 86bd796c7d3dc3413648e2ccd5a33f2f
BLAKE2b-256 20a6a42d03c4bb3127a6b6a38d319364f190da6beddf75bcf304612eb9d3306a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa19e35f7f4ab4ddfcb6f73a22872497c94b3cea886d1975d081427d6d9211bf
MD5 d91efb7e8cb524ab7c2634ea42893881
BLAKE2b-256 d8d54bd228d910f59d2911365539f13f710f31fd9be417525a3bb692d6f07e35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 91b1988c16863a326e13c7b4062e08aa15dbdae0473ea3949afa94f60d823b8e
MD5 cab45b66245a4497d0e140e36b64891a
BLAKE2b-256 9eff53e7205ee3f65234d2c36defd65cbc89a665446bd2ce05639fda98163640

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 df6eb0bb6f9cc1756d20eaed0c43ef9a693e68c219d2d2051eee6dd569028220
MD5 175d6378eb292f0ce5a1f6c142500c80
BLAKE2b-256 6d21051e6dd46177a59fc6aba2f012c162ecca0dd15d656acd658c3414d9cb9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be9c9e4b1686a6004fb83d679fbf66bfa651ca10a4b6813be27acaefff78a971
MD5 6be0668dafba9ad167002e2cea188253
BLAKE2b-256 bf54f63cb66b1031145c7eb8ae4e38feadb0da005e9c9c42ffe7acbd12575dd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1628ed172c5cdc74a49c91752350887ab0f83ee4ac6c5c93343d9e37c13741d8
MD5 0b94799770a797021f81c75286dc0c63
BLAKE2b-256 6ae21bdcf87c74d3dafd4e6b5fc508bfa0a36a42a3c6978e0954c7f5f147dbae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.23-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2ec753818d9e4a3edafda660e299e587a92d579b7652b3f7a1ef3fe89b8406fe
MD5 b070ebdfe6f7f16a0a9cb819c2c58711
BLAKE2b-256 d857eb05abfcd51aac871c31ca285d477c657f07b3d37b914e6874d099c1b3ab

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