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

Update wiki page for GitHub Action: "add update label weekly" #4856

Closed
6 tasks done
Tracked by #6402 ...
roslynwythe opened this issue Jun 19, 2023 · 17 comments
Closed
6 tasks done
Tracked by #6402 ...

Update wiki page for GitHub Action: "add update label weekly" #4856

roslynwythe opened this issue Jun 19, 2023 · 17 comments
Assignees
Labels
Complexity: Medium Feature: Wiki role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours

Comments

@roslynwythe
Copy link
Member

roslynwythe commented Jun 19, 2023

Overview

We need to review and update the wiki page for the GitHub Action add update label weekly. In particular we need to create three new sections that have recently been added to the GHA wiki page template: "Labels", "Dependencies" and "Test Procedure".

Action Items

Resources/Instructions

@roslynwythe roslynwythe added Feature Missing This label means that the issue needs to be linked to a precise feature label. role missing size: missing Draft Issue is still in the process of being created labels Jun 19, 2023
@roslynwythe roslynwythe added this to New Issue Approval in Project Board via automation Jun 19, 2023
@roslynwythe roslynwythe added Complexity: Medium role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours Feature: Wiki and removed Complexity: Missing size: missing Feature Missing This label means that the issue needs to be linked to a precise feature label. labels Jun 19, 2023
@roslynwythe roslynwythe added Ready for Prioritization and removed Draft Issue is still in the process of being created labels Oct 23, 2023
@ExperimentsInHonesty ExperimentsInHonesty moved this from New Issue Approval to Prioritized backlog in Project Board Nov 6, 2023
@kiran98118 kiran98118 self-assigned this Nov 20, 2023
@kiran98118 kiran98118 moved this from Prioritized backlog to In progress (actively working) in Project Board Nov 20, 2023

This comment was marked as outdated.

@github-actions github-actions bot added the To Update ! No update has been provided label Dec 1, 2023

This comment was marked as outdated.

@kiran98118

This comment was marked as outdated.

@kiran98118 kiran98118 removed their assignment Dec 6, 2023
@t-will-gillis t-will-gillis removed the To Update ! No update has been provided label Feb 24, 2024
@t-will-gillis t-will-gillis moved this from In progress (actively working) to Prioritized backlog in Project Board Feb 24, 2024
@ExperimentsInHonesty ExperimentsInHonesty moved this from ERs that are ready to be turned into issues to Prioritized backlog in Project Board Feb 25, 2024
@gaylem gaylem self-assigned this Feb 28, 2024
Copy link

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

@gaylem
Copy link
Member

gaylem commented Feb 28, 2024

Availability: Weekdays 9AM - 8PM CST
ETA: Sunday 3/3 10PM CST

@gaylem gaylem moved this from Prioritized backlog to In progress (actively working) in Project Board Feb 28, 2024
@gaylem
Copy link
Member

gaylem commented Mar 1, 2024

Friday 3/1 Update: I've updated my ETA from EOD today to Sunday 3/3 because my schedule changed unexpectedly.

@gaylem
Copy link
Member

gaylem commented Mar 2, 2024

Summary

The add update label weekly GitHub Action checks the in-progress column from the project board and goes through each issue. If there is an assignee, it checks the timeline for the issue. If the issue is inactive for 7 days, it posts a comment to update the issue and ensures the label is changed to To Update !. If it inactive for 2 weeks, it adds the 2 weeks inactive label. Otherwise, it add the Status: Updated label. It removes all related labels if the ticket is updated between 3 and 7 days, the ticket was recently assigned, or a PR was submitted for the issue.

Labels:

  • Status: Updated
  • To Update !
  • 2 weeks inactive

Scheduled:

  • Scheduled to run at 7:00 AM every Friday

Workflow:

Supporting Files/Folder:

Process:

Every Friday at 7:00 AM, the add update label weekly GitHub Action checks the in-progress column from the project board and goes through each issue. If there is an assignee, it checks the timeline for the following:

  • If there is an update within 3 days, it adds the Status: Updated label
  • If the ticket inactive for 7 days, it posts a comment requesting the assignee to update the issue and changes the label to To Update !
  • If the ticket is inactive for 14 days, it adds the 2 weeks inactive label
  • It removes all related labels if: (a) the ticket is updated between 3 and 7 days, (b) the ticket was recently assigned, or (c) a PR was submitted for the issue

Test Procedure

Getting Started:

  1. Become familiar with the GHA testing process by reading the resources in the "Testing Resources" section below, as well as this GHA's files in the "Supporting Files/Folder" section.
  2. Copy the HfLA project board in your forked repo if you don't already have it.
  3. Add any test issues to In Progress (actively working) column.
  4. Create any PRs needed to check the open and closed PR conditions.
  5. Create an action secret TEST_COLUMN_ID where value is the In Progress (actively working) column ID on your forked board.

Modify Files:

  1. In schedule-fri-0700.yml file:

    • Change secrets.IN_PROGRESS_COLUMN_ID to secrets.TEST_COLUMN_ID in schedule-fri-0700.yml file to avoid unexpected behavior.
    • Set schedule for manual testing.
    adding `workflow-dispatch` to enable manual trigger

    image

  2. Adjust cut-off times for status labels in add-label.js as needed:

    To test the "Status: Updated" label condition

    Replace this:

    threeDayCutoffTime.setDate(threeDayCutoffTime.getDate() - updatedByDays)
    

    With this:

    threeDayCutoffTime.setDate(threeDayCutoffTime.getDate() - updatedByDays + 3)
    

    NOTE: This retains the label so the issue must already be labeled Status: Updated to begin with. It also requires a comment from the assignee.

    To test the "To Update !" label condition

    Replace this:

    threeDayCutoffTime.setDate(threeDayCutoffTime.getDate() - updatedByDays)
    const sevenDayCutoffTime = new Date()
    sevenDayCutoffTime.setDate(sevenDayCutoffTime.getDate() - commentByDays)
    

    With this:

    threeDayCutoffTime.setDate(threeDayCutoffTime.getDate() - updatedByDays + 5)
    const sevenDayCutoffTime = new Date()
    sevenDayCutoffTime.setDate(sevenDayCutoffTime.getDate() - commentByDays + 7)
    
    To test the "2 weeks inactive" label condition

    Replace this:

    threeDayCutoffTime.setDate(threeDayCutoffTime.getDate() - updatedByDays)
    const sevenDayCutoffTime = new Date()
    sevenDayCutoffTime.setDate(sevenDayCutoffTime.getDate() - commentByDays)
    const fourteenDayCutoffTime = new Date()
    fourteenDayCutoffTime.setDate(fourteenDayCutoffTime.getDate() - inactiveUpdatedByDays)
    

    With this:

    threeDayCutoffTime.setDate(threeDayCutoffTime.getDate() - updatedByDays + 7)
    const sevenDayCutoffTime = new Date()
    sevenDayCutoffTime.setDate(sevenDayCutoffTime.getDate() - commentByDays + 9)
    const fourteenDayCutoffTime = new Date()
    fourteenDayCutoffTime.setDate(fourteenDayCutoffTime.getDate() - inactiveUpdatedByDays + 14)
    

Run Tests:

  1. Push changes.
  2. Set default branch to feature branch.
  3. Run workflow manually and check results.

Testing Resources

@gaylem
Copy link
Member

gaylem commented Mar 2, 2024

Added link to the comment above to How to Contribute to the Wiki

@gaylem gaylem moved this from In progress (actively working) to Questions / In Review in Project Board Mar 2, 2024
@LRenDO
Copy link
Member

LRenDO commented Mar 7, 2024

Hi @gaylem!

Great work on this so far!

  • Links are working correctly
  • The link to the draft was added correctly to the "How to Contribute to the Wiki" page
  • The summary of changes was very helpful

I do have a couple changes to request.

  • It looks like this action also adds the 2 weeks inactive label.
    • add it to the description in your draft for the GHA: add update label weekly.
    • use the same process to add as you did with the comment above for the HfLA GitHub Actions wiki page.
  • In the action items, it said to add two sections. I might have missed it, but it looks like they are not included.
    • "Labels" - List those labels on which the GHA depends or affects.
    • "Test Procedure" - Detail the process for testing the GHA in case there is a code change or a change in a dependent label, resource or package.

In addition to the links provided in the issue, you may find this tips section, this wiki draft and this old PR helpful for writing up testing instructions.

When you're finished with the changes you can move the issue back to the Questions / In Review column and add the ready for dev lead label. Feel free to ping me here or on Slack for any help or clarification! Thanks again for taking on this issue!

@LRenDO LRenDO moved this from Questions / In Review to In progress (actively working) in Project Board Mar 7, 2024
@gaylem
Copy link
Member

gaylem commented Mar 7, 2024

Hey @LRenDO, thanks for your feedback. I was honestly a little confused about this ticket. Here's what isn't making sense to me:

  1. Are you saying I should add all the labels from add-label.js to my updated instructions like this? Is there anything else I need to do?

Labels

  • statusUpdatedLabel = 'Status: Updated'
  • toUpdateLabel = 'To Update !'
  • inactiveLabel = '2 weeks inactive'
  1. I'm not sure what you mean by "use the same process to add as you did with the comment above for the HfLA GitHub Actions wiki page." Can you clarify?

  2. Sorry about missing the testing part, I think I thought the process section sort of covered that but now I see it's more complex. I'm going to have to dig into that a bit but I'll work on it today.

Thanks!

UPDATE: I made some changes to my updated instructions, let me know if they're on the right track!

@LRenDO
Copy link
Member

LRenDO commented Mar 7, 2024

Hi @gaylem!

Let me see if I can clarify those areas.

  1. I believe what you have is pretty much what they are looking for in terms of labels. You probably don't need to add the variable name - just a list of the labels (i.e. only the Status: Updated part of the first one). I haven't taken a deep dive into this GHA in a while but I believe it might also use 'Status: Updated'. If you haven't already, I would just double check the code and make sure there aren't any other labels in there.

  2. Ah yes, let me clarify. I just meant to use the process outlined in the "How to Contribute to the Wiki" page to update the description on the HfLA GitHub Actions wiki page. The way you did for the "GHA: Update Label Weekly" page.

  3. All good! I had to read through the issue a few times to get a good handle on all the things it was asking for.

Again, feel free to reach out for help or clarification!

@gaylem
Copy link
Member

gaylem commented Mar 7, 2024

Thanks for your quick response, @LRenDO!

  1. I reviewed the add-label.js file and I'm only seeing the three I listed there. I've updated my instructions per your recommendations.

  2. I'm still a little confused, so let me know if this is correct: I thought this ticket was to update the add update label weekly section (see image below) and provide updated instructions for the GHA:-add-update-label-weekly page, which I did in the comments of this PR. Is there another page I'm supposed to edit? Or are you saying I need to to update the description below? I didn't make any changes because it seemed fine as is but let me know if I'm just misunderstanding.

Screenshot 2024-03-07 at 8 55 26 AM
  1. As for testing, I don't think I know enough about testing GH Actions to do this part effectively. I've copy/pasted what you wrote here. Let me know if that is sufficient, or if maybe I should hand this back to someone else to finish?

@gaylem
Copy link
Member

gaylem commented Mar 7, 2024

@LRenDO Ope I'm dumb, I just re-read the add update label weekly description and realized it's missing the other labels. Please disregard my previous question in #2 above, I'll make the changes.

@gaylem
Copy link
Member

gaylem commented Mar 7, 2024

Hey again @LRenDO -- I think I've made some progress. Let me know if this is sufficient: #4856 (comment)

Some more questions:

  1. Should I put the summary updates in a separate comment?
  2. Do I need to add a link for the summary to this page? https://github.com/hackforla/website/wiki/How-to-Contribute-to-the-Wiki

Thanks again for your patience and help with this!

@gaylem gaylem moved this from In progress (actively working) to Questions / In Review in Project Board Mar 8, 2024
@LRenDO
Copy link
Member

LRenDO commented Mar 8, 2024

Hi @gaylem! Looks like it's coming together! The Labels section looks great!

  • Great questions! Yes, on both 1 & 2:

    • The "Updated summary for add update label weekly in HfLA GitHub Actions" should be in a separate comment and should also include the entire page so that it can be completely replaced by the comment text.
    • The link to that comment should also be included in the "How to Contribute to the Wiki" page.
    • For both drafts you can remove the "Updated ... " line so that the only text in the comments is what will be moved to the new wiki.
  • I have a few requests for the testing section

    • Change title to "Test Procedure" (to be consistent since the issue uses that term, it's likely we want this to be consistent across the GHA Wikis)

    • Include an overview of the process something like:

      • Become familiar with the GHA testing process by reading the resources in the Testing Resources section and this GHAs files in the "Supporting Files/Folder" section.
      • Copy the HfLA project board in your forked repo if you don't already have it.
      • Add any test issues to In Progress (actively working) column
      • Create any PRs needed to check the open and closed PR conditions
      • In YAML file
        • Change secrets.IN_PROGRESS_COLUMN_ID to secrets.TEST_COLUMN_ID in YAML file so as not to avoid unexpected behavior
        • Set schedule for manual testing
      • Create an action secret TEST_COLUMN_ID where value is the In Progress (actively working) column ID on your forked board
      • Adjust cut off times for status labels as needed (This a summary section and include what you have in the testing section so the code blocks can be toggled)
      • Push changes
      • Set default branch to feature branch
      • Run workflow manually and check results
    • Add a section for testing resources that includes:

Again, feel free to ping me!

@gaylem gaylem moved this from Questions / In Review to In progress (actively working) in Project Board Mar 8, 2024
@gaylem
Copy link
Member

gaylem commented Mar 8, 2024

Workflows are yaml files

Supporting files can be

  • js
  • json
  • md
  • gitkeep

Template for GHA documentation

## Summary
### Scheduled
-
### Workflow
-
### Supporting Files/Folders
-
---
Back to [HfLA GitHub Actions](HfLA-GitHub-Actions)

Hack for LA's GHAs

add update label weekly

  • Checks the in-progress column from the project board and goes through each issue. If there is an assignee, it checks the timeline for the issue. If the issue is inactive for 7 days, it posts a comment to update the issue and ensures the label is changed to To Update !. If it inactive for 2 weeks, it adds the 2 weeks inactive label. Otherwise, it add the Status: Updated label. It removes all related labels if the ticket is updated between 3 and 7 days, the ticket was recently assigned, or a PR was submitted for the issue.

github data

  • Generates a new github-data.json and commits that to the repository

issue trigger

  • Check if an issue has the three required labels. If not, add the 'missing' labels and post a comment about adding missing labels. If the issue has all, post a comment that congratulates and gives more details about the project board

lint-scss

  • Checks and lints modified scss files in PRs

move closed issues

  • Moves a closed issue into either the QA or Done column of the project board. If the issue has a “hard” label (Feature: Refactor CSS, Feature: Refactor HTML, Feature: Refactor JS / Liquid, Feature: Refactor GH), the issue is moved to the Done column. If the issue has no “hard” labels but does have an “override” label (role: front end), the issue is moved to the QA column. If the issue has no “hard” or “override” labels and does have a “soft” label (role: back end/devOps, Feature: Analytics), it is moved to Done. All other issues are moved to QA

pr instructions

  • Creates an instruction on how to get a copy of a PR branch for review, then uploads the results into an artifact

pull request trigger

  • An open script that could be triggered when a pull request is closed on the following branches 'gh-pages', 'feature-homepage-launch', 'feature-tech-dropdown'

set pr labels

  • RegEx takes the issue number on the body of the PR, and uploads the results (including labels on the issue) into an artifact

update team members

  • Trim inactive members from the write team

vrms data

  • Generates a new vrms_data.json and commits that to the repository

wr pr instructions

  • Leaves a comment on new PRs with a link to the relevant documentation for reviewing PRs and the command line instructions for pulling down a new branch for review.

wr pull request trigger

  • An open script that should house all the other scripts (workflows) that should be triggered when a pull request is closed.

wr set pr labels

  • This workflow is triggered when workflow [Set PR labels] is completed. Downloads artifact for the completed workflow. Then, gets the PR and issue number from the downloaded artifact and uses an API request to get the labels. Lastly, puts the same labels into the PR.

Deprecated GHAs

no-labels-template.md

  • Removed the no-labels-template.md file so that the total number of bot comments are reduced, and developers would have less notifications. Edited lines 47-55 in post-labels-comment.js so that no comment object was created when all the correct labels were added, and therefore no comment is posted.

extra folders or files with unknown workflows

  • Supporting Files Folder: trigger-schedule - folder has one file .gitkeep and its empty - The .gitkeep was likely added as a way of forcing git to track the new empty directory when the person who created the GHA began working on it. This is not a supported feature of git and now that there is content in the directory, there is no real need for the .gitkeep file
    The commit message for the .gitkeep file is just “Create directory for gha refactor”

@gaylem gaylem moved this from In progress (actively working) to Questions / In Review in Project Board Mar 8, 2024
@LRenDO
Copy link
Member

LRenDO commented Mar 9, 2024

Hi @gayle! Great work! Both of the drafts look great and they are both linked correctly on the "How to contribute to the wiki" page. Thanks again for taking the time to work on this issue and contribute to our wiki!

@LRenDO LRenDO closed this as completed Mar 9, 2024
Project Board automation moved this from Questions / In Review to QA Mar 9, 2024
@HackforLABot HackforLABot moved this from QA to Done in Project Board Mar 9, 2024
This was referenced Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium Feature: Wiki role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours
Projects
Project Board
  
Done
Development

No branches or pull requests

6 participants