Skip to content

Add normalize-composer.py; smoke_test.py loads the ACP extension details page - #50

Merged
bonelifer merged 1 commit into
mainfrom
composer-baseline-tools
Nov 6, 2026
Merged

bonelifer merged 1 commit into
mainfrom
composer-baseline-tools

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

Tools for the org-wide composer.json cleanup (phpBB 3.3.19 / PHP 8.3.36 baseline).

normalize-composer.py brings an extension's composer.json to the baseline and changes nothing else:

  • require.php → >=8.3.36
  • composer/installers → ^1.0 || ^2.0, added after php when missing
  • phpbb/phpbb removed from require (it belongs only in extra.soft-require)
  • extra.soft-require phpbb/phpbb → >=3.3.19, with the upper bound ext.php enforces: <4.0.0@dev when ext.php refuses 4.0, <4.1.0@dev when it allows only up to 4.0 or soft-require already declares 4.0 support, and none otherwise. --upper overrides it.

It edits the file as text, so key order, indentation (including mixed tabs and spaces), escaping and line endings stay as they are; single-line objects stay on one line. It parses the result and only writes when that equals the original plus exactly these changes. --dry-run prints the changes without writing. With no arguments it prints help.

tests/test-normalize-composer.sh covers a typical file, CRLF line endings, mixed indentation, a missing composer/installers, single-line objects, the ext.php ceiling, --upper, --dry-run, a non-extension and bad arguments. It runs in CI.

smoke_test.py now also loads the extension's ACP details page (ACP > Manage extensions), where phpBB reads composer.json through its metadata manager, and checks that the display name shows there.

Testing (by Claude): the new tests pass and ShellCheck is clean. The script was run on 68 phpbbmodders extensions (all but trackers and bulkuseradd); composer validate showed no new errors or warnings in any of them, and smoke_test.py was clean on a phpBB 3.3.19 board for all 68, apart from three problems that are the same on their default branches (documentation, knowledgebase, topictags).


Investigated and written by Claude on behalf of William Jacoby (bonelifer).

🤖 Generated with Claude Code

…ils page

normalize-composer.py brings an extension's composer.json to the
phpbbmodders baseline: require.php >=8.3.36, composer/installers
^1.0 || ^2.0, no phpbb/phpbb in require, and soft-require from phpBB
3.3.19 with the upper bound ext.php enforces. It edits the file as text,
keeping key order, indentation and line endings, and checks the parsed
result before writing. tests/test-normalize-composer.sh covers it in CI.

smoke_test.py now also loads the extension's ACP details page, where
phpBB reads composer.json, and checks its display name shows there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 5, 2026
This was referenced Nov 5, 2026
@bonelifer
bonelifer merged commit 156ad31 into main Nov 6, 2026
1 check passed
@bonelifer
bonelifer deleted the composer-baseline-tools branch November 6, 2026 16:09
bonelifer added a commit to phpbbmodders/phpbb-ext-wiki that referenced this pull request Nov 6, 2026
Brings `composer.json` to the phpbbmodders baseline for phpBB 3.3.19 and
PHP 8.3.36. Only these keys change; key order, indentation and line
endings stay as they are.

- Added `composer/installers` `^1.0 || ^2.0` after `php`.
- `extra.soft-require` `phpbb/phpbb`: `>=3.3.19,<4.1@dev` →
`>=3.3.19,<4.1.0@dev` (the upper bound keeps the phpBB 4.0 support this
extension declares)

Made with `normalize-composer.py` (phpbbmodders/phpbb-release-tools#50).

**Testing** (by Claude):

- `composer validate`: no errors, and no warnings the old file didn't
have.
- `smoke_test.py` on a phpBB 3.3.19 board: clean, including the ACP
extension details page where phpBB reads `composer.json`.

---

Investigated and written by [Claude](https://www.anthropic.com/claude)
on behalf of William Jacoby ([bonelifer](https://github.com/bonelifer)).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant