Skip to content

README: Composer install through a vcs repository until the Packagist listing - #7

Merged
makriman merged 3 commits into
mainfrom
fix/5-composer-install-vcs
Dec 5, 2026
Merged

makriman merged 3 commits into
mainfrom
fix/5-composer-install-vcs

Conversation

@makriman

@makriman makriman commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The README's Composer line, composer require indianopinion/gen-queue, fails with "Could not find a matching version of package indianopinion/gen-queue", because the package is not on Packagist. The README did not say so. Even with a repository added, a plain composer require leaves the plugin in vendor/indianopinion/gen-queue/, where WordPress never loads it: the package type is wordpress-plugin, but the package does not require composer/installers, so "installers place it in your plugins folder" was true only for projects that already had it.

Root cause

Submitting the package to Packagist is a maintainer step that has not been done yet. The README was written as if it had, and as if every project already used composer/installers.

Change

README, "With Composer", now gives four commands:

  1. composer config repositories.gen-queue '{"type": "vcs", "url": "https://github.com/IndianOpinion/gen-queue", "no-api": true}': Composer reads the repository with git over HTTPS instead of the GitHub API, so no GitHub token is needed. The README says the machine needs git.
  2. composer config allow-plugins.composer/installers true: Composer 2.2 and later refuse to run a plugin that allow-plugins does not list.
  3. composer require composer/installers
  4. composer require indianopinion/gen-queue

It also gives the extra.installer-paths command for a project whose composer.json is not in the WordPress root, says it must be set before the plugin is required, notes that Bedrock-style projects need only the first and last commands, and shows the resulting composer.json (copied from the proof run below). The plugin has no runtime Composer dependencies (only php >=8.1) and loads its own classes through autoload.php, so no other repository entry is needed.

CHANGELOG under Unreleased, Fixed, reworded to match. The first version of this PR inserted the ### Fixed heading above the "Ideas under consideration, not promises" list, so the roadmap read as part of Fixed; the list is back directly under ## [Unreleased], with ### Fixed after it.

The without-Composer install is unchanged.

How it was tested

Composer 2.11.2, PHP 8.3.6. The commands were extracted verbatim from the README's sh blocks and run in a new empty directory after composer init --name=example/site --no-interaction, with a scratch HOME and COMPOSER_HOME, no GitHub token, no auth.json, git's global and system config hidden (so no credential helper), and stdin closed. Every command exited 0.

Layout Final path of the main file
composer.json in the WordPress root ./wp-content/plugins/gen-queue/gen-queue.php
composer.json above WordPress in web/, installer-paths set before the require ./web/wp-content/plugins/gen-queue/gen-queue.php

Both installed v0.1.0. In the first layout the resulting composer.json matches the one in the README apart from the name line composer init wrote.

Earlier on this PR: echo '{}' > composer.json && composer require indianopinion/gen-queue failed with "Could not find a matching version of package indianopinion/gen-queue" (the issue, reproduced), and vendor/bin/phpunit (165 tests, 10 integration tests skipped without a database), vendor/bin/phpcs and vendor/bin/phpstan were clean. composer validate passes on the latest commit, which changes only Markdown.

Not verified: activating the plugin in a real WordPress install from either path, and Composer versions older than 2.11.2.

Owner decision

Should the package require composer/installers itself? Adding "composer/installers": "^2.0" to this package's require would make the plugin land in the plugins folder without the reader adding it. Not done here because it changes every existing install: it adds a dependency to every project that requires the package, and Composer still refuses to run it until each project lists it in allow-plugins, so a project that has not would see its next composer update stop in CI. The README steps work either way. Recommendation: add it in its own PR together with the Packagist listing, with a CHANGELOG note under Changed, and keep the allow-plugins line in the README.

For the reviewer

The Packagist submission itself, with the GitHub webhook so tags publish, is still open for a maintainer. When it is done, the README can drop the pending sentence and the repositories entry. Packages that integrate with gen-queue and list it as a Composer dependency will need the same entry in their users' root composer.json, since Composer reads repositories only from the root.

Fixes #5

… listing

The package is not on Packagist yet, so the bare composer require in the
README failed. Document the vcs repository entry with no-api set, which
installs without a GitHub token, and say the listing is pending.

Fixes #5
@makriman

makriman commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

Review by Grok Bot (Indian Opinion QA agent)

Tested at head e2042d1. Verdict: works.

Fixes: #5. The README's Composer install now works while the package is not on Packagist.

What I checked

  • https://repo.packagist.org/p2/indianopinion/gen-queue.json returns 404, so a bare composer require indianopinion/gen-queue can't resolve today. That is the problem the PR fixes.
  • I ran the README's commands exactly as written on this head, in an empty project ({} as composer.json), with a fresh COMPOSER_HOME, no GitHub token, Composer 2.11.3 and PHP 8.4.28:
    • composer config repositories.gen-queue '{"type": "vcs", "url": "https://github.com/IndianOpinion/gen-queue", "no-api": true}': exit 0
    • composer require indianopinion/gen-queue: exit 0
  • Result: indianopinion/gen-queue v0.1.0 (commit 2da2b40) installed into vendor/indianopinion/gen-queue/. v0.1.0 is the newest tag, and main is at that tag, so the README install gives what main has.
  • The composer.json that the commands produced matches the README's JSON snippet (repositories entry and the ^0.1.0 constraint).
  • The README says no other repository entry is needed. composer.json require on this head has no runtime packages beyond PHP and extensions, so that holds.
  • "no-api": true is set, so Composer read the repository with git rather than the GitHub API, as the README explains.
  • CHANGELOG.md has a matching entry.
  • The README's note on composer/installers fits the package: its type is wordpress-plugin. Without installers it landed in vendor/ (above). I checked the installers path on indexnow-batch#11 only, where the same commands put it in wp-content/plugins/indexnow-batch/. This package has the same type.

Review

Nothing blocking. The documented commands do what the README says.

Automated checks (this head vs current main)

Command This PR main
composer validate --strict valid valid
composer install exit 0 exit 0
locked packages' require.php vs PHP 8.1.0 (repo floor), checked with composer/semver all fit PHP 8.1 all fit PHP 8.1
composer test (or vendor/bin/phpunit) exit 0: Tests: 165, Assertions: 5311, Skipped: 10. exit 0: Tests: 165, Assertions: 5311, Skipped: 10.
vendor/bin/phpstan analyse No errors No errors
composer audit --locked No security vulnerability advisories found. No security vulnerability advisories found.

I'm Grok Bot, the automated QA agent for Indian Opinion. This is a comment-only review. I don't approve, request changes or merge. Local stack: PHP 8.4.28, Composer 2.11.3, MariaDB 11.8.9, Node 24.22.1, WordPress 7.1.5.

A plain composer require left the plugin in vendor/, where WordPress
never loads it, because the package does not require composer/installers.
The README now allows and requires composer/installers, sets
installer-paths when composer.json is not in the WordPress root, shows
the resulting composer.json, and says git is needed for the no-api
repository entry.

CHANGELOG: the new Fixed heading had been inserted above the "Ideas
under consideration" list, so the roadmap read as part of Fixed. The
list is back directly under Unreleased, with Fixed after it.

Refs #5
@makriman

makriman commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up review by Grok Bot (Indian Opinion QA agent)

Retested at head fabb12e (my earlier review at e2042d1: #7 (comment)). Verdict: works.

What changed since my last review

  • README: Composer install puts the plugin in the plugins folder.
  • At my last review, the README route installed this wordpress-plugin package into vendor/. This head adds the composer/installers steps.

What I reran

  • https://repo.packagist.org/p2/indianopinion/gen-queue.json still returns 404, so the repository entry is still needed.
  • The README's commands, exactly as written on this head. I ran them in an empty project ({} as composer.json) with a fresh COMPOSER_HOME, no GitHub token, Composer 2.11.3 and PHP 8.4.28:
    • composer config repositories.gen-queue '{"type": "vcs", "url": "https://github.com/IndianOpinion/gen-queue", "no-api": true}': exit 0
    • composer config allow-plugins.composer/installers true: exit 0
    • composer require composer/installers: exit 0
    • composer require indianopinion/gen-queue: exit 0
  • Result: indianopinion/gen-queue v0.1.0 (commit 2da2b40) installed into wp-content/plugins/gen-queue/, with composer/installers v2.3.0.
  • web/ layout variant. The same commands plus composer config --json extra.installer-paths '{"web/wp-content/plugins/{$name}/": ["type:wordpress-plugin"]}' before the require: every command exit 0, and the package lands in web/wp-content/plugins/gen-queue/.
  • The README's composer.json snippet matches what the commands wrote (repositories, require, config all equal).

Review

Nothing blocking. The documented commands do what the README says.

I'm Grok Bot, the automated QA agent for Indian Opinion. This is a comment-only review. I don't approve, request changes or merge. Local stack: PHP 8.4.28, Composer 2.11.3, MariaDB 11.8.9, Node 24.22.1, WordPress 7.1.5.

@makriman
makriman marked this pull request as ready for review December 5, 2026 18:37
@makriman
makriman merged commit 604afdc into main Dec 5, 2026
3 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.

README Composer install fails: indianopinion/gen-queue is not on Packagist

1 participant