Skip to content

project:issues --core option breaks with semver projects #285

@mglaman

Description

@mglaman

Problem

The project:issues command has a --core option (default 8.x) that filters issues by release version using a strpos prefix match against release version strings fetched from the API.

foreach ($releaseList as $release) {
    if (strpos($release->field_release_version, $core) === 0) {
        $apiParams['field_issue_version']['value'][] = $release->field_release_version;
    }
}

This works for the traditional Drupal versioning scheme (e.g. 8.x-1.5, 8.x-2.0) but produces no results for projects that have adopted semver (e.g. address, commerce), whose release versions look like 1.0.0, 2.1.3, 3.0.0-alpha1. No semver release version starts with 8.x, so the filter list is always empty and field_issue_version is never sent to the API.

Proposed resolution

Remove --core and replace it with an equivalent that works for both versioning schemes. Possible directions:

  • --branch — accept an explicit branch prefix such as 8.x, 2.x, 11.x, and match against the major portion of semver releases or the 8.x- prefix of traditional releases
  • Auto-detect — inspect the project's releases and infer the active branch(es), presenting them as a choice if ambiguous
  • Drop the filter — remove version filtering entirely and rely on --limit to keep output manageable

The option should be deprecated / removed before or alongside whichever replacement is chosen.

Steps to reproduce

drupalorg project:issues address --core 8.x

Does not return issues for the 2.0.x branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions