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 initial events data and update script #6

Merged
merged 14 commits into from Mar 18, 2022
Merged

Add initial events data and update script #6

merged 14 commits into from Mar 18, 2022

Conversation

lauravuo
Copy link
Contributor

Purpose

  • Refactored folder structure so that db scripts are in tools folder
  • Added data-folder that contains the service events as json. The events are rendered to app main view (as a first test).
  • Added script (fetch) for updating the events json from Firebase. The script is run daily via GitHub actions (can be triggered also from the actions UI). Logic for the data updates will be tuned more later.
  • The fetch-script also generates an index.js-file for easily include the events to React-components. Currently it includes all available events, but in production-phase the purpose is to include only the events in current month and onwards.

Related Issues

I will create later issues for the missing functionality such as unit tests for the db scripts and issues mentioned above.

How to test

DB events inclusion to React: Start app in localhost and see that events are listed with index and title to main view.
DB scripts: Open Actions tab and see that the nightly run for workflow fetch-data has succeeded.

@lauravuo lauravuo requested review from magdapoppins and eevajonnapanula and removed request for magdapoppins March 16, 2022 17:07
Copy link
Collaborator

@eevajonnapanula eevajonnapanula left a comment

Choose a reason for hiding this comment

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

Looking good! I left two nit pick comments, feel free to ignore them if you feel like it 😄

Everything seems to work fine from the React-side, but I can't see a passing workflow run in the Actions. However, I'm not sure if it's becase this is not in main? Should the nightly run happen when it's not in the main branch?

package.json Outdated
"typescript": "4.6.2"
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Maybe removing this newline is not necessary

git config --global user.email fetch-bot
git add .
git commit -a -m "Add updates from db."
git push origin main
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: There should be a newline

@lauravuo
Copy link
Contributor Author

You're @eevajonnapanula right! The scheduled action will be run only with the default branch. I add the push event temporarily now that we can check if the action passes.

@lauravuo
Copy link
Contributor Author

Ok, so when testing in the correct branch, the job succeeds.

Relevant parts are update data and commit changes steps: first script fetches the changed entries from db and commit step pushes the new data files to repository.

image

@lauravuo lauravuo merged commit 413e204 into main Mar 18, 2022
@lauravuo lauravuo deleted the add-read-script branch March 18, 2022 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants