website
website copied to clipboard
ER: Add start dates and end dates to projects
Emergent Requirement - Problem
For a future feature, we need to have the start date of a project
Details
- In the future, when we add start and end dates in the sponsor-partner.yml file, we will be able to tell if someone is a founding partner/sponsor if we also have a start date on the project.
- When we move the information to the People Depot project, it will require project start dates.
Issue you discovered this emergent requirement in
- #5948
Date discovered
2024-05-05
Did you have to do something temporarily
- [ ] YES
- [x] NO
Who was involved
@bonniewolfe @roslynwythe @KwameTaylor
What happens if this is not addressed
Needing to refer back into the past manually to recall this information on older projects
Resources
- https://github.com/hackforla/website/blob/gh-pages/_data/external/github-data.json
- https://github.com/hackforla/website/tree/gh-pages/_projects
Recommended Action Items
- [x] Make a new issue
- [x] Discuss with team
- [ ] Let a Team Lead know
Potential solutions [draft]
We need to store the date a repo started. We probably don't need to ever pull this twice (unlike languages, etc), although we will need it for any new repos we add
- ways to get the data?
- pulling the date of first commit to a project repo
- If there are multiple repos for the same project, we should use the repo that has the oldest start date
- how to get new data for new repos that get added to the website?
- suggestions?
- manually looking it up and adding it the date via pr to the place we store it
- other?
- suggestions?
- where to store it?
- we could store it in the project.md files
- it doesn't seem to make sense to store it in the github-data.json
- other suggestions?
Hi @KwameTaylor.
Please don't forget to add the proper labels to this issue. Currently, the labels for the following are missing:
- Complexity, Role, Feature
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:
@ExperimentsInHonesty your thoughts?
Following is one way to find a project start date using a GitHub Action:
- The GitHub REST API (version 2022-11-18) to access information about a project's GitHub repo is here. Note that the
created_atdate is returned with the "Example response". - The API's
ownervariable is'hackforla', and therepovariable is the repo for the project, for example'website'. - With this info, a .yml can be written to trigger a small workflow that returns the
created_atdate for a project's repo. Continuing with the example for the'website'repo:# https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository # Example workflow to query REST API to find start date given a repo's name name: Find Start Date on: workflow_dispatch: jobs: Find_Start_Date: runs-on: ubuntu-latest steps: - name: Retrieve Repo id: retrieve-repo uses: actions/github-script@v7 with: script: | const OWNER = 'hackforla'; const REPO = 'website'; results = await github.request('GET /repos/{owner}/{repo}', { owner: OWNER, repo: REPO }); const START_DATE = results.data.created_at console.log(`The repo for project "${REPO}" created on: ${START_DATE.slice(0,10)}`);