Skip to content

test: commit the composer.lock files of the PHP test dependencies - #4198

Merged
v-scharf merged 2 commits into
mainfrom
issue-4190-composer-lock
Dec 4, 2026
Merged

v-scharf merged 2 commits into
mainfrom
issue-4190-composer-lock

Conversation

@v-scharf

@v-scharf v-scharf commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #4190

The PHP dependencies of the acceptance tests now come from committed lock files instead of being resolved anew on every run.

  • Commit composer.lock, vendor-bin/behat/composer.lock and vendor-bin/opencloud-codestyle/composer.lock, and drop them from .gitignore.
  • Makefile: no longer delete the lock files; run composer validate before installing, so that a composer.json changed without updating its lock file fails instead of installing outdated dependencies.
  • Set config.platform.php to 8.4.1 in both vendor-bin namespaces: they don't inherit it from the root composer.json (contrary to what the issue assumed), so the lock files depended on the local PHP of whoever updated them. 8.4.1 because PHPUnit 13.3 needs it.
  • Dependabot updates the three lock files weekly.
  • tests/README.md: running the tests locally needs PHP 8.4.1 or newer with the ldap extension. The docker setup and the CI already use the PHP 8.4 image.

Tested locally: clean install with make vendor-bin/behat/vendor vendor-bin/opencloud-codestyle/vendor installs from the lock files and leaves them unchanged, make test-php-style passes, and a stale lock file makes composer validate fail.

AI assistance: Claude Code (claude-opus-5-5) generated the lock files, made the changes and wrote this description; I reviewed them.

The PHP dependencies of the acceptance tests were installed without lock
files: .gitignore excluded them, and the Makefile deleted a lock file
whenever its composer.json changed. So every run resolved the newest
versions allowed by the composer.json files, and the tests depended on
whatever was released upstream that day.

Commit the lock files of the root, vendor-bin/behat and
vendor-bin/opencloud-codestyle, and install exactly what they pin.
Before installing, `composer validate` fails if a composer.json was
changed without updating its lock file.

The vendor-bin namespaces don't inherit config.platform of the root
composer.json, so they now set it themselves, to PHP 8.4.1 like the CI
images (PHPUnit 13.3 needs at least 8.4.1). The lock files no longer
depend on the PHP version of whoever updates them.

Dependabot now updates the lock files weekly.

Fixes #4190

Assisted-by: Claude Code:claude-opus-5-5
@codacy-production

codacy-production Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage ∅ diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (3f1d8b0) 98948 32490 32.84%
Head commit (2fdbb7c) 98948 (+0) 32490 (+0) 32.84% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4198) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

The lock files are committed now and the container no longer creates
them, so there is no need to make them writable for everyone. The
chmod 777 set their executable bit, which git reports as a mode change
of the committed files.

Assisted-by: Claude Code:claude-opus-5-5
@v-scharf
v-scharf merged commit c77ba9c into main Dec 4, 2026
63 checks passed
@v-scharf
v-scharf deleted the issue-4190-composer-lock branch December 4, 2026 07:32
openclouders pushed a commit that referenced this pull request Dec 4, 2026
)

* test: commit the composer.lock files of the PHP test dependencies

The PHP dependencies of the acceptance tests were installed without lock
files: .gitignore excluded them, and the Makefile deleted a lock file
whenever its composer.json changed. So every run resolved the newest
versions allowed by the composer.json files, and the tests depended on
whatever was released upstream that day.

Commit the lock files of the root, vendor-bin/behat and
vendor-bin/opencloud-codestyle, and install exactly what they pin.
Before installing, `composer validate` fails if a composer.json was
changed without updating its lock file.

The vendor-bin namespaces don't inherit config.platform of the root
composer.json, so they now set it themselves, to PHP 8.4.1 like the CI
images (PHPUnit 13.3 needs at least 8.4.1). The lock files no longer
depend on the PHP version of whoever updates them.

Dependabot now updates the lock files weekly.

Fixes #4190

Assisted-by: Claude Code:claude-opus-5-5

* test: don't chmod the composer.lock files after the docker test run

The lock files are committed now and the container no longer creates
them, so there is no need to make them writable for everyone. The
chmod 777 set their executable bit, which git reports as a mode change
of the committed files.

Assisted-by: Claude Code:claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: commit composer.lock files for the PHP test dependencies

2 participants