Skip to content

PR workflows should populate both issueUrls and prUrls #349

@acreeger

Description

@acreeger

Problem

The current implementation of issueUrls and prUrls in metadata has a flaw:

  • Issue workflows: populate issueUrls, leave prUrls empty ✓
  • PR workflows: populate prUrls, leave issueUrls empty ✗

This is incorrect because PRs typically originate from issues. A PR workflow (e.g., branch issue-42__feature with PR #123) should populate both:

  • issueUrls: { "42": "https://github.com/org/repo/issues/42" }
  • prUrls: { "123": "https://github.com/org/repo/pull/123" }

Current Behavior

In LoomManager.ts, the metadata is built like this:

// For issue workflows
issueUrls: input.type === 'issue' ? { [String(input.identifier)]: issueData?.url ?? '' } : {},
prUrls: input.type === 'pr' ? { [String(input.identifier)]: issueData?.url ?? '' } : {},

Expected Behavior

For PR workflows:

  1. Extract issue number(s) from branch name (already done via issue_numbers array)
  2. Fetch or construct the issue URL(s)
  3. Populate both issueUrls AND prUrls

Considerations

  • The issue URL could be constructed from the issue number + repo URL pattern
  • Alternatively, an additional API call could fetch the issue data
  • The issue_numbers array is already populated for PR workflows, so the issue numbers are available

Related

Introduced in #342

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions