Skip to content

Pulls languages from multiple repos#5037

Merged
adrianang merged 10 commits intohackforla:gh-pagesfrom
StephenTheDev1001:project-languages-pull-3805
Jul 31, 2023
Merged

Pulls languages from multiple repos#5037
adrianang merged 10 commits intohackforla:gh-pagesfrom
StephenTheDev1001:project-languages-pull-3805

Conversation

@StephenTheDev1001
Copy link
Contributor

@StephenTheDev1001 StephenTheDev1001 commented Jul 20, 2023

Fixes #3805

What changes did you make?

-allow for 2 repo ids to be scraped
-merge lanaguages array from both repos without duplicates
-added CTI backend repo id to md file

Why did you make the changes (we will use this info to test)?

-the languages section now shows languages used in both CTI Frontend and CTI Backend

Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)

Visuals before changes are applied

Screenshot from 2023-07-26 02-19-53

Screenshot from 2023-07-26 02-21-10

Details

Screenshot from 2023-07-26 02-22-32

Screenshot from 2023-07-26 02-22-38

Visuals after changes are applied

@github-actions
Copy link

Want to review this pull request? Take a look at this documentation for a step by step guide!

From your project repository, check out a new branch and test the changes.

git checkout -b StephenTheDev1001-project-languages-pull-3805 gh-pages
git pull https://github.com/StephenTheDev1001/website.git project-languages-pull-3805

@github-actions github-actions bot added role: back end/devOps Tasks for back-end developers Complexity: Large P-Feature: Project Info and Page A project's detail page (e.g. https://www.hackforla.org/projects/100-automations) size: 2pt Can be done in 7-12 hours labels Jul 20, 2023
@StephenTheDev1001 StephenTheDev1001 changed the title Project languages pull 3805 Pulls languages from multiple repos 3805 Jul 20, 2023
@StephenTheDev1001 StephenTheDev1001 changed the title Pulls languages from multiple repos 3805 Pulls languages from multiple repos Jul 20, 2023
@StephenTheDev1001

This comment was marked as outdated.

Copy link
Contributor

@MattPereira MattPereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StephenTheDev1001 admire your persistence and hard work on this issue

you might consider adding an extra key/value pair to the civic-tech-index.md that contains the additional repo id and then just adding conditional logic to projects.js and current-projects.js that checks for if that property exists on the project object in order to display the extra languages on both the project details page and the project cards

that way you may be able to avoid having to add nested loops to both files

@StephenTheDev1001
Copy link
Contributor Author

StephenTheDev1001 commented Jul 25, 2023

@MattPereira Should I make it to where we can add more than one additional repo to scrape from or is one additional repo enough?

@MattPereira
Copy link
Contributor

@StephenTheDev1001 I think one additional is fine since only this one project has multiple repos but I'm not up to date with website team affairs anymore

@t-will-gillis @roslynwythe what do you think?

@t-will-gillis
Copy link
Member

@StephenTheDev1001 I think one additional is fine since only this one project has multiple repos but I'm not up to date with website team affairs anymore

@MattPereira I am not aware of any other project that would need more than one additional repo to scrape for language data.

@StephenTheDev1001 StephenTheDev1001 marked this pull request as ready for review July 26, 2023 09:30
Copy link
Contributor

@MattPereira MattPereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @StephenTheDev1001 !!!

Nice execution, solid communication with the team, and quick turnaround on the requested changes 👍

@LRenDO
Copy link
Member

LRenDO commented Jul 27, 2023

Hi @adrianang! If you plan to review this PR, please add your ETA and availability when you have a minute. If not, please remove yourself as reviewer. Thanks!

@adrianang
Copy link
Member

  • Availability: FSS, 6 PM - 10 PM (PST) (Week of 7/24)
  • ETA: I plan on finishing this issue by Saturday, 7/29 at 10 PM.

Copy link
Member

@adrianang adrianang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @StephenTheDev1001 — the branching is set up correctly, the corresponding issue is linked, and the requested change has been made (ensure that Civic Tech Index shows all languages between its two repositories). In testing your branch on my local environment through Docker, I see the same thing that you had screenshotted for both the card view on the main Website page and the CTI project page view itself, and no other project seems to be affected as a result of these code changes.

I like the guard clauses that you set up, as a result of adding the second repo ID instead of appending it onto identification, as it minimizes the number of nested loop calls that the function makes (if I recall correctly, one of your previous commits called nested loops on each project). Nice job optimizing!

Thank you for sticking with the issue and seeing it through to completion; apologies that I couldn't be of more help, but it's great that you were able to find a pretty clever solution. Your efforts are deeply appreciated! 🙌🏼

@adrianang adrianang merged commit 9f0f386 into hackforla:gh-pages Jul 31, 2023
@StephenTheDev1001 StephenTheDev1001 deleted the project-languages-pull-3805 branch July 31, 2023 07:25
awellsbiz pushed a commit to awellsbiz/website that referenced this pull request Jul 31, 2023
* add repo id and turn project var into arr

* merge arrays of languages and remove duplicates

* add additional-repo-ids as separate

* add moreProjectIds var

* able to display languages from 2+ repos

* add comment where data comes from

* only working for one additional repo, not 3+

* project page showing languages from 2 repos

* working changes to current-projects

* remove some console.logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complexity: Large P-Feature: Project Info and Page A project's detail page (e.g. https://www.hackforla.org/projects/100-automations) role: back end/devOps Tasks for back-end developers size: 2pt Can be done in 7-12 hours

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow for project "languages" to be pulled from multiple repositories

5 participants