-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add seed data #27
Merged
Merged
Add seed data #27
Commits on Sep 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4ffbc97 - Browse repository at this point
Copy the full SHA 4ffbc97View commit details -
This function won't be used to map repos from the Github API to the UI anymore but from our stored repos to the UI repos. This means we can just convert the date from ISO8601 to a JS Date object. We retain the total number of repos as this may come in handy later.
Configuration menu - View commit details
-
Copy full SHA for 55c8bed - Browse repository at this point
Copy the full SHA 55c8bedView commit details -
This is called pre-mapping so we use the casing from Github's API
Configuration menu - View commit details
-
Copy full SHA for b791841 - Browse repository at this point
Copy the full SHA b791841View commit details -
Add script to fetch all repos from Github
This script pulls in all repos for the org where Towtruck is installed. It pulls the relevant properties from the repo data and pushes this info to an array. We ignore any archived repos which reduces the number of repos by >50%. We then write this repo data to a JSON file to be used later. I couldn't work out a way to unit test the function that didn't result in tests that were harder to read than the function itself. The mocking in Node's built in test runner is still experimental so we may need to introduce a standalone test runner (Vitest, Jest) to be able to mock properly.
Configuration menu - View commit details
-
Copy full SHA for 1249fb3 - Browse repository at this point
Copy the full SHA 1249fb3View commit details -
Add repo name to persisted JSON
We want to be able to display the name of the organisation too
Configuration menu - View commit details
-
Copy full SHA for 07f791f - Browse repository at this point
Copy the full SHA 07f791fView commit details -
Add function to read repo data from JSON
This simply reads from the data added by the function in the last commit.
Configuration menu - View commit details
-
Copy full SHA for bcc2755 - Browse repository at this point
Copy the full SHA bcc2755View commit details -
Fetch repos from JSON in the server
Previously we were fetching all the repos on each request to the server by iterating through each installation of the app and every repo of that installation. Now we just read from the seeded JSON instead.
Configuration menu - View commit details
-
Copy full SHA for 9887ba0 - Browse repository at this point
Copy the full SHA 9887ba0View commit details -
The app will no longer work unless the seed script is run. We don't always want to seed this data as we hit the prod GH API. For now the seeding can be run by passing a flag to the script/bootstrap command.
Configuration menu - View commit details
-
Copy full SHA for 07ce925 - Browse repository at this point
Copy the full SHA 07ce925View commit details -
We have some new data it is useful to show
Configuration menu - View commit details
-
Copy full SHA for 7e3463a - Browse repository at this point
Copy the full SHA 7e3463aView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.