Problem/Motivation

The 1.0.0 release notes list "Patch status checking via Drupal.org API" as the plan for 1.1.0. Knowing the status of the issue behind each patch is the most useful thing a patch report can show: it tells you when a patch has been committed upstream and can be dropped, or when an issue was closed without a fix and the patch needs a second look.

At Aptitude Digital we built a small internal module in 2024 that does exactly this, and it has run on our client sites since. It reads issue status from the drupal.org api-d7 endpoint, and with many projects' issues moving to GitLab work items it now needs reworking: about half of the issues patched on our sites have already moved, and for those api-d7 returns only a redirect. Since we have to rebuild that part anyway, we'd rather do it here than maintain a separate module that does nearly the same job.

Proposed resolution

  • Add an IssueStatusFetcher service that takes the issue_id PatchParser already extracts and fetches the issue's title, status and priority.
  • Handle both places an issue can live. Ask api-d7 first. If it returns new_url, the issue has moved, so read it from the git.drupalcode.org API instead and take status and priority from the work item's labels (state::*, priority::*, why::*). Migrated issues keep their number, so existing composer.json entries keep working. A description that already links to a work_items URL goes straight to GitLab.
  • Turn both sources into the same status and priority values, so the report doesn't need to know which one answered.
  • Cache results so the report doesn't call drupal.org on every load, and remember permanently that an issue has migrated.
  • Add Status and Priority columns to the report, with the issue title as the link text.
  • Highlight patches whose issue is closed as fixed, since those can probably be removed.
  • Fail gracefully: a short timeout, a log entry and "Unknown" in the table if a lookup fails.
  • Cover the status mapping, the redirect to GitLab and the caching with unit tests.

We'll open a merge request against master along these lines and are happy to adjust it to fit how you want the module to grow.

Comments

redsky created an issue.