Closed roslynwythe closed 3 weeks ago
Hi @roslynwythe.
Please don't forget to add the proper labels to this issue. Currently, the labels for the following are missing:
NOTE: Please ignore this comment if you do not have 'write' access to this directory.
To add a label, take a look at Github's documentation here.
Also, don't forget to remove the "missing labels" afterwards. To remove a label, the process is similar to adding a label, but you select a currently added label to remove it.
After the proper labels are added, the merge team will review the issue and add a "Ready for Prioritization" label once it is ready for prioritization.
Additional Resources:
@roslynwythe
Also, I don't really understand what the value of the inclusion of this is
I read it, but it was not clear what that was in reference to. We generally don't want to link to a comment that then requires us to scroll up to prior comments to understand what it's related to, because that can lead someone down a rabbit hole. If we could summarize that or give context before they view the link, that would work.
@roslynwythe
- I think this issue needs some more clarity. Since this issue is part of an epic, I have added a note to the Epic here with my questions Epic: Create GitHub Action Wiki pages #6403 (comment).
Please see my response https://github.com/hackforla/website/issues/6403#issuecomment-2067931770
Also, I don't really understand what the value of the inclusion of this is
- Additional notes that may be helpful are here: Update documentation: fix broken links #6355 (comment)
I read it, but it was not clear what that was in reference to. We generally don't want to link to a comment that then requires us to scroll up to prior comments to understand what it's related to, because that can lead someone down a rabbit hole. If we could summarize that or give context before they view the link, that would work.
You are corret, it is not relevant. I had copied the Resources/Instructions section from a different issue and included that one by mistake.
Hi @YolandaHaynes, 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 :)
Availability: Wed - Thur 8:30-10:30pm, Sun 1-4pm ETA: EOD 4/28/24
Udpating my timeframe due to time conflicts last week. Roadblocks: trying to understand the GHA and not finding/understanding what 'labels' to add for the new section. Continuing reading and understanding the concepts. Availability: Tue/Thur 8:30-11:30pm pst ETA: 05/03/24
Hi @YolandaHaynes It appears that there aren't any labels relevant to this GHA, so you can just write "none".
The schedule-daily-1100.yml GitHub Action retrieves Hack for LA's project repository information using the get-project-data.js script. It then overwrites the github-data.json file with the current repository data and commits it to the website repository. The new data will then display in each project's page. This action is triggered daily by a cron job.
{
id: repo.id,
name: repo.name,
languages: Object.keys(repoLanguages.data),
repoEndpoint: repo.url,
commitContributors: {
data: commitContributors
},
issueComments: {
data: issueCommentContributors
},
contributorsComplete: {
data: projectContributors
},
}
In order to start testing, you will need to create the HACKFORLA_PA_BOT_TOKEN
in your personal repo. Review the GitHub documentation for creating a personal access token . When creating the token, select the following scopes:
Then you can add the token to your personal repo using these instructions.
Update the schedule-daily-1100.yml
workflow file by adding the workflow_dispatch
command below. This will allow you to trigger the GHA manually on your working branch so that you can test it.
Change the github.repository
from hackforla/website
to your-github-handle/your-repo-name
.
on:
schedule:
- cron: '0 11 * * *'
workflow_dispatch:
jobs:
github_data:
runs-on: ubuntu-latest
if: github.repository == 'your-github-handle/your-repo-name' # Usually the repo name is `website` unless you changed it while forking the main Hack for LA repo
Change your default repo to your working branch using these instructions.
Since this GitHub Action updates data about Hack for LA's many projects/repos, you will need to replicate the Hack for LA organization to test this workflow. a. Create a new organization. GitHub official docs b. Transfer your repo to the newly created organization. GitHub Doc on how to transfer c. Create a couple of test project repositories with contributors, code, url, language etc as if it's a real project repo. An easy way to do this may be to fork some of Hack for LA's existing projects.
After you have created a mock scenario, trigger the GHA by pushing to your repo.
Make sure to test both happy and unhappy paths and consider possible edge cases.
The expected result is that the workflow will overwrite the existing github-data.json
file with the new data. You should see the data you created reflected there. Given your personal repo may not possess all of the projects that exist on Hack for LA, keep that in mind as you test. Check to see if the new changes made it to the github-data.json
file.
[!CAUTION] Before you submit a PR, do the following:
- Remove the
workflow_dispatch
command- Change
github.repository
back tohackforla/website
- Change your default repo back to
gh-pages
- Revert any changes you made to the
github-data.json
file for testing on your branch
Still work in progress
Questions:
Am on the right path with the testing procedure instructions for the GHA?
I'm not entirely sure if I am understanding this GHA. I added my summary at the top from what I gathered reading through the resources. So when this GHA gets triggered, it updates the github-data.json file with new data. Does that mean when this json file gets updated, then in the Hack for LA's project section, each Project's page will have the most up-to-date information? Is this the reason behind this GHA?
How is the data in github-data.json
used? Will it automatically display on the projects page?
Hi @roslynwythe , I'm unsure about the testing procedure for this GHA. Please let me know if I'm on the right path with what I have written above.
Hey @YolandaHaynes Thanks for working on this! I have some comments:
Regarding the section "Test Procedure":
GITHUB_TOKEN
is automatic and that you don't need to add it explicitly.workflow-dispatch:
permanently.github-data.json
file on that person's own repo.github-data.json
but this is not guaranteed- the action stefanzweifel/git-auto-commit-action@v5.0.1
checks the existing data file and only updates when and if it detects changes. If you were to run simultaneous tests of "Schedule Daily 1100", there likely would be no changes to the data, so nothing new would be written, but this is ok. The successful test is to check whether the test run is 'all green' and whether the auto-commit step either determined that the data was already up-to-date (thus did not update anything) or the auto-commit updated the data.Regarding your questions:
github-data.json
), this is saying that for the "Home Unite Us" project, Erik Guntner has made 447 all-time contributions to the project, Tyler Home has 164, etc. Then on the Home Unite Us page, Eric's profile is shown, then Tyler's, then the person with the next highest contributions, etc.
3: yes - see above
Thanks for starting this write up and working to understand what is happening! I will try to add more, and let me know if I can help with anything...
PS I would recommend adding the quotes around 'hackforla/website'
instead of just hackforla/website
- I am saying this because if the quotes aren't included, the workflow will crash.
@YolandaHaynes
Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.
If you need help, be sure to either: 1) place your issue in the Questions/In Review
column of the Project Board and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.
You are receiving this comment because your last comment was before Tuesday, May 14, 2024 at 12:06 AM PST.
Hi @t-will-gillis Thank you so much for your feedback. Below I have updated with your input. Please let me know if I misunderstood something or missed anything else.
For the workflow section you made the comment about, I just took the information from https://github.com/hackforla/website/wiki/GHA:-github-data. I thought that information was already updated and verified since it was last edited in 2023. I slightly updated the workflow section from your input.
Updated version below:
The schedule-daily-1100.yml GitHub Action retrieves Hack for LA's project repository information using the get-project-data.js script. It then overwrites the github-data.json file with the current repository data and commits it to the website repository. The new data will then display in each project's page. This action is triggered daily by a cron job.
{
id: repo.id,
name: repo.name,
languages: Object.keys(repoLanguages.data),
repoEndpoint: repo.url,
commitContributors: {
data: commitContributors
},
issueComments: {
data: issueCommentContributors
},
contributorsComplete: {
data: projectContributors
},
}
Change your default repo to your working branch using these instructions.
To set up your testing environment, please follow the steps here: Set-Up Environment
In order to start testing, your GITHUB_TOKEN
is automatically added, and you don't need to add it explicitly. You can read the GitHub official doc under secretes in workflow. You will need to create the HACKFORLA_PA_BOT_TOKEN
in your personal repo. Review the GitHub documentation for creating a personal access token . When creating the token, select the following scopes:
Then you can add the token to your personal repo using these instructions.
Update the schedule-daily-1100.yml
workflow file by adding the workflow_dispatch
command below. This will allow you to trigger the GHA manually on your working branch so that you can test it.
Change the github.repository
from 'hackforla/website'
to 'your-github-handle/your-repo-name'
. Also remember to update your token from HACKFORLA_PA_BOT_TOKEN
to your newly created token ${{ secrets.Your_New_Token }}
on:
schedule:
- cron: '0 11 * * *'
workflow_dispatch:
jobs:
github_data:
runs-on: ubuntu-latest
if: github.repository == 'your-github-handle/your-repo-name' # Usually the repo name is `website` unless you changed it while forking the main Hack for LA repo
To trigger the GHA, go to the "Actions" tab, select "Schedule Daily 1100" on the left, and then selecting "Run workflow" button to the right.
A successful test will most likely update the data in github-data.json, but this is not guaranteed. The action stefanzweifel/git-auto-commit-action@v5.0.1
checks the existing data file and only updates when and if it detects changes. If you were to run simultaneous tests of "Schedule Daily 1100", there likely would be no changes to the data, so nothing new would be written, but this is ok. The successful test is to check whether the test run is 'all green' and whether the auto-commit step either determined that the data was already up-to-date (thus did not update anything) or the auto-commit updated the data.
[!CAUTION] Before you submit a PR, do the following:
- Change
github.repository
back tohackforla/website
- Change the token back to
${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
- Change your default repo back to
gh-pages
Thank you again @t-will-gillis for your guidance. I wasn't able to test before because I wasn't sure if I was on the right path with how to test this GHA initially. I am now able to test it on my end and I had a successful test with a green check. Please let me know if some of the instructions are not clear enough, or I put in too much information.
Hi @YolandaHaynes - The instructions before you worked on this were pretty sparse, so this is a great improvement! It is looking very good and I think you are giving the right amount of information.
Here are a couple more suggestions, if you agree. (I did not copy the links to the snippets below). For the Summary, this might be clearer:
The [schedule-daily-1100.yml]() GitHub Action retrieves Hack for LA's team member contributions from each project’s repository using the [get-project-data.js]() script. It then updates the [github-data.json]() file …
And for the Workflow:
- Retrieves member contribution data from each HFLA project's repo and saves it to [github-data.json]()
Thanks again for working on this!
The schedule-daily-1100.yml GitHub Action retrieves Hack for LA’s team member contribution from each project’s repository using the project get-project-data.js script. It then updates the github-data.json file with the current repository data and commits it to the website repository. The new data will then display in each project's page. This action is triggered daily by a cron job.
{
id: repo.id,
name: repo.name,
languages: Object.keys(repoLanguages.data),
repoEndpoint: repo.url,
commitContributors: {
data: commitContributors
},
issueComments: {
data: issueCommentContributors
},
contributorsComplete: {
data: projectContributors
},
}
Change your default repo to your working branch using these instructions.
To set up your testing environment, please follow the steps here: Set-Up Environment
In order to start testing, your GITHUB_TOKEN
is automatically added, and you don't need to add it explicitly. You can read the GitHub official doc under secretes in workflow. You will need to create the HACKFORLA_PA_BOT_TOKEN
in your personal repo. Review the GitHub documentation for creating a personal access token . When creating the token, select the following scopes:
Then you can add the token to your personal repo using these instructions.
Update the schedule-daily-1100.yml
workflow file by adding the workflow_dispatch
command below. This will allow you to trigger the GHA manually on your working branch so that you can test it.
Change the github.repository
from 'hackforla/website'
to 'your-github-handle/your-repo-name'
. Also remember to update your token from HACKFORLA_PA_BOT_TOKEN
to your newly created token ${{ secrets.Your_New_Token }}
on:
schedule:
- cron: '0 11 * * *'
workflow_dispatch:
jobs:
github_data:
runs-on: ubuntu-latest
if: github.repository == 'your-github-handle/your-repo-name' # Usually the repo name is `website` unless you changed it while forking the main Hack for LA repo
To trigger the GHA, go to the "Actions" tab, select "Schedule Daily 1100" on the left, and then selecting "Run workflow" button to the right.
A successful test will most likely update the data in github-data.json, but this is not guaranteed. The action stefanzweifel/git-auto-commit-action@v5.0.1
checks the existing data file and only updates when and if it detects changes. If you were to run simultaneous tests of "Schedule Daily 1100", there likely would be no changes to the data, so nothing new would be written, but this is ok. The successful test is to check whether the test run is 'all green' and whether the auto-commit step either determined that the data was already up-to-date (thus did not update anything) or the auto-commit updated the data.
[!CAUTION] Before you submit a PR, do the following:
- Change
github.repository
back tohackforla/website
- Change the token back to
${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
- Change your default repo back to
gh-pages
Attached above comment into the How to Contribute Wiki Page under the GHA: github data
section.
@t-will-gillis I’m a little bit confused as to how to have this peer reviewed. Please let me know what steps I need to do next to start that process. Thank you.
Hey @YolandaHaynes - Looks great and thanks so much for all of your work! (And thanks for putting up with the review.) In retrospect, I think this was much more than a Complexity: Medium
...
You added the link to the Wiki, and what we've been doing counts as peer review, so I will 'Close as Completed' and you can move on to your next issue.
Overview
We need to review and update the wiki page for the GitHub Action
github-data
. In particular we need to create two new sections that have recently been added to the GHA wiki page template: "Labels" and "Test Procedure".Action Items
yml
andjs
files and understand the logic of the GHA.Merge Team/Dev Lead
Dependency
label from #6786 then move it from the Ice Box and insert the link to the draft wiki page from this issue, into the Resources section of #6786Resources/Instructions
This issue was create as a result of #6403
HfLA's GitHub Actions main wiki page
HfLA GitHub Actions wiki page - with index to GHAs
add update label weekly wiki page.
How to Contribute to the Wiki
Additional notes that may be helpful are here: Issue 6355 comments