Skip to content

Add list release-groups / get release-group commands #25

Description

@saramaebee

Why

When reconciling issue counts on a release group against the sum of its
member projects, the very first thing a support engineer or internal tool
needs to do is resolve a release-group title/ID to its member projects and
their pinned revisions. fossapi has no commands for this today, so every
investigation starts with raw curl against /api/project_group/....

Current workaround

curl -H "Authorization: Bearer $FOSSA_API_KEY" \
  https://app.fossa.com/api/project_group            # list
curl -H "Authorization: Bearer $FOSSA_API_KEY" \
  https://app.fossa.com/api/project_group/<id>       # detail + member projects

Sample response (detail, abbreviated):

{
  "id": 1234,
  "title": "My Release Group",
  "policyId": 1001,
  "securityPolicyId": 1002,
  "qualityPolicyId": 1003,
  "releases": [{
    "id": 5678,
    "title": "1.0",
    "unresolved_security_issue_count": 2,
    "unresolved_licensing_issue_count": 4,
    "unresolved_quality_issue_count": 0,
    "projects": [{
      "projectId": "custom+<orgId>/<repo>",
      "branch": "main",
      "revisionId": "custom+<orgId>/<repo>$<sha>"
    }]
  }]
}

Proposed CLI surface

fossapi list release-groups [--title <substring>] [--json] [--page N] [--count N]
fossapi get  release-group  <id> [--json]
  # Exits non-zero if the RG has no releases; otherwise prints release metadata
  # and member projects with their pinned revisions.

Repro that currently can't be done via fossapi

# "Show me the member projects (with pinned revisions) for RG 1234"
# Today:
curl -sH "Authorization: Bearer $FOSSA_API_KEY" \
  https://app.fossa.com/api/project_group/1234 | jq '.releases[0].projects'

# Desired:
fossapi get release-group 1234 --json | jq '.releases[0].projects'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions