Skip to content

[3.0] Only commits the manifest when update_manifest.php is asked to - #9687

Merged
Sesquipedalian merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/update-manifest-write-only
Sep 13, 2026
Merged

Sesquipedalian merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/update-manifest-write-only

Conversation

@albertlast

@albertlast albertlast commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

other/update_manifest.php builds Sources/Maintenance/manifest.php, then stages it and commits it. Unlike the other standalone update_*.php scripts it creates no branch of its own, so that commit lands on whatever branch happens to be checked out.

Two things run it wanting only a fresh file:

On release-3.0, after nothing more than docker compose up:

$ git status --short
A  Sources/Maintenance/manifest.php
$ git commit --dry-run --short
A  Sources/Maintenance/manifest.php

So the developer's next ordinary commit carries a 2016-line generated file. The container's own commit attempt fails only because it has no Git identity (Author identity unknown in the web log). Given one, the same entrypoint command committed straight onto the checked-out branch:

head_before=0d2d622 Merge pull request #9679 from Sesquipedalian/3.0/maint_manifest
Updating manifest file...
Done.
Changes committed.
head_after=7eaf921 Updates file manifest
Signed-off-by: Dev <dev@example.com>
 Sources/Maintenance/manifest.php | 2016 ++++++++++++++++++++++++++++++++++++++

This makes committing opt-in. The script writes the manifest and stops unless it is given commit as an argument, and ManifestUpdater stages the file inside commit() rather than execute(), so a build that is not committed leaves the index alone.

It is a bare word rather than --commit because PHP reads options after php -f file as its own — php -f other/update_manifest.php --commit stops with Error in argument 3, char 2: no argument for option - — and php -f is how these scripts are documented. update_version_numbers.php takes its dev argument the same way.

prepare_release.php calls execute() and then commit() itself, so it still commits the manifest.

Verified in a clone of this branch with a Git identity set, so any commit would really land:

(a) php -f other/update_manifest.php
    manifest written: yes   staged in index: 0   HEAD unchanged: yes
    status: ?? Sources/Maintenance/manifest.php

(b) php -f other/update_manifest.php commit
    Changes committed.
    a4d459a Updates file manifest   contains: Sources/Maintenance/manifest.php   tree clean after

(c) prepare_release.php's sequence: new ManifestUpdater('3.0/prepare_release_test'),
    execute(), hasChanged(), commit()
    hasChanged=true ready=true commit()=true
    1e2ed63 Updates file manifest on 3.0/prepare_release_test   contains: Sources/Maintenance/manifest.php

The dirty-tree guard in UpdaterBase is unchanged, so on a checkout with local edits the script still refuses to run and the entrypoint builds no manifest. That is a separate question and is not touched here.

None of this is reachable from the PHPUnit suite: other/ is outside it, and what is being tested is what the script does to Git.

Issues References (Fixes|Related|Closes)

  1. Related: [3.0] Improves file integrity checks in installer and upgrader #9679
  2. Related: [3.0] Silences the manifest build in the Docker entrypoint without backgrounding it #9686 — the entrypoint line that runs this script backgrounds it instead of silencing it
  3. Related: [3.0] Runs the welcome step's checks when installing from the command line #9688 — CLI installs skip the welcome checks, the manifest check included

🤖 Generated with Claude Code

update_manifest.php creates no branch of its own, so it staged the manifest
and committed it onto whatever branch was checked out. Both of its callers
want the file regenerated rather than committed: the Docker entrypoint,
which runs it against the developer's checkout, and the hint the installer
and upgrader show developers when the manifest is out of date.

It now writes the manifest and stops, and commits only when given 'commit'
as an argument. That is a bare word rather than --commit because PHP reads
options after `php -f file` as its own, and `php -f` is how these scripts
are documented.
ManifestUpdater stages the file inside commit(), so a build that is not
committed leaves the index alone. prepare_release.php commits through the
same method and is unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@Sesquipedalian
Sesquipedalian merged commit 91260bc into SimpleMachines:release-3.0 Sep 13, 2026
9 checks passed
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Sep 13, 2026
@jdarwood007 jdarwood007 added the Meta Repository tools label Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Meta Repository tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants