Skip to content

Document how wp package install resolves a package name - #255

Open
muneeb-ashraf wants to merge 1 commit into
wp-cli:mainfrom
muneeb-ashraf:docs/install-name-lookup
Open

muneeb-ashraf wants to merge 1 commit into
wp-cli:mainfrom
muneeb-ashraf:docs/install-name-lookup

Conversation

@muneeb-ashraf

@muneeb-ashraf muneeb-ashraf commented Oct 8, 2026 •

Copy link
Copy Markdown

The wp package install docs say a package can be given as a "Package name from WP-CLI's package index". That index is deprecated: wp package browse says it "has been deprecated and will not be updated further". In practice, a name now resolves from Packagist or from GitHub or GitLab, and the docs don't mention either.

This updates the docblock (and the README section generated from it) to describe what get_package_by_shortened_identifier() does:

  1. The deprecated package index, for backward compatibility.
  2. Packagist (https://repo.packagist.org/p2/<package-name>.json).
  3. https://github.com/<package-name>.git, using GITHUB_TOKEN if it is set.
  4. https://gitlab.com/<package-name>.git, using GITLAB_TOKEN if it is set.

For example, runcommand/db-ack, which the Running commands remotely guide installs, isn't on Packagist and only installs through the GitHub fallback.

Documentation only, no behavior change. composer phpcs passes on the changed file.

AI assistance: Claude Code (Claude Opus 5.5) helped trace the lookup order and draft the wording. I checked it against get_package_by_shortened_identifier().

Summary by CodeRabbit

  • Documentation
    • Clarified that package installation checks the deprecated WP-CLI package index and Packagist first, then tries matching GitHub and GitLab repositories.
    • Noted that setting GITHUB_TOKEN or GITLAB_TOKEN can help avoid rate limits during repository checks.

The docs still described names as coming from WP-CLI's package index,
which is deprecated. Explain the lookup order the command uses
(package index, Packagist, GitHub, GitLab) and the GITHUB_TOKEN and
GITLAB_TOKEN variables it reads for the GitHub and GitLab checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6LxjEQnP4PPgXXvAM3M2F
@muneeb-ashraf
muneeb-ashraf requested a review from a team as a code owner October 8, 2026 08:13
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Hello! 👋

Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project.

Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

Here are some useful Composer commands to get you started:

  • composer install: Install dependencies.
  • composer test: Run the full test suite.
  • composer phpcs: Check for code style violations.
  • composer phpcbf: Automatically fix code style violations.
  • composer phpunit: Run unit tests.
  • composer behat: Run behavior-driven tests.

To run a single Behat test, you can use the following command:

# Run all tests in a single file
composer behat features/some-feature.feature

# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123

You can find a list of all available Behat steps in our handbook.

@muneeb-ashraf muneeb-ashraf changed the title Document how resolves a package name Document how wp package install resolves a package name Oct 8, 2026
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6b31ed17-91cf-43de-8051-673a20e760d8
📥 Commits

Reviewing files that changed from the base of the PR and between 33bb6a7 and 29f7e17.

📒 Files selected for processing (2)
  • README.md
  • src/Package_Command.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The README and wp package install documentation now describe package resolution through the deprecated WP-CLI package index, Packagist, GitHub, and GitLab. They also identify GitHub and GitLab tokens as a way to avoid rate limiting.

Changes

Package lookup documentation

Layer / File(s) Summary
Document package lookup sequence
src/Package_Command.php, README.md
Both documents describe the lookup order and identify GITHUB_TOKEN and GITLAB_TOKEN as ways to avoid rate limiting.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Suggested reviewers: schlessera

Merge Risk: ⚪ Minimal · up to 29f7e

The lookup documentation matches the implementation and does not change runtime behavior. The PHP checks could not complete in this environment, but no actionable issue was established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: documenting how wp package install resolves package names.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added command:package-install Related to 'package install' command scope:documentation Related to documentation labels Oct 8, 2026
@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ernilambar
ernilambar requested a lite review from Copilot October 8, 2026 14:59
Copilot stopped reviewing on behalf of ernilambar due to an error October 8, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to run its full agentic suite in this review.

Copilot review overview

0 open findings

What changed in this PR

Updates WP-CLI package install documentation to clarify supported package spec formats and how name resolution is performed.

Changes:

  • Reworded the “package name” specifier to use a concrete example (wp-cli/server-command).
  • Documented the lookup order (WP-CLI index → Packagist → GitHub/GitLab URL fallbacks).
  • Documented environment variables for avoiding GitHub/GitLab rate limits during remote checks.
File Description
src/​Package_Command.php Updates the wp package install command docblock with clearer package name resolution behavior and token hints.
README.md Mirrors the same clarification in the public README command documentation.

🧠 Review effort: Lite


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:package-install Related to 'package install' command scope:documentation Related to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants