stale deployment recurred after a working-tree repair because publishing still trusted local files
Key points
- Changes remained committed in Git while older article versions reached the live site through scheduled publishing. (Source: our own measurement, 2026-09-28)
- Restoring the working tree and republishing fixed the live articles, but the same files rolled back again that afternoon. (Source: our own measurement, 2026-09-27)
- The publishing script was changed to restore tracked inputs from HEAD when they differed and commit new untracked inputs during publishing. (Source: our own measurement, 2026-09-28)
- A separate interrupted deployment led to a check comparing the intended build stamp with the stamp actually served by the site. (Source: our own measurement, 2026-09-28)
Committed changes disappeared from the live articles
A stale deployment is a published version that is older than the version intended for release.
In this incident, the missing changes were campaign parameters on links in three articles. Those parameters had been added to distinguish incoming traffic by destination. The changes were committed, yet the public articles subsequently lost them.
On September 26 at 13:11, commit 387e96bdb recorded the additions to utm_campaign. The next morning, a routine check found that the live version differed from HEAD. Investigation showed that the working tree itself was older than HEAD: Drive synchronization had rolled back the files and removed the committed parameters from the local copies.
The scheduled publishing job then used those local copies. Its 07:20 run published the older content.
This distinction explains why the existence of the commit did not settle the incident. Git still held the intended changes. The files used for publishing no longer contained them. The published result followed those files, so the public site could move backward while the commit remained available.
The evidence identified a specific path from rollback to publication: synchronization changed the working tree, and the scheduled job published that working tree. The immediate question was therefore which version entered the build, rather than whether the article edits had ever been saved in Git.
(Source: our own measurement, 2026-09-28)
Restoring the files fixed the site only temporarily
The first repair restored the affected files from HEAD, rebuilt the site, and published it again. At 10:34 on September 27, the restoration used git checkout HEAD -- for the affected paths. A live check confirmed that the repair had worked.
That confirmation mattered. The initial recovery was not merely a local edit or a successful command invocation: the corrected content was checked on the public site.
But the recovery did not change how the next publishing run would choose its inputs. The working tree remained exposed to the same synchronization rollback, and publishing still accepted the files it found there.
At 13:30 that afternoon, the same three articles rolled back again. Their modification times confirmed the recurrence. The following morning, another routine check found the live version different from HEAD, and the scheduled job had again published the older files.
The mistaken assumption was that restoring the working tree had resolved the publishing problem. It had resolved the current contents of the affected files and, after rebuilding, the current public output. It had not established a rule preventing a later rollback from becoming another release.
The recurrence made the boundary clear. A repair performed on the working tree could be undone outside the publishing script. If publishing continued to trust that tree without comparing it with the committed version, the same sequence remained possible.
The corrective work therefore moved to the point where files became publishing inputs.
(Source: our own measurement, 2026-09-28)
Publishing now resolves tracked inputs against HEAD
The revised publishing script treats HEAD as the intended version for tracked inputs. Before publishing, it checks the selected paths for differences against HEAD.
The recorded command was:
CHANGED="$(git diff --name-only HEAD -- $PATHS)"
When that check finds changed paths, the script logs them and restores their HEAD versions before continuing. The record includes this restoration command:
git checkout HEAD -- $CHANGED
This is a publishing policy as well as a repair mechanism. The script no longer accepts every tracked working-tree difference as something that should reach the public site. For the inputs covered by the check, the committed version takes precedence.
The reason recorded for that choice was explicit: published material should represent a deliberately finalized version, while synchronization can return working files to an older state. If an uncommitted edit is intentional and should be published, committing it is the way to express that intent.
The difference check itself does not identify the history behind a changed file. It reports that the working copy differs from HEAD. The publishing rule supplies the response: restore the committed version and record which paths were restored. Logging is part of the change, because replacing a file should leave an explanation in the publishing output.
New untracked inputs receive separate treatment. They have no tracked HEAD version to restore, so the script identifies them with:
NEW="$(git ls-files --others --exclude-standard -- $PATHS)"
The added behavior publishes those new inputs and commits them during the publishing operation. The recorded concern was that losing an uncommitted new file would mean writing it again.
Together, these checks address different input states. Tracked differences are resolved in favor of HEAD; new untracked files are preserved through a commit. The fix places those decisions inside publishing, where they apply when the files are about to be used.
An interrupted command exposed a second verification gap
The same record describes another way to mistake an attempted deployment for a completed publication. Deployment output was shortened with this command:
bash deploy.sh | head -18
The pipeline ended during the build. The recorded explanation was that cutting the pipe, together with set -e and SIGPIPE, caused execution to end quietly. The operator nearly treated that attempt as a completed deployment.
This was separate from the synchronization rollback. In the rollback sequence, publishing used older inputs. In the pipeline incident, the command stopped before completing the intended work. Both exposed a gap between what the operator intended to publish and what was actually available publicly.
The added check compares build stamps after deployment. It extracts the stamp from the locally built page, fetches the live page, and compares the stamp served there with the intended one. A mismatch produces a warning and exits with failure.
That comparison makes the public response part of verification. Having a commit establishes that a version was recorded. Having a local build establishes that output exists locally. Neither observation, by itself, establishes that the public site is serving that output.
After the change, the scheduled logs contain an explicit successful version comparison. The record treats the absence of that confirmation as evidence that publication has not been established. The check supplies a concrete result to look for instead of relying on the impression that a deployment command ran.
(Source: our own measurement, 2026-09-28)
Check both the publishing inputs and the served result
The lesson from this incident can be checked at two points in a developer’s own publishing process.
First, inspect how publishing selects tracked inputs. For the paths used by the build, compare the working tree with HEAD. Then examine what the publishing script does when they differ. In this case, restoring files manually was insufficient because a later synchronization event could undo the restoration. Moving the HEAD preference into publishing made that decision part of each run.
Also inspect how new untracked inputs are handled. The recorded fix committed them during publishing so that the publication process did not leave their preservation dependent on an uncommitted working copy.
Second, examine the evidence collected after deployment. The relevant question is whether the served output carries the stamp of the intended build. Here, comparing local and live stamps addressed the gap exposed by the interrupted pipeline.
These checks answer different questions. The input check establishes which tracked version publishing will use. The output check establishes whether the intended build is the one being served. The incident required both because correcting source files and attempting a deployment had each proved insufficient as a lasting assurance of the public result.
The committed changes had survived throughout the rollback sequence. What needed repair was the path from those changes to the published site.
Root Cause is written while shipping small software products — you can see them at TechAthletes.