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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 macOS 11.0+ ARM64

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

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

silver_platter-0.5.22-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.22-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.22.tar.gz.

File metadata

  • Download URL: silver_platter-0.5.22.tar.gz
  • Upload date:
  • Size: 34.8 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.22.tar.gz
Algorithm Hash digest
SHA256 d379e802e5d8e0ce041d73b03724850abb36567c02d8d29ae5b626105c202fd9
MD5 4bfefc1f2ecc64e170ef96ad1f30066e
BLAKE2b-256 e03c93832862fd68d9359f4bb8aa781f043710588f898e0830cd96680e717e7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7632dff322c4feb3b2a5751e7944881ea027e615137db151f90ac8e4a0d4efa5
MD5 ac42e0e7a4dd88453d86d6defc81744a
BLAKE2b-256 1316e4fb2a0aeab4f6fb36bffe300b7b5c34cfbe296993da7a04aef5a8448343

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ed756c32f598fbcf548649c2279fe263e8a4c9012a18a3150d3975ed0a0d2988
MD5 60062a87d0c1640986746ff8729625ee
BLAKE2b-256 69010ed3635e6cfc3b65d167980072e4903d89430970934b5051049bdd257e4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 963f82f59152fe3235e45fbccf210b2845f398523437b9be00ebf23220e65ef6
MD5 3aa58311e1553359b5ac97271d94e6bc
BLAKE2b-256 cb1373301e0feaefb52a8efc1f9d7871f3e5f4ccf8e3ac7ef87b2ee0dabc9fca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc4110be3865611095e9de3e50d27988beaf36c18b97b1b173abc23fa60a5972
MD5 4a4e5706e37c9c10551f91945cf1316a
BLAKE2b-256 ef11a3bbf73ba27ca811486894e9a191b94f17b5199b419868afc102ef395e8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6ccd5e61cc1446781a2479d8ad749f6801ed859d028a3442aa5ebecb08ccc4e3
MD5 c378e6aa1307c8d5b7b6b152a20ebb90
BLAKE2b-256 c9fc81c9882948826670709c79c197785c174eb1894c6e021a7adbe924933712

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb95c9c8f1cae11effe36b24da5a2dcaff155c9a0ef5fed5fd6cbea05684817f
MD5 f5fbb7ceaf6a9c2ec0281edf0c6fb3e7
BLAKE2b-256 55de49207e360a580a3655089df63e9547132c48f230a8bc155c72b2e1af8a3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 70fc333eb0b6315ad6179017d8f8593f1c21eedcc4403efd11abee6c03df65f7
MD5 d4462c4d8fefee22658f57a6d84ce12c
BLAKE2b-256 d05cb92b68b5b02627f3986daee693f8fef9af8ee00629846e963d4f73be05cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 f3fcb5791cfd2a9bba934b983c367ac0570f11fbbeffebbe96504e0b24461590
MD5 0c78949f64b473f6754944e76f37abe9
BLAKE2b-256 11b8c57e3a3f830eba893ccd26d2f34d2c8a6ad215d024afecbee6883a223a1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75fec09a4a769b098e453f93a12425778d5fe6e35e8109d8e420666f920904f5
MD5 eff7b5a62738ff7bbcf5264e8e06f6f3
BLAKE2b-256 a50f6d1b516f46859ac8793344ef57ab2d548a94bf3f4b2b15bfcdcc3b8b7b91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9466842481b6f073766e81c746befd1fbc03cb153cc11f3828ce01f7f5e724c
MD5 f8dfbf3cd36fd39a0645c04492eb6ecb
BLAKE2b-256 660a2b8c897f49cc284497fcaacf62a3700ba8dc2987376544c2b69c4b1bd68a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b043cd126e3f0bb96406a3102dd670145be6f39bcf9be61e8e3839ed7ff60ed0
MD5 ef26d59151ba4f6cb3923233385429d7
BLAKE2b-256 45687c4ff35eb0c20d2b7bd42f7c96a9caa7036ab68c18d335027c467ff8e625

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b8a5e18d03fc6f8e7ef03b136fb795fbe25f423ce0fc450dc98c045fb80cc2ee
MD5 9d1fb7e15168f89e8a5df5b6b4dd729c
BLAKE2b-256 831676708bd1ce5afd67c90502eadaec6f23eede477b668fa09b7a86d64bb4e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fcc621d012e968b3dd0620803c1f3ceb50e7047fbb071e12460e5d1e5b513ab4
MD5 04f5413a0572d84a1ab7430bf119f382
BLAKE2b-256 0352179f7a4ec0e5949bd73a9a87cb5e4af03aa05d9d43f92e733e09a56d8239

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e4b07b206e1f3d3532cccdae3b4c56403f014bbdf55ad4f1b44fdb1a58a17e70
MD5 e28d56d28a92090748e36c3897678baf
BLAKE2b-256 e6f1de1d788b24158876a907ac337a6c755c9fedcd66bb29609035cc6ea074a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad485421b8a5416cd70a842b3a87903f8aeb039bdc08dce4a73e91e4fe9f7f2a
MD5 435368b70c17edc69f7e54865fdc8342
BLAKE2b-256 e87e337c32fe4b95d03aaa4e77ed404741eec67f1e20d3013896303359e1541c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 163aa4263df90f3914e90af70356d3e6c483c94832d49e25f85ad2e4fef6cf4f
MD5 b7b07ac67ae1c8cba19b06703acdb8f2
BLAKE2b-256 9af7730fea664f703694852ba80f96db2908a696fe0b18a74ea3907e142d72e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for silver_platter-0.5.22-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4c945ea2e8ac1b322a80d7b0d3104cb61285979281e9e5fedf859274b192afc7
MD5 77cf002b2f6468be953cd8328dde13e7
BLAKE2b-256 94df1f96b5b8d61684169fede0d8028fa318c026815c3b5da1b361160bf8ed6a

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