Skip to content

ER: Create shared artifact module for set-pr-label & pr-trigger #8844

Open

Description

@castillios

Emergent Requirement - Problem

We need to create one shared module between set-pr-labels and pull-request-trigger workflows since both files have repetitive code.

Issue you discovered this emergent requirement in

Date discovered

9-30-2026

Did you have to do something temporarily

  • YES
  • NO

Who was involved

@daras-cu @castillios

What happens if this is not addressed

If this remains unaddressed, then repetitive code will continue to bloat the overall codebase. We want to consolidate artifact handling functions into a single, shared utility file to minimize redundancy, improve consistency, and make it easier to maintain.

Resources

Recommended Action Items

  • Make a new issue
  • Discuss with team
  • Let a Team Lead know

Potential solutions [draft]

We will split the solution into two issues. One issue will create the module and implement the change in the PR trigger workflow. The other issue will implement the change in the set PR labels workflow.

Issue 1

  • Complexity: Large
  • Relationships: Blocks issue 2
  • Size: 0.5pt

Issue 1 Solution

  • View the following workflows to understand how artifacts are integrated and how they work:
    • PR Trigger workflow
      • github-actions/trigger-pr/check-linked-issue.js
      • .github/workflows/pull-request-trigger.yml
      • .github/workflows/wr-pull-request-trigger.yml
    • Set PR labels workflow
      • github-actions/trigger-pr/set-pr-labels.js
      • .github/workflows/set-pr-labels.yaml
      • .github/workflows/wr-set-pr-labels.yaml
  • In github-actions/trigger-pr/check-linked-issue.js and github-actions/trigger-pr/set-pr-labels.js, note the duplicate functions and understand how they work. These functions will be moved into a shared utility module:
    • _downloadArtifact
    • _listWorkflowRunArtifacts
    • downloadPRCommentArtifact/downloadLabelsArtifact
  • Create a utility file called download-artifacts.js in github-actions/utils
    • Transform downloadPRCommentArtifact/downloadLabelsArtifact into one generic function, called downloadAndStoreArtifact
    • Keep _downloadArtifact and _listWorkflowRunArtifacts as private functions that will be called by downloadAndStoreArtifact
  • Implement the new utility file into the PR trigger workflow
  • In github-actions/trigger-pr/check-linked-issue.js:
    • Remove the deprecated artifact functions: _downloadArtifact and _listWorkflowRunArtifacts
    • Import downloadAndStoreArtifact by adding const downloadAndStoreArtifact = require('../utils/download-artifacts'); to the top of the file
    • Refactor downloadPRCommentArtifact to only call downloadAndStoreArtifact as a wrapper
    • Verify the workflow still runs as expected

Issue 2

  • Complexity: Medium
  • Relationships: Blocked by issue 1
    • Note, once both issues are created mark issue 2 as blocked by issue 1
  • Size: 0.25pt

Issue 2 Solution

  • View the following files to understand how the workflow executes and what needs to be refactored:
    • github-actions/trigger-pr/set-pr-labels.js
    • github-actions/utils/download-artifacts
    • .github/workflows/set-pr-labels.yaml
    • .github/workflows/wr-set-pr-labels.yaml
  • Implement the download artifacts utility into the Set PR labels workflow
  • In github-actions/trigger-pr/set-pr-labels.js:
    • Remove the deprecated artifact functions: _downloadArtifact and _listWorkflowRunArtifacts
    • Import downloadAndStoreArtifact by adding const downloadAndStoreArtifact = require('../utils/download-artifacts'); to the top of the file
    • Refactor downloadLabelsArtifact to only call downloadAndStoreArtifact as a wrapper
    • Verify the workflow still runs as expected

Resources/Instructions

Activity

  1. added
    Feature: Refactor GHARefactoring GitHub actions to fit latest architectural norms
    DraftIssue is still in the process of being created
    size: 0.25ptCan be done in 0.5 to 1.5 hours
    Complexity: See issue making labelSee the Issue Making label to understand the issue writing difficulty level
    on Oct 21, 2026
  2. added
    size: 0.5ptCan be done in 3 hours or less
    and removed
    size: 0.25ptCan be done in 0.5 to 1.5 hours
    on Oct 21, 2026
  3. added
    ready for merge teamneeds a senior review either to do some re writing or to approve it for ready for prioritization
    and removed
    DraftIssue is still in the process of being created
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Complexity: See issue making labelSee the Issue Making label to understand the issue writing difficulty levelEREmergent RequestFeature: Refactor GHARefactoring GitHub actions to fit latest architectural normsIssue Making: Level 2Make issue(s) from an ER or Epicready for merge teamneeds a senior review either to do some re writing or to approve it for ready for prioritizationrole: back end/devOpsTasks for back-end developerssize: 0.5ptCan be done in 3 hours or less

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions