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 dynamic metrics #286

Merged
merged 24 commits into from May 9, 2023
Merged

Add dynamic metrics #286

merged 24 commits into from May 9, 2023

Conversation

jburns24
Copy link
Collaborator

@jburns24 jburns24 commented May 5, 2023

This PR introduces quite a bit of change all with the goal of creating a central location for bootcamp metadata and laying the foundation for generating visualizations off the metadata so we can answer business questions. I will highlight the major.

  1. Introduces a pre-commit hook for centralizing bootcamp metadata

I made a choice that metadata should live with the bootcamp section. This feels like the location that will be least likely to be forgotten and thus has the best chance of staying accurate. In order to simplify the client side logic of aggregating the metadata and avoid maintaining things like a list of subsections where meta data lives. I opted for a pre-commit hook that looks at any staged .md files and checks them for metadata. This metadata is then aggregated into a master record on the root .md file README.md. This master record is to be maintained by the pre-commit hook. For this pr there are many features missing and the hook really only handles adding or changing metadata. It does not handle things like deleting sections or renaming sections. I would like to address these cases in a follow up pr.

  1. Introduces Webpack as a module bundler

Prior to this pr we relied on importing browser bundles in index.js. Early on in development I kept finding myself wanting to use npm packages on the client side. Specifically for packages that did not publish a browser bundle. We could have minified and published a bundle on CDN or we could have introduced a bundler like webpack. I picked the latter as we can now leverage any npm package on the front end. We also get the benifit of babble on our production js which will increase the browser support and minification which will help with asset size. This does introduce a new build dependency though

  1. Modifies the deploy process

The bootcamp used to rely on some blackbox deploy magic from github. Now it uses a GitHub Action primarily so we can support the new build dependency. But also this will give us more control over how the bootcamp is deployed.

  1. Adds a dynamic graph

This is what it was all about. With metadata in place and a bundler to leverage npm packages we can now generate graphs and other visualizations off our metadata.

Here is what the new graph looks like on the home page

image

Warning

The GHA changes have not been tested!

testing js front

Add precommit hook to create master record
…ould live somehwere else) and started building out the front-matter sections
…ed via browswer bundles to webpack. Creates a coupld 'profiles' for webpack buils one for development that will still allow source mapping and another for production
…e to webpack. Added ./dist/ to gitignore. Add wordcloud plugin for chartjs
package-lock.json Outdated Show resolved Hide resolved
…that is supported (via their docs). Cleaned up dead code. Added newlines
Comment on lines +36 to +47

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Run webpack build
run: npx webpack --config webpack.prod.js

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has not been tested. At least according to the readme for v3 of the setup-node they mention version 18 as a major version they support so we should be good there. I tested on node version 19 but dont think I am doing anything that broke between those major versions.

…ixed bug where canvas' id was changed but js was not updated.
…ng categories each loop. And added rounding to the tooltip for the doughnut graph
Copy link
Contributor

@dreweth dreweth left a comment

Choose a reason for hiding this comment

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

What can I saw about a 1,000+ line PR other than, LGTM 🥇

@jburns24 jburns24 merged commit f937990 into master May 9, 2023
2 checks passed
@jburns24 jburns24 deleted the add-dynamic-metrics branch May 9, 2023 20:35
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.

Create dynamic charts in the bootcamp to show where time in the bootcamp is spent
2 participants