Skip to content

Enhance GHA post-labels-comments.js to use label-directory.json #7532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
10 tasks done
Tracked by #6454
t-will-gillis opened this issue Sep 28, 2024 · 6 comments · Fixed by #8045
Closed
10 tasks done
Tracked by #6454

Enhance GHA post-labels-comments.js to use label-directory.json #7532

t-will-gillis opened this issue Sep 28, 2024 · 6 comments · Fixed by #8045
Assignees
Labels
Complexity: Large Feature Missing This label means that the issue needs to be linked to a precise feature label. Lang: GHA GitHub Actions role: back end/devOps Tasks for back-end developers size: 5pt Can be done in 19-30 hours Skill: enhance

Comments

@t-will-gillis
Copy link
Member

t-will-gillis commented Sep 28, 2024

Overview

We want to enhance the GHA workflows to reference each label by a general ID (i.e. a 'labelKey') rather than the label's name so that other HfLA project groups can use these workflows without needing to match the label names used by the Website team.

Details

Currently, the GHA workflows files that add, remove, and change labels on issues identify each label by its name (i.e. the 'labelName') directly. Instead of hard-coding each label name, we want these files to identify each label by its 'labelKey' and use the retrieve-label-directory.js module to look up the corresponding 'labelName' that is needed in order for the REST API to apply labels to issues.

Action Items

This issue involves specifically the post-labels-comments.js function of the "Issue Trigger" GitHub Action, and you must set up your environment for testing GHAs in order to work on this issue. See notes below in "Resources/ Instructions", and ask questions if you need additional help- GHAs can be tricky, and if you get stuck somewhere, someone who has worked on these before might have information that will save you a lot of time.

  • Before making any of the edits following, first create a test branch in your repo and demonstrate the current, correct behavior of the "Issue Trigger" GHA. Afterwards, create an additional branch for the edits following- this is the branch that will be attached to the PR.

Refer to post-labels-comments.js.

  • A preliminary search found that this file uses the following labels. As you work through this issue, confirm that this list is correct, and note any additions or subtractions as needed:

    • size: missing
    • Feature Missing
    • Complexity: Missing
    • role missing
  • Replace:

    var fs = require("fs");
    const postComment = require('../../utils/post-issue-comment');
    const formatComment = require('../../utils/format-comment');
    

    with:

    // Import modules
    var fs = require('fs');
    const postComment = require('../../utils/post-issue-comment');
    const formatComment = require('../../utils/format-comment');
    const retrieveLabelDirectory = require('../../utils/retrieve-label-directory');
    
  • Replace the following:

    // Constant variables
    const LABELS_OBJ = {
      'Complexity: Missing': 'Complexity',
      'role missing': 'Role',
      'Feature Missing': 'Feature',
      'size: missing': 'Size'
    };
    

    with:

    // Label constants use labelKeys to retrieve current labelNames from directory
    const LABELS_OBJ = [
      sizeMissing,
      featureMissing,
      complexityMissing,
      roleMissing
    ] = [
      "sizeMissing",
      "featureMissing",
      "complexityMissing",
      "roleMissing"
    ].map(retrieveLabelDirectory);
    
  • Search the code for instances of the original label name and substitute the defined above.

  • Prior to submitting the PR, search for all code comment that reference a specific label name. If found:

    • List these instances out in a comment on this issue, with your suggestion for replacement text that generalizes it.
    • When finished, add the label ready for product and change status to "Questions / In Review"
    • Product will review and provide feedback on replacement text for revision or sign-off on changes.
  • Perform a test in your own repo that demonstrates that there is no change to the GHA's functionality after making the edits.

Resources/Instructions

@t-will-gillis t-will-gillis added Complexity: Large Draft Issue is still in the process of being created Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms role: back end/devOps Tasks for back-end developers size: 5pt Can be done in 19-30 hours labels Sep 28, 2024
@t-will-gillis t-will-gillis added this to the 08. Team workflow milestone Sep 28, 2024
@t-will-gillis t-will-gillis self-assigned this Sep 28, 2024
@HackforLABot

This comment has been minimized.

@t-will-gillis t-will-gillis added Ready for Prioritization and removed Draft Issue is still in the process of being created labels Oct 26, 2024
@t-will-gillis t-will-gillis removed their assignment Oct 26, 2024
@t-will-gillis t-will-gillis added Draft Issue is still in the process of being created ready for product and removed Ready for Prioritization Draft Issue is still in the process of being created labels Nov 5, 2024
@ExperimentsInHonesty ExperimentsInHonesty moved this from New Issue Approval to Prioritized backlog in P: HfLA Website: Project Board Jan 21, 2025
@santisecco santisecco self-assigned this Feb 16, 2025
@HackforLABot

This comment has been minimized.

@HackforLABot HackforLABot moved this from Prioritized backlog to New Issue Approval in P: HfLA Website: Project Board Feb 16, 2025
@t-will-gillis t-will-gillis added Status: Unassigned by Bot Previously-prioritized issues that bot places in "New Issue Approval" and removed Ready for Prioritization Status: Unassigned by Bot Previously-prioritized issues that bot places in "New Issue Approval" labels Feb 25, 2025
@t-will-gillis t-will-gillis moved this from New Issue Approval to In progress (actively working) in P: HfLA Website: Project Board Feb 25, 2025
@t-will-gillis t-will-gillis moved this from In progress (actively working) to Prioritized backlog in P: HfLA Website: Project Board Feb 25, 2025
@Khinememe-Kyaw Khinememe-Kyaw self-assigned this Mar 10, 2025
@Khinememe-Kyaw Khinememe-Kyaw moved this from Prioritized backlog to In progress (actively working) in P: HfLA Website: Project Board Mar 10, 2025
@HackforLABot

This comment has been minimized.

@HackforLABot HackforLABot added the Status: Unassigned by Bot Previously-prioritized issues that bot places in "New Issue Approval" label Mar 10, 2025
@HackforLABot HackforLABot moved this from In progress (actively working) to New Issue Approval in P: HfLA Website: Project Board Mar 10, 2025
@ExperimentsInHonesty ExperimentsInHonesty added Lang: GHA GitHub Actions Skill: refactor Skill: enhance and removed Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms Skill: refactor labels Mar 11, 2025
@ExperimentsInHonesty ExperimentsInHonesty changed the title Refactor GHA post-labels-comments.js to use label-directory.json Enhance GHA post-labels-comments.js to use label-directory.json Mar 11, 2025
@t-will-gillis t-will-gillis moved this from New Issue Approval to Prioritized backlog in P: HfLA Website: Project Board Mar 24, 2025
@t-will-gillis t-will-gillis removed the Status: Unassigned by Bot Previously-prioritized issues that bot places in "New Issue Approval" label Mar 24, 2025
@aadilahmed aadilahmed self-assigned this Apr 1, 2025
@HackforLABot
Copy link
Contributor

Hi @aadilahmed, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:-
i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?)
ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

@aadilahmed aadilahmed moved this from Prioritized backlog to In progress (actively working) in P: HfLA Website: Project Board Apr 1, 2025
@aadilahmed
Copy link
Member

i. Availability: Monday-Friday 9AM - 5PM
ii. ETA: 4/6/2025 EOD

@aadilahmed
Copy link
Member

No label names are used in comments in post-labels-comment.js.

@github-project-automation github-project-automation bot moved this from In progress (actively working) to QA in P: HfLA Website: Project Board Apr 12, 2025
@ExperimentsInHonesty ExperimentsInHonesty added the Feature Missing This label means that the issue needs to be linked to a precise feature label. label Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Large Feature Missing This label means that the issue needs to be linked to a precise feature label. Lang: GHA GitHub Actions role: back end/devOps Tasks for back-end developers size: 5pt Can be done in 19-30 hours Skill: enhance
Projects
Development

Successfully merging a pull request may close this issue.

6 participants