Skip to content

Migrate from GitHub Reusable Workflows to GitHub Actions#104

Merged
jeffhandley merged 7 commits intodotnet:mainfrom
jeffhandley:jeffhandley/github-actions
Apr 30, 2025
Merged

Migrate from GitHub Reusable Workflows to GitHub Actions#104
jeffhandley merged 7 commits intodotnet:mainfrom
jeffhandley:jeffhandley/github-actions

Conversation

@jeffhandley
Copy link
Member

@jeffhandley jeffhandley commented Apr 24, 2025

Since launching Release v1.0.0 - 2025-03-06 - Initial version of GitHub workflow-based Issue Labeler, we've accumulated feedback and explored how to take this even further by migrating from Reusable Workflows to GitHub Actions. This will offers notable usability, stability, and maintainability benefits both for the implementation of the issue-labeler and more so for repositories that consume it.

Some reference documents on the types of reusability:

Notable Benefits

  • With the reusable workflows approach, every consuming repository needed to run a workflow to build the predictor-app and store it in the GitHub Action Cache, and use workflows to try to prevent the app from being evicted from cache.
    • If the predictor-app gets evicted from cache, all prediction jobs start failing
    • With a Docker-based GitHub Action, a container image with the predictor app is published to the GitHub Container Registry, providing a faster and more reliable way to invoke the predictor
  • Fewer and simpler workflows to manage in consuming repositories
    • With the reusable workflows, a lot of YAML-based workflow logic was replicatated into each consuming repository for managing the full lifecycle of the issue-labler's implementation details
    • The GitHub Actions introduced here consolidate much more of the workflow logic into the issue-labeler's action.yml files, and the workflows in each consuming repository are simpler to set up and maintain
  • Substantially improved output on the workflow jobs
    • While the reusable workflows could have gone further with their output, adoption of the GitHub Actions approach enables the usage of the GitHub.Actions.Core package to integrate rich summary and log output into each of the actions
    • All actions now produce rich summaries visible in the GitHub UI, displayed detailed information about data downloading, model training, model testing, model promotion, and testing
    • For example, to understand the model testing results previously, the full console log from the Tester application needed to be inspected and interpreted; teams onboarding to the issue-labeler shared feedback this was unintuitive. With the GitHub Actions implemented here, detailed job summaries are emitted in markdown and visibile on the Actions page in GitHub. The reports provide alerts that indicate whether training was deemed favorable, and links are provided for next steps.
    • Error handling is similarly improved throughout, with detailed console and summary output for all errors that occur, improving troubleshooting for consumers
  • Maintainability of Downloader, Trainer, Tester, and Predictor applications
    • The implementations have been revised to improve input/argument processing, and control flow

Migration for Consumers

Once a release with the GitHub Actions based implementation is merged, consumers will migrate by:

  1. Delete the labeler-build-predictor.yml workflow
  2. Update the labeler-cache-retention.yml workflow
  3. Update the labeler-predict-issues.yml workflow
  4. Update the labeler-predict-pulls.yml workflow
  5. Update the labeler-promote.yml workflow
  6. Update the labeler-train.yml workflow
  7. Delete all existing issue-labeler Action Cache entries, including the issue-labeler/predictor-app and all models
  8. Run the updated labeler-train.yml workflow to re-train the models, as the cache key naming conventions were updated
  9. Run the updated labeler-promote.yml workflow to promote the newly trained workflows into use

Issues Resolved

The following issues are resolved with this PR:

Fixes #87
Fixes #93
Fixes #95
Fixes #97
Fixes #98
Fixes #99
Fixes #100
Fixes #103

Workflow Onboarding and Execution

Issue labeler onboarding (jeffhandley/labeler-demo#1) illustrates the revised onboarding experience for adding the worfklows into a repository.

Here are example workflow runs showing the training, promotion, prediction, and cache retention job results:

@jeffhandley jeffhandley requested a review from Copilot April 24, 2025 19:49
@jeffhandley jeffhandley self-assigned this Apr 24, 2025
@github-actions github-actions bot added the area-Workflows Related to the issue-labeler reusable workflows label Apr 24, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the issue-labeler workflows from GitHub Reusable Workflows to a GitHub Actions–based approach to improve usability, stability, and maintainability. Key changes include new and updated workflows for release, training, promotion, prediction (for both issues and pull requests), cache retention, and a dedicated CI build.

Reviewed Changes

Copilot reviewed 60 out of 73 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/release.yml New release workflow for publishing the predictor container image.
.github/workflows/labeler-train.yml Updated training workflow with streamlined inputs and step-based control.
.github/workflows/labeler-promote.yml Revised promotion workflow with updated input names and backup parameters.
.github/workflows/labeler-predict-pulls.yml Updated pull request prediction workflow with refined input and condition logic.
.github/workflows/labeler-predict-issues.yml Updated issue prediction workflow with refined input and condition logic.
.github/workflows/labeler-cache-retention.yml Updated cache retention workflow that restores models to prevent eviction.
.github/workflows/ci-build.yml New CI build workflow to build and test the IssueLabeler solution.
Files not reviewed (13)
  • .github/workflows/build-predictor.yml: Language not supported
  • .github/workflows/build.yml: Language not supported
  • .github/workflows/cache-retention.yml: Language not supported
  • .github/workflows/download-issues.yml: Language not supported
  • .github/workflows/download-pulls.yml: Language not supported
  • .github/workflows/labeler-build-predictor.yml: Language not supported
  • .github/workflows/predict-issues.yml: Language not supported
  • .github/workflows/predict-pulls.yml: Language not supported
  • .github/workflows/promote-issues.yml: Language not supported
  • .github/workflows/promote-pulls.yml: Language not supported
  • .github/workflows/test-issues.yml: Language not supported
  • .github/workflows/test-pulls.yml: Language not supported
  • .github/workflows/train-issues.yml: Language not supported
Comments suppressed due to low confidence (5)

.github/workflows/release.yml:15

  • Confirm that the tag 'noble-chiseled' for the BASE_IMAGE is intentional as it deviates from conventional version numbers.
  BASE_IMAGE: mcr.microsoft.com/dotnet/runtime:9.0-noble-chiseled

.github/workflows/labeler-predict-pulls.yml:41

  • Ensure that updating the repository owner condition from 'dotnet' to 'jeffhandley' is intended.
if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'jeffhandley' }}

.github/workflows/labeler-predict-issues.yml:32

  • Verify that changing the repository owner check to 'jeffhandley' aligns with the intended deployment scope.
if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'jeffhandley' }}

.github/workflows/labeler-cache-retention.yml:24

  • Confirm that the cache retention condition now targeting 'jeffhandley' as repository owner (instead of 'dotnet') is intentional.
if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'jeffhandley' }}

.github/workflows/labeler-train.yml:48

  • [nitpick] Consider if using the string "null" for EXCLUDED_AUTHORS is intentional or if an empty value or explicit null would be more appropriate.
  EXCLUDED_AUTHORS: "null"

@jeffhandley jeffhandley requested a review from Copilot April 25, 2025 16:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the issue-labeler workflows from reusable workflows to GitHub Actions, improving usability, stability, and maintainability. Key changes include:

  • Introduction of new workflows (release, CI build) and updated workflows for training, promotion, prediction, and cache retention.
  • Consolidation and renaming of input parameters and jobs for clarity and consistency.
  • Enhanced error handling and reporting through richer job summaries.

Reviewed Changes

Copilot reviewed 60 out of 73 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/release.yml New release workflow for publishing the Docker container image.
.github/workflows/labeler-train.yml Updated training workflow with restructured inputs and standardized naming.
.github/workflows/labeler-promote.yml Updated promotion workflow with clearer input naming.
.github/workflows/labeler-predict-pulls.yml Updated prediction workflow for pull requests with modified input names.
.github/workflows/labeler-predict-issues.yml Updated prediction workflow for issues with modified input names.
.github/workflows/labeler-cache-retention.yml Updated cache retention workflow with revised cache key handling.
.github/workflows/ci-build.yml New CI build workflow for building and testing the solution.
Files not reviewed (13)
  • .github/workflows/build-predictor.yml: Language not supported
  • .github/workflows/build.yml: Language not supported
  • .github/workflows/cache-retention.yml: Language not supported
  • .github/workflows/download-issues.yml: Language not supported
  • .github/workflows/download-pulls.yml: Language not supported
  • .github/workflows/labeler-build-predictor.yml: Language not supported
  • .github/workflows/predict-issues.yml: Language not supported
  • .github/workflows/predict-pulls.yml: Language not supported
  • .github/workflows/promote-issues.yml: Language not supported
  • .github/workflows/promote-pulls.yml: Language not supported
  • .github/workflows/test-issues.yml: Language not supported
  • .github/workflows/test-pulls.yml: Language not supported
  • .github/workflows/train-issues.yml: Language not supported
Comments suppressed due to low confidence (2)

.github/workflows/labeler-predict-pulls.yml:38

  • [nitpick] Consider renaming the job 'predict-pull-label' to 'predict-pulls' to maintain consistent naming with the issues prediction workflow ('predict-issue-label').
predict-pull-label:

.github/workflows/labeler-train.yml:17

  • [nitpick] Consider renaming the 'steps' input to 'training_steps' to distinguish it from the workflow's job steps and improve clarity.
steps:

@jeffhandley jeffhandley force-pushed the jeffhandley/github-actions branch from 1c23b6f to 768b7a5 Compare April 26, 2025 07:06
Update the release workflow to write a summary and update the predict action to use the new digest
@jeffhandley jeffhandley force-pushed the jeffhandley/github-actions branch from 768b7a5 to 3f1722d Compare April 26, 2025 07:07
@jeffhandley jeffhandley requested a review from RussKie April 28, 2025 17:35
@jeffhandley jeffhandley merged commit e22054c into dotnet:main Apr 30, 2025
3 checks passed
@jeffhandley jeffhandley deleted the jeffhandley/github-actions branch April 30, 2025 19:49
Copy link
Contributor

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opps, it appears I never posted this...

Comment on lines +10 to +12
private ICoreService action;
private Action<string?> showUsage;
private Queue<string>? arguments { get; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer we used the same naming conventions and code styles used throughout dotnet/* repos - specifically here: underscore fields, no "this.". The getter here doesn't look justified either.

Comment on lines +51 to +61
if (arguments is not null)
{
if (arguments.TryDequeue(out string? argValue))
{
input = argValue;
}
}
else
{
input = action.GetInput(inputName);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we invert this, it'd be simpler:

Suggested change
if (arguments is not null)
{
if (arguments.TryDequeue(out string? argValue))
{
input = argValue;
}
}
else
{
input = action.GetInput(inputName);
}
if (arguments is null)
{
input = action.GetInput(inputName);
}
else if (arguments.TryDequeue(out string? argValue))
{
input = argValue;
}

@jeffhandley jeffhandley added needs-area-label and removed area-Workflows Related to the issue-labeler reusable workflows labels Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment