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

Add seed data #27

Merged
merged 9 commits into from
Sep 12, 2024
Merged

Add seed data #27

merged 9 commits into from
Sep 12, 2024

Commits on Sep 12, 2024

  1. gitignore sensitive data

    rich authored and richpjames committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    4ffbc97 View commit details
    Browse the repository at this point in the history
  2. Update mapping function

    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.
    rich authored and richpjames committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    55c8bed View commit details
    Browse the repository at this point in the history
  3. Update Issues URL

    This is called pre-mapping so we use the casing from Github's API
    rich authored and richpjames committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    b791841 View commit details
    Browse the repository at this point in the history
  4. 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.
    rich authored and richpjames committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    1249fb3 View commit details
    Browse the repository at this point in the history
  5. Add repo name to persisted JSON

    We want to be able to display the name of the organisation too
    rich authored and richpjames committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    07f791f View commit details
    Browse the repository at this point in the history
  6. Add function to read repo data from JSON

    This simply reads from the data added by the function in the last
    commit.
    rich authored and richpjames committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    bcc2755 View commit details
    Browse the repository at this point in the history
  7. 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.
    rich authored and richpjames committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    9887ba0 View commit details
    Browse the repository at this point in the history
  8. Add seeding script

    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.
    rich authored and richpjames committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    07ce925 View commit details
    Browse the repository at this point in the history
  9. Update view

    We have some new data it is useful to show
    rich authored and richpjames committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    7e3463a View commit details
    Browse the repository at this point in the history