# Upgrade Prerequisites: A Green Run Is Not Proof

> The target version is chosen, but nobody has said go. Four proofs to ask for before starting: tests, rollback, blocking dependencies and deprecations.

- Type: Notes
- Published: 2026-11-22
- Tags: testing, dependencies, decisions, production
- Series: Upgrading in Production
- Reading time: 6 min read
- Source: https://muhammetsafak.com/engineering/notes/upgrade-prerequisites/
- Language: en-US
- Author: Muhammet Şafak

---
> **TL;DR:** Choosing the target version does not give you permission to start the upgrade. Before you begin, each of four gates needs a proof you can show: tests running on the target, output that shows any blocking dependency, visible deprecation warnings and a rollback that has actually been run. A gate without proof is the first job of the upgrade.

Composer's `platform` setting can turn an install green without ever looking at the PHP you will run.

A green `composer install` is green against the platform the setting imitates, not against production's PHP. That is where the gap between choosing a target and being ready to start begins.

[Part 4](https://muhammetsafak.com/engineering/notes/upgrade-target-version/) had you write the target as a pair: runtime and framework. For the example system (PHP 8.2 + Laravel 12 + `FROM php:8.2-fpm-bookworm`) that article's table came out at 8.4 + Laravel 13; that is the author's example assumption, not your answer. The target is written. The go is not.

A go is not a feeling, it is proof you can show. There are four gates, and each is passed with the same two questions: what can you show, and if you cannot, what is the first job?

## Gate 1: Tests Running on the Target

Your test suite may be green on today's version. That does not say it will be green on the target.

The proof has two parts. The first is the **baseline**: output showing the suite runs green on the current version, in the current image. If you start from a red baseline, you cannot tell whose fault each red on the target is. The second is the **run on the target**: output of the same suite running in the target image (a tag such as `php:8.4-fpm-bookworm` in the example), recorded.

If the suite does not cover the critical path, a green run says nothing. For that path write a **characterization test**: a test that pins down what the code does today, right or wrong, exactly as it is. Its purpose is not to verify behavior but to show whether the output is the same before and after the upgrade. If the output changes on the target, you know the upgrade brought the change.

**If there is no proof, the first job:** get the baseline green, then write characterization tests for the critical paths. These jobs finish before the upgrade, outside it.

## Gate 2: Blocking Dependencies

If a package in [Part 2](https://muhammetsafak.com/engineering/notes/upgrade-inventory/)'s chain blocks the target, the upgrade is stuck before it starts. Ask Composer whether the target fits the chain:

```bash
composer why-not php 8.4
```

`prohibits` (alias `why-not`) lists which package blocks the requested version. Empty output is good news; but do not trust it alone before checking the trap below.

The trap is the `config.platform` setting. It makes Composer imitate a different platform, and Composer's own documentation says that once it is set, dependencies are no longer checked correctly. A line added to imitate an older PHP keeps the install green if it stays in place in the target image: Composer looks at the imitation, not the real platform.

`composer check-platform-reqs` ignores this setting and checks the real platform. The `--lock` flag checks what is in `composer.lock` instead of the installed packages. Run it inside the target image:

```bash
composer check-platform-reqs --lock
```

No requirement failing, together with `config.platform` being explained, is the proof. Neither alone.

**If there is no proof, the first job:** review the `config.platform` line (why is it there, is it still needed), look for a release of the blocking package that supports the target, and if there is none, write down who owns it. The rule Part 4 left applies here: the target cannot go further than the chain's slowest link.

## Gate 3: Visible Deprecations

Tests can be green and dependencies compatible; the code that runs on the target will still produce deprecation warnings, and if nobody sees them, they have been ignored.

In Laravel 12, the `deprecations` log channel is set by the `LOG_DEPRECATIONS_CHANNEL` environment variable and its [default is `null`](https://laravel.com/docs/12.x/logging): PHP deprecation warnings are produced and thrown away. `LOG_DEPRECATIONS_TRACE` adds a stack trace showing where the warning came from.

An example: PHP 8.4 treats a typed parameter whose default is `null` (`string $name = null`) as [deprecated](https://www.php.net/manual/en/migration84.deprecated.php); you write `?string $name = null`. If that pattern exists in your code, running the suite in the target image produces a warning. If the channel is `null`, no trace is left in the output.

The proof is running the suite in the target image with the `deprecations` channel open and writing the output to a file. If the file has no lines, you have proof of visibility; if it has lines, that list is where the upgrade's job list starts.

It depends on Gate 1: warnings are produced only for code that runs. If the suite does not exercise the critical path, a clean file only says the code that ran is clean. Split the warnings into your own code and `vendor/`: the ones in your code you fix, the ones in `vendor/` go back to Gate 2.

**If there is no proof, the first job:** point the channel at a file, run the suite on the target, and split the output by source.

## Gate 4: A Way Back

A rollback plan that has not been run once is not a plan, it is an assumption.

Rollback has three parts: is the previous version's **artifact** (the image tag) still pullable, is the previous **lock** file at hand, and is there **data** both versions can read. The third is per system. If a serialized record in a queue, a cache or a session was written by the new version, whether the old version can read it stays a question; this article does not answer it, your system does.

The proof is a rollback run once: bring the new version up on staging, push traffic or a workload through it, then roll back with the previous artifact and lock and show that the system works. "The old image is still there" is not proof; "we went back to the old image and the critical path ran" is.

**If there is no proof, the first job:** run the rollback once on staging. That run shows which data is readable by both versions.

## The Proof Table

Write the four gates on one page:

| Gate | Proof | If missing, first job |
|---|---|---|
| 1. Tests on the target | Baseline output + suite output in the target image | Get the baseline green, write characterization tests |
| 2. Blocking dependencies | `composer why-not` and `check-platform-reqs --lock` output, `config.platform` explained | Explain `config.platform`, write the blocking package's owner |
| 3. Visible deprecations | Suite output on the target, `deprecations` channel open | Point the channel at a file, split the output by source |
| 4. A way back | Record of a rollback run on staging | Run the rollback once |

A gate without proof does not go away. It gets discovered in the middle of the upgrade, and this time under pressure: inventory, test round and rollback are paid for twice. Collecting the proof up front does that work once.


> **Tan:** An empty row in the proof table is not a gap, it is information. It tells me what the first job is. In your place I would not try to fill that row; I would leave it empty and write an owner next to it, because keeping the gap visible is cheaper than discovering it during the upgrade.


## The Limit of This Framework

The table lists the proof needed to start; it does not say starting is enough. Whether a gate's proof counts as sufficient is per system: what the critical path is, which data both versions can read, how many warnings are acceptable is your system's answer.

Rollout order, how much traffic goes to the new version and the doors that cannot be reopened are Part 6's subject. Here proof is collected; nothing goes to production.

The detail of commands and settings is in the Composer, Laravel and PHP documentation; read the one for the version you use. The Composer documentation this article leans on is not pinned to a versioned address, so verify your Composer version's behavior separately.

## Write the Four Rows

Back to the green run in the opening: green against which platform?

Write the four gates on one page for your target version. Attach the proof to the row that has it; the row that does not is the first job of the upgrade.

## Sources

- [Command-line interface / Commands](https://getcomposer.org/doc/03-cli.md) — Composer
- [The composer.json schema / Config](https://getcomposer.org/doc/06-config.md) — Composer
- [Logging (Laravel 12.x)](https://laravel.com/docs/12.x/logging) — Laravel
- [Deprecated Features (PHP 8.4)](https://www.php.net/manual/en/migration84.deprecated.php) — PHP
