Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/anorth/rehab

Help with your dependencies
https://github.com/anorth/rehab

Last synced: 17 days ago
JSON representation

Help with your dependencies

Awesome Lists containing this project

README

        

# Rehab

_Treatment for dependencies._

Rehab is a tool for managing module dependencies, automating some of the manual labour required
to propagate upgrades and stay up to date.
Its goal is to bring some of the [advantages of monorepos](https://danluu.com/monorepo/) a little closer
for multi-repo projects by making it easy for all projects in an ecosystem to be working "at head".

Rehab works across many modules at once, but only requires one repository to be checked out locally to provide
a build context. Rehab can then work across the dependency tree of that repository. Rehab proposes changes by
pushing them directly to GitHub branches (optionally opening pull requests). Rehab doesn't rely on local build
environments or standard configuration of, say, Make targets; it instead assumes CI will check the correctness
of pull requests.

At present, Rehab works only with Go projects, but could be extended to other build systems
with similar module architectures (Rust, Javascript).

## Usage examples

### Show stale requirements
Show all mismatches between declared requirement versions and the versions actually selected by MVS
across a dependency graph. Also shows requirements on modules that themselves declare stale requirements.

These mismatches represent gaps in testing, where some module is tested with its declared requirements, but
is built for production with a different version of those requirements.
In theory, the build requirements are compatible (behave identically) to the declared requirements, but only
if programmers don't make any mistakes. The existence of tests suggests we don't believe that.

```shell
$ rehab show --all
github.com/anorth/go-dar requires github.com/multiformats/[email protected], builds with v0.0.14 (has stale transitive requirements) (highest v0.1.0)
github.com/anorth/go-dar requires github.com/ipfs/[email protected], builds with v0.0.7 (has stale transitive requirements) (highest v0.1.0)
github.com/anorth/go-dar requires github.com/ipld/[email protected], builds with v0.7.1-0.20210125211748-8d37030e16e1 (has stale transitive requirements) (highest v0.14.3)
github.com/ipfs/[email protected] requires github.com/multiformats/[email protected], builds with v0.0.14 via github.com/anorth/go-dar (highest v0.1.0)
github.com/ipld/[email protected] requires github.com/ipfs/[email protected], builds with v0.0.7 via github.com/anorth/go-dar (highest v0.1.0)
github.com/multiformats/[email protected] requires github.com/mr-tron/[email protected], builds with v1.1.3 via github.com/ipld/[email protected] (highest v1.2.0)
github.com/multiformats/[email protected] requires github.com/minio/[email protected], builds with v0.1.1 via github.com/ipld/[email protected] (highest v1.0.0)
github.com/multiformats/[email protected] requires golang.org/x/[email protected], builds with v0.0.0-20200117160349-530e935923ad via github.com/anorth/go-dar (highest v0.0.0-20211215153901-e495a2d5b3d3)
```

### Upgrade module requirements
Push a branch upgrading all requirements for a project to their latest version.

```shell
$ rehab upgrade
```

Upgrade instead only to the version selected by MVS, which may not be the latest.
```shell
$ rehab upgrade --minimum
```

### Push a release downstream (coming soon)
Push branches upgrading all stale requirements of a specific module across a dependency graph to the latest version.

```shell
$ rehab upgrade --of
```

### Upgrade a full dependency graph
Issue pull requests upgrading all stale requirements across a full dependency graph to the
latest version of upstream modules.
```shell
$ rehab upgrade --all --pull
```

Upgrading a full graph like this may result in new stale requirements as mid-stream modules are upgraded to the latest
version of far-upstream requirements. After releases are tagged or requirements declared on unreleased git SHAs, run
upgrade again to propagate changes downstream.