Skip to content

feat: add project:search command and drupalorg-issue-search skill#318

Open
andyg5000 wants to merge 1 commit intomglaman:mainfrom
andyg5000:main
Open

feat: add project:search command and drupalorg-issue-search skill#318
andyg5000 wants to merge 1 commit intomglaman:mainfrom
andyg5000:main

Conversation

@andyg5000
Copy link

New command: project:search (ps) — searches a project's issues by title keyword with --status filtering (all/open/closed/rtbc/review, defaults to all)

New skill: /drupalorg-issue-search — combines three search channels:

  1. API search — project:search CLI command
  2. Drupal.org issue queue scrape — fetches drupal.org/project/issues/?text=...&status=All directly
  3. Web search — general web search scoped to drupal.org

Supports --skip=api,drupal,web to selectively disable channels, --project and --status flags.

Other changes: MCP tool registration, CLAUDE.md updates, skill install support.

Add a new `project:search` (alias `ps`) command that searches a project's
issues by title keyword, with status filtering and all output formats.
Includes the Action class, CLI command, MCP tool registration, and a new
`/drupalorg-issue-search` skill that combines API search, Drupal.org
issue queue scraping, and web search for comprehensive results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@andyg5000
Copy link
Author

Here's an example of this working for a commerce stripe issue I'm familiar with. I've realized we probably want to add more filters for branch, component, etc... Let' me know your feels on the overall approach, including if you think we'd be spamming d.o with the web scrape flag and I'll update the MR.

❯ /drupalorg-issue-search commerce_stripe MOTO payment

● Query: MOTO payment, project: commerce_stripe. Running all three channels in parallel.

● Bash(php /var/www/drupalorg-cli/drupalorg project:search commerce_stripe "MOTO payment" --status=all --format=json 2>&1 | head -100)
  ⎿  {
         "project_title": "Commerce Stripe",
         "issues": []
     }
  ⎿  (timeout 30s)

● Fetch(https://www.drupal.org/project/issues/commerce_stripe?text=MOTO+payment&status=All)
  ⎿  Received 42.8KB (200 OK)

● Web Search("MOTO payment site:https://www.drupal.org/project/issues/commerce_stripe")
  ⎿  Did 1 search in 3s

● The Drupal.org scrape found the most relevant results. Let me fetch details on the key issues.

● Bash(php /var/www/drupalorg-cli/drupalorg issue:show 3222298 --format=llm 2>&1 | head -40)
  ⎿  <drupal_context>
       <issue_id>3222298</issue_id>
       <title>Allow administrators to add payment methods &amp; take payments</title>
     … +26 lines (ctrl+o to expand)

● Bash(php /var/www/drupalorg-cli/drupalorg issue:show 3506788 --format=llm 2>&1 | head -40)
  ⎿  <drupal_context>
       <issue_id>3506788</issue_id>
       <title>Allow administrators to be able to enter payment on orders via the Payment Element</title>
     … +12 lines (ctrl+o to expand)

● Bash(php /var/www/drupalorg-cli/drupalorg issue:show 3406817 --format=llm 2>&1 | head -40)
  ⎿  <drupal_context>
       <issue_id>3406817</issue_id>
       <title>Create add-payment-method for Stripe Payment Element</title>
     … +24 lines (ctrl+o to expand)

● Search Results: commerce_stripe "MOTO payment"

  API Search

  No results (issue titles don't contain "MOTO payment" in the recent window).

  Drupal.org Issue Queue Scrape

  ┌─────────┬────────────────────────────────────────────────────────────────────────────────────┬───────────────────┬─────────────────────────────────────┐
  │   NID   │                                       Title                                        │      Status       │                Link                 │
  ├─────────┼────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼─────────────────────────────────────┤
  │ 3506788 │ Allow administrators to be able to enter payment on orders via the Payment Element │ Active            │ https://www.drupal.org/node/3506788 │
  ├─────────┼────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼─────────────────────────────────────┤
  │ 3222298 │ Allow administrators to add payment methods & take payments                        │ Needs Review      │ https://www.drupal.org/node/3222298 │
  ├─────────┼────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼─────────────────────────────────────┤
  │ 3406817 │ Create add-payment-method for Stripe Payment Element                               │ Closed (outdated) │ https://www.drupal.org/node/3406817 │
  └─────────┴────────────────────────────────────────────────────────────────────────────────────┴───────────────────┴─────────────────────────────────────┘

  Web Search

  No additional unique issues found.

  Most relevant: https://www.drupal.org/node/3506788 — explicitly scoped to adding Payment Element support to the order management UI, noting it "whether or not that requires
  additional MOTO integration parameters." https://www.drupal.org/node/3222298 is the older 1.x version of the same feature request.

  Sources:
  - https://www.drupal.org/project/commerce_stripe/issues/3506788
  - https://www.drupal.org/project/commerce_stripe/issues/3222298
  - https://www.drupal.org/project/commerce_stripe/issues/3406817

Copy link
Owner

@mglaman mglaman left a comment

Choose a reason for hiding this comment

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

Some projects are migrating to Gitlab issues. I don't think there's anyway to detect that. Can be a follow up for support, but that would fix searching.

use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class ProjectSearch extends ProjectCommandBase
Copy link
Owner

Choose a reason for hiding this comment

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

Should this be IssueSearch?

Comment on lines +42 to +46
$issues = array_filter(
$issues,
static fn(IssueNode $issue) => stripos($issue->title, $query) !== false
);
$issues = array_slice(array_values($issues), 0, $limit);
Copy link
Owner

Choose a reason for hiding this comment

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

I forgot about https://www.drupal.org/project/restws/issues/2392183 and that the API doesn't really have search capabilities.

Copy link
Owner

Choose a reason for hiding this comment

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

Extra file?

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.

2 participants