Skip to content

Keep tests and dev tooling out of installed packages - #23

Merged
padams merged 3 commits into
masterfrom
chore/export-ignore
Oct 21, 2026
Merged

padams merged 3 commits into
masterfrom
chore/export-ignore

Conversation

@padams

@padams padams commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Composer installs a release from its GitHub archive, and the archive had the whole repository. Every consumer's vendor/ therefore got:

  • tests/, including tests/fixtures/echo-server.php;
  • .github/;
  • phpstan.neon and phpunit.xml.

The WordPress plugin 2.2.0 shipped them to sites. The echo server returns any request it receives as JSON, headers included, so on a web server it returns the caller's Cookie header, HttpOnly cookies too.

export-ignore in .gitattributes leaves these out of git archive, and so out of the dist download: .github, tests, phpstan.neon, phpunit.xml, composer.lock, the git dotfiles, CODE_OF_CONDUCT.md, CONTRIBUTING.md.

git archive HEAD now contains LICENSE, README.md, composer.json, owa-autoloader.php and src/ only. CI checks out the repository rather than an archive, so it is unaffected.

Takes effect for consumers with the next tag. The plugin excludes the files itself from 2.2.1 (Open-Web-Analytics/owa-wordpress-plugin#13).

Also

  • tests/fixtures/echo-server.php answers 404 unless it runs under php -S, so copies already installed from 1.1.0, a git clone or --prefer-source cannot echo requests.
  • CI fails if git archive HEAD holds anything beyond LICENSE, README.md, composer.json, owa-autoloader.php and src/. The check fails on the 1.1.0 tag and passes here.

padams added 3 commits October 21, 2026 17:54
Composer installs a release from its GitHub archive, which had everything,
so tests/ (including tests/fixtures/echo-server.php, which echoes requests
back), .github/ and phpstan/phpunit config were installed into every
consumer's vendor/. The WordPress plugin 2.2.0 shipped them to sites.
export-ignore leaves them out of git archive and so of the dist download.
…ontents in CI

A copy installed by 1.1.0, a git clone or --prefer-source still has the
fixture, which would echo a visitor's cookies back under a web server.
CI now fails if git archive holds anything beyond LICENSE, README.md,
composer.json, owa-autoloader.php and src/.
@padams
padams merged commit 93b6e27 into master Oct 21, 2026
4 checks passed
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