Skip to content
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

Post PBB migration: Refactor "Schedule Friday" workflow #7078

Closed
13 tasks done
Tracked by #6993 ...
t-will-gillis opened this issue Jun 28, 2024 · 6 comments · Fixed by #7260
Closed
13 tasks done
Tracked by #6993 ...

Post PBB migration: Refactor "Schedule Friday" workflow #7078

t-will-gillis opened this issue Jun 28, 2024 · 6 comments · Fixed by #7260
Assignees
Labels
Complexity: Large Feature: API Coding requires using an API Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly 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 time sensitive Needs to be worked on by a particular timeframe

Comments

@t-will-gillis
Copy link
Member

t-will-gillis commented Jun 28, 2024

Dependency

Overview

The new Projects Beta is structured a little differently from Projects (classic). During to our recent migration from Projects (classic) to Projects Beta, we scrubbed our workflows and removed all functionality that referenced 'columns' as this term is no longer used. We need to refactor our post migration workflows so that they have similar functionality as previously.

Details

The add-label.js file is part of the "Schedule Friday" workflow. It searches all open issues to check whether the issue assignee has been posting regular updates on the issue, and if not applies a label so to let the team know that the issue is stale. Prior to the Projects Beta migration, add-labels.js searched only those issues in the "In progress (actively working)" column, but this column reference is no longer valid. This file's logic needs to be rewritten in terms of the 'status' field instead, using GraphQL.

Action Items

  • This issue involves GithHub Actions and GraphQL. You will need the new Project Board Beta set up in your repo so that you are able to test and demonstrate your solution. Refer to the "Resources/Instructions" section below to get started, and be sure to let us know if you have questions.
  • Once the Dependency of issue Post PBB migration: Refactor "Issue Trigger"  #7075 is released, there will be three new files in github-actions/utils/- you will need to use two of these on this issue:
    • query-issue-info.js
    • _data/status-field-ids.js
  • In schedule-fri-0700.yml, around line 17 insert after with: :
    github-token: ${{ secrets.HACKFORLA_GRAPHQL_TOKEN }}  
    
  • Leave the other token reference in place. This will be addressed in the future.
  • In add-label.js, refactor the code using GraphQL so that only issues with a 'status' of "In progress (actively working)" are included.
    • Replace:
    for (let issueNum of result) {
      if (issueNum.number) {
        let issueLabels = [];
        for (let label of issueNum.labels) {
          issueLabels.push(label.name);
        }
        if (!issueLabels.some(item => labelsToExclude.includes(item))) {
          issueNums.push(issueNum.number);
        } else {
          console.log(`Excluding Issue #${issueNum.number} because of label`);
        }
      }
    }
    
    with:
    // Filter results; we only want issues in "In progress (actively working)" 
    for (let { number, labels } of result) {
      if (!number) continue;
    
      // Exclude any issues that have excluded labels
      const issueLabels = labels.map(label => label.name);
      if (issueLabels.some(item => labelsToExclude.includes(item))) continue;
    
      // For remaining issues, check if status === "In progress (actively working)"
      const { statusName } = await queryIssueInfo(github, context, number);
      if (statusName === "In progress (actively working)") {
        issueNums.push(number);
      }
    }
    
    • Since we only want to include assigned issues, after line 96 (defining repo), insert:
    assignee: '*',
    
    • On line 88, add Dependency to the labels to exclude
    • Replace the comments around lines 82-86 with:
     /**
     * Finds issue numbers for all open & assigned issues, excluding issues labeled `Draft`, `ER`, `Epic`,
     * or `Dependency`, and returning issue numbers only if their status === "In progess (actively working"
     *
     * @Returns{Array} issueNums   - an array of open, assigned, and statused issue numbers
     */
    
    • On line 36, capitalize GitHub
    • Between lines 3 and 4, insert:
    const statusFieldIds = require('../../utils/_data/status-field-ids');
    const queryIssueInfo = require('../../utils/query-issue-info');
    
  • Test in your own repo to confirm this is working properly

Resources/Instructions

@t-will-gillis t-will-gillis added role: back end/devOps Tasks for back-end developers Complexity: Large Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms size: 5pt Can be done in 19-30 hours Feature: API Coding requires using an API labels Jun 28, 2024
@t-will-gillis t-will-gillis added Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly Draft Issue is still in the process of being created labels Jun 28, 2024
@t-will-gillis t-will-gillis self-assigned this Jun 28, 2024

This comment has been minimized.

@t-will-gillis

This comment was marked as resolved.

@github-project-automation github-project-automation bot moved this from New Issue Approval to QA in P: HfLA Website: Project Board Jul 15, 2024
@t-will-gillis t-will-gillis reopened this Jul 15, 2024
@github-project-automation github-project-automation bot moved this from QA to New Issue Approval in P: HfLA Website: Project Board Jul 15, 2024
@t-will-gillis t-will-gillis added Dependency An issue is blocking the completion or starting of another issue and removed Draft Issue is still in the process of being created labels Jul 21, 2024
@t-will-gillis t-will-gillis moved this from New Issue Approval to Ice box in P: HfLA Website: Project Board Jul 22, 2024
@t-will-gillis t-will-gillis removed their assignment Jul 22, 2024
@t-will-gillis t-will-gillis moved this from Ice box to New Issue Approval in P: HfLA Website: Project Board Aug 2, 2024
@t-will-gillis t-will-gillis added Ready for Prioritization and removed Dependency An issue is blocking the completion or starting of another issue labels Aug 2, 2024
@ExperimentsInHonesty ExperimentsInHonesty added this to the 08. Team workflow milestone Aug 5, 2024
@ExperimentsInHonesty ExperimentsInHonesty added the time sensitive Needs to be worked on by a particular timeframe label Aug 5, 2024
@ExperimentsInHonesty ExperimentsInHonesty moved this from New Issue Approval to Prioritized backlog in P: HfLA Website: Project Board Aug 5, 2024
@mrodz mrodz self-assigned this Aug 9, 2024
@mrodz mrodz moved this from Prioritized backlog to In progress (actively working) in P: HfLA Website: Project Board Aug 9, 2024
@HackforLABot
Copy link
Contributor

Hi @mrodz, 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 :)

@mrodz
Copy link
Member

mrodz commented Aug 9, 2024

i. Availability: MTWTh 8am-8pm, FSSn 4pm-10pm
ii. ETA: EOD 8/10

@mrodz
Copy link
Member

mrodz commented Aug 9, 2024

Hi @t-will-gillis, I followed everything up until the final checkbox.

This import was included in the patch:

const statusFieldIds = require("../../utils/_data/status-field-ids");

While not being used anywhere in the file:

'statusFieldIds' is declared but its value is never read. ts(6133)

Given that importing the module does not appear to have any side effects, should I remove this import or leave it as is?

Working at: efb64d1

@t-will-gillis
Copy link
Member Author

Hi @mrodz Since it isn't being used you can remove it. Thanks for asking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Large Feature: API Coding requires using an API Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly 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 time sensitive Needs to be worked on by a particular timeframe
Projects
Development

Successfully merging a pull request may close this issue.

4 participants