whatships
What ships with this promotion. Before stage is merged into main, whatships reads the
commits between them and writes down what is about to reach production: the pull requests, the
database migrations and what each one does, the infrastructure changes, and the settings the new
code expects. It runs in a second, needs nothing but git, and posts the answer on the pull request.
$ whatships --base main --head stage
What ships: stage -> main
3 pull requests, 1 commit without one, 2 migrations, 6 infrastructure changes, 2 new settings
Needs a look before promoting (2)
!! apps/orders/migrations/0002_drop_legacy_ref.py: Drops the column of `order.legacy_ref` with its data. Code still running on production from before this promotion fails once the migration has run.
!! aws_s3_bucket.invoices: Looks renamed to `aws_s3_bucket.invoice_archive` without a moved block: Terraform destroys this one and creates the other. A `moved` block from `aws_s3_bucket.invoices` to `aws_s3_bucket.invoice_archive` keeps it. It holds data.
? `main` has 1 commit that `stage` does not (a hotfix, most likely). What was tested on `stage` did not include it: merge `main` back first.
? 1 commit reached `stage` without a pull request.
...
The same report as the comment it leaves on the pull request (all of it):
Why
A team that promotes to production often stops reading what it promotes. The pull request from
stage to main says "47 commits, 212 files changed", and the questions that matter are somewhere
in there:
- Which changes are these? Not the commits: the pull requests, with their authors and tickets,
including the ones that came in through
developthree merges ago. - Does a migration drop or rename something the running code still uses? Does one build an index on the big table, or run a data fix whose duration nobody measured?
- Does the infrastructure change, and does anything get destroyed?
- Does the new code need a setting that production does not have yet?
- Did anything skip review? Is production ahead of what was tested?
Each of these is in the diff for whoever goes looking. whatships goes looking every time.
Install and run
pipx run whatships --base main --head stage # or: uvx whatships ...
pip install whatships # to keep it
It has no dependencies and reads the repository through the git command: nothing is checked out,
fetched or written. Inside a clone:
whatships # the current branch against production
whatships --base main --head stage # both named
whatships --last # what the last promotion merged into production shipped
whatships --merge 4f2a91c # what one merge commit brought in
whatships --base v1.4.0 --head v1.5.0 # between two tags
whatships --format markdown -o report.md # also: json, slack, text
whatships --plan plan.json # with what `terraform show -json` says an apply will do
whatships --plan envs/prod=prod.json # one plan per stack, each for its own directory
whatships --fail-on attention # exit 1 when something needs a look
On every pull request into production
# .github/workflows/whatships.yml
name: What ships
on:
pull_request:
branches: [main]
permissions:
contents: read
pull-requests: write # for the comment
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # the report is made from history: a shallow clone has none
- uses: GebleaAlex/whatships@v0
The action writes one comment and keeps it up to date as the pull request changes, puts the same
report in the job summary, and sets outputs (level, pull-requests, migrations, attention, …)
for later steps. Inputs: base, head, comment, last, plan, fail-on, title, config,
token, working-directory (action.yml).
On a pull request from a fork, where the token may not write, the report goes to the job summary
and the job still passes.
On any other CI, run the command and do what you like with the output; --format json has
everything, and --format slack is a ready message for a webhook.
What it reads
Pull requests
From the commits alone: GitHub merge and squash commits, GitLab merge requests, Bitbucket and Azure DevOps merges. No API is needed.
- A merge between long-lived branches (
developintostage) is a promotion, not a change. It is skipped, and the pull requests it carries are listed. The whole branch name counts:fix/testis a pull request like any other, and so ismainfrom somebody's fork. - A commit belongs to the innermost pull request that brought it; a pull request merged into another one is shown inside it.
- Commits that reached the branch without any pull request are listed apart.
- A pull request reverted inside the same promotion is struck through.
- Tickets named in branches and titles (
ABC-123) are linked when you say where they live. - When production already has some of the work under another commit (a promotion that was squashed, a cherry-pick), only what still differs between the two branches is reported, and the pull requests that bring nothing new are named.
With a token (GITHUB_TOKEN), GitHub is asked for what git does not record: the title as it is
now, the author's login, labels, and which pull request a rebased commit came from. What GitHub
says about a number is used only when it was merged as the very commit that was read: #12 in a
commit message can be the number of a pull request somewhere else.
Database migrations
| Read how | Understood | |
|---|---|---|
| Django | the syntax tree; never imported or run | every built-in operation, RunSQL, RunPython, SeparateDatabaseAndState |
| Alembic | the syntax tree of upgrade() and of the functions it calls |
op.* under any name, batch operations, SQL passed to execute as text |
| SQL files | Flyway, dbmate, goose, golang-migrate, Prisma, plain directories | statement by statement |
| Rails, Knex, Sequelize, TypeORM | by the names of the calls | drops, renames, type changes, indexes, raw SQL |
Three levels, and only the first goes to the top of the report:
- Attention: data goes away or running code breaks. A dropped table or column, a rename, a
NOT NULLcolumn without a default, aDELETEwithoutWHERE; a migration edited after it was applied, renamed, or left in conflict with another (two migrations ending the same app). - Check: fine or not depending on something only you know, usually the size of a table. An
index or constraint built without
CONCURRENTLY, a type change,SET NOT NULL, a data migration. - Note: for the record. No reverse, runs outside a transaction, a squash.
What could not be read is said, not passed over: a migration this Python cannot parse, one that
is not text or is larger than 2 MB, a list of operations put together at run time, SQL built in
code, a DO block, a stored procedure, a helper imported from another module. Each is a "check"
that says to open the file. What a procedure, function or trigger defines is not what the
migration runs: statements inside such a body are not reported as if they ran.
Two things keep the list honest. For Django, the earlier migrations of the app are replayed, so
AlterField is reported for what it changes: "choices (no change to the table)", or
"max_length 100 → 30: fails if a longer value exists". And a table created by the same
promotion is empty and unknown to production, so nothing done to it is flagged; "created" is
judged against what production has, so a squashed migration that creates a table again does not
make it new.
Infrastructure
Terraform and OpenTofu (.tf and .tofu files), in two ways.
From the files, always: which resources, modules, variables, outputs, providers and backend
settings were added, changed or removed, attribute by attribute (instance_class: "db.t3.medium" → "db.r6g.large", tags.Environment, lifecycle.prevent_destroy). No state, credentials or
terraform binary. It flags what the files alone can show:
- a resource gone from the configuration (it will be destroyed), louder when it holds data;
the same for a
removedblock, unless it saysdestroy = false, and forcount = 0; - a resource renamed without a
movedblock: same type, same content, new name, which Terraform carries out as destroy and create.movedblocks are followed, through chains and into modules; prevent_destroyremoved,count/for_eachchanged, a module or provider version moved, the state's backend moved, a variable that now needs a value in every environment;- a file it could not read: nothing in that file is compared, and the report says so.
What terraform fmt does to a file is not a change: spacing, the order of nothing, : for =.
From a plan, when you give one (--plan plan.json, from terraform show -json): what an apply
will actually do, including what the files cannot know, such as a changed attribute that forces a
replacement, and drift. A plan stands in for the files of the stack it was made in and of no
other: with several stacks, give one plan each, and a stack without one keeps the reading of its
files. A plan finds its directory by what it declares (the directory whose resources and module
calls are the plan's); when two stacks declare the same, say which it is for with
--plan DIR=plan.json. Even there the files give way only where the plan accounts for them: a
plan that does not destroy a resource the files remove was made from other files (make it from
the commit being promoted), and the report keeps the files' reading and says the two disagree.
Secrets stay out: values in .tfvars are never shown (only that a variable changed); anything
marked sensitive, named like a secret anywhere in its path or inside its value (a password key
in jsonencode({...})), held by a resource that is a secret (azurerm_key_vault_secret,
kubernetes_secret), or shaped like a credential (a URL with a password in it, a private key, a
cloud access key) is hidden; and a plan's sensitive marks are respected.
Settings
Environment variables the code now reads and did not before, in Python, JavaScript and TypeScript, Go, Ruby, Rust, PHP, Java, Kotlin and C#, with whether the code has a fallback. A variable the program sets or clears itself is not one somebody has to provide. It is a search for the usual ways of reading the environment, not an understanding of the program: a list to check. A name counts as new only if nothing in the previous tree mentions it, and test files are left out.
Also changed
Dependency manifests and lock files, pipelines, Dockerfiles and deployment manifests are named when they change. Add your own groups.
Configuration
Nothing is required. .whatships.toml, or [tool.whatships] in pyproject.toml, is for what
cannot be guessed:
base = "main" # what production runs
head = "stage" # what gets promoted
ticket_url = "https://example.atlassian.net/browse/{ticket}"
ignore = ["vendor/**", "**/*.snap"]
[areas] # names for parts of the code, instead of directory names
Billing = ["apps/billing/**", "apps/invoices/**"]
[terraform]
paths = ["infra/prod"] # only what this promotion applies
[watch]
"Feature flags" = ["config/flags/*.yaml"]
Every key, with its default: docs/configuration.md.
What it does not do
- It does not connect to your database or your cloud. It cannot know that a table has two hundred million rows, which is why index builds and type changes are "check" and not a verdict.
- The Terraform reading from files is a reading of files. It does not evaluate expressions, follow modules into their source, or know the state. For what an apply will do, give it a plan.
- Rebase merges leave no trace in git. Without a token, commits merged by rebase are listed as arriving without a pull request. With one, GitHub is asked.
- Settings are found by pattern, so a variable read through a wrapper of your own is missed.
- Migrations in Rails and JavaScript are read by name, not parsed.
- A very long range is read from its newest end. Past 20,000 commits the report says so; a promotion is far shorter.
- One repository at a time. A promotion that spans several repositories is several reports.
- The comment is for GitHub. Elsewhere the report is yours to post: Markdown, JSON or Slack.
Development
python -m venv .venv && . .venv/bin/activate # .venv\Scripts\activate on Windows
pip install -e ".[dev]"
pytest && ruff check . && ruff format --check . && mypy
python examples/demo.py # a repository with a promotion in it, and its report
The tests build real repositories with real merges; nothing about git is mocked. See CONTRIBUTING.md. Licensed under the MIT License.
Metadata
Release files for whatships 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| whatships-0.1.0.tar.gz | 369.3 kB | With provenance | Details for whatships-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| whatships-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for whatships-0.1.0-py3-none-any.whl |
Total release size: 474.1 kB
Release files / whatships-0.1.0.tar.gz
| Download URL | whatships-0.1.0.tar.gz |
|---|---|
| Size | 369.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7feed2764e1d41a5283e3f84c17fb5079b111e4c1a040e6134d14d9a7e9808da
|
|
BLAKE2b-256 checksum How to use checksums |
899006d5b099a55ba0376795c8cf6f109c9dba63fb828337e69c93d3d513183e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / whatships-0.1.0-py3-none-any.whl
| Download URL | whatships-0.1.0-py3-none-any.whl |
|---|---|
| Size | 104.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c30ab6ddbdd4dba54dcb0375cbcdb545722397e18d1712aa8cd17533667899c
|
|
BLAKE2b-256 checksum How to use checksums |
36b7cc7dbafb8bee9d6f70badfa454f6ce67dd5622c517e3aaa39459c2d4a44f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for whatships 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for whatships-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.