-
Notifications
You must be signed in to change notification settings - Fork 33
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
New Team Member Onboarding Kit #936
Comments
@sheaphillips I am compiling an onboarding list for Billy because I will be away on his first day. Is there anything here that I am missing? |
Here's a react tutorial I did during the first couple days to help get a feel for the basics, https://reactjs.org/tutorial/tutorial.html , its a learn by doing approach but also links out to a step by step guide for learning the concepts from the ground up |
Github Flow
GitHub flow is a lightweight, branch-based workflow that supports teams and projects where deployments are made regularly. When developing in GitHub flow, branches are created off of master. These branches could contain new features, bug fixes, content curation etc, and the branch names should reflect what type of work is being done and the purpose of that branch. When working on your branch, commit early and often, with clear and concise commit messages as this will allow others on your team to understand your work more effectively and allow for better de-bugging if an issue arrises. Also try to make sure your code follows best practices and is well documented. At some point during the development process, you will need to open a pull request for your branch. This can be either when you are almost done your work on the branch, stuck on an issue and need some advice, or really any time during the development process. This allows team members to easily see what you’re working on, give feedback and review your pull request to put it into production. After it has been approved, you can then promote it through the various stages of the DevHubs Jenkins pipeline, with the final one putting the changes into production. After that has been done and the app is running smoothly, go back to your PR and merge it there, deleting the branch after. What if Another Team Member Merges New Code While you’re still working? To handle this issue, the “rebase” command is used. Rebase, similar to “merge” also integrates changes from a branch to another, but unlike merge it rewrites the commit history in order to produce a straight, linear succession of commits. When visualized, it looks something like this A rebase looks like this (https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) To implement a successful rebase, first you would make sure your master branch is up to date, then on your feature branch do the following command ‘git rebase master’, this would rebase the current production code with your changes. You will then have to make sure there are no conflicts, after that a final step of force pushing as you have previously done to create your pull request is required. (More detailed info on how to use here https://git-scm.com/docs/git-rebase) |
Devhub OverviewAs described in the readme, the Devhub is front end application that pulls data from a variety of sources: Github, Eventbrite, Local Filesystem, and converts them into objects that are then presen ted as either standalone HTML pages, or a collection of HTML pages within a 'Topic' A few writeups on the devhub can be found here |
Project Structure Pit Falls and Journey MapYou will notice the directory structure could be cleaned up and this is something we are totally aware of. For a journey map what I am hoping to see is:
|
TestingUnit TestingUnit testing is done with Jest. Jest is pre-built into gatsby applications. EnzymeOriginally, our jest unit tests were interfacing with Enzyme, a react testing utility library but there were incompatibilities with Enzyme and React 16 features. We are no longer writing tests using enzyme. The plan is to deprecate its usage and remove the library altogether. @testing-library/reactWe are using testing library in place of Jest. This testing library has several benefits as described by the author of the repo. The tests now behave more like how a user would interact with a component which really helps to nail down what spec we are testing for.
E2E TestingWhat is it?End to end testing is a way of writing test cases that simulate user behaviour from start to finish. Tests are run against a running version of the front end in a controlled browser environment. Interactions are all done through the ui and then assertions are made. LibraryThe library we are using is called Cypress JS. This library is shiny but promising, the developer experience is incredible for writing functional tests. PitfallsWe have yet found a way to correctly integrate it into our pipeline. For some reason, the tests work fine when run locally but fail when run in platforms like Github Actions.
|
Tech StackThese are the following technologies and key libraries that the Devhub is using. Please note that there may be libraries that are being deprecated.
|
Styled ComponentsWhat are they?Styled Components is a way of creating React Components that have CSS styles embedded at them. More than that, they provide a way to create isolated, programmable, and composable styles. There are a couple of styled component libraries currently dominating NPM at the moment and they are What about CSS Modules?In the early days of Devhub, we were utilizing a styling technique called
Journey MapSince we are in the inbetween stages of CSS Modules and Styled Components. All future styles should utilize styled components. If you are working on a component that uses CSS Modules, please convert it to emotion.js End Goal
|
Project StructureThe root application structure looks somethinng like this.
app-webThis is where the Gatsby Project lives and where you will most likely be spending your time working in What else?The app-web directory is essentially and standard Gatsby Project. Gatsby Projects include some conventions from React projects. Journey MapYou will node this directory needs some love! It is a bit messy, and we are looking for a way to clean it up! .jenkinsThis is the bcdk jenkins configuration and pipeline (including all jobs for other projects without our openshift namespace) .pipelineThis is the bcdk pipeline for the devhub gatsby project docsMisc docs in regards to the project functional testsThis is the matomoThis is all the infra code required to support the matomo instance in our tools namespace openshiftThis is all the infra code required to support the devhub, the pipelineThis is the gradle runner for the BDD stack which, again, may be removed shortly since we are not using BDD stack |
How the Devhub WorksIntroductionThe Devhub has a couple of primary functions. These are:
This document will discuss in detail how data is sourced; how it is annotated in different ways with metadata to make meaningful connections between data points; how the data is indexed; and lastly, how external search sources are made available. How Data is SourcedWhen you goto the Devhub, you'll see something like this. Clicking on that card will render something like this. This is clearly some type of documentation. How does the Devhub render that, how does it get there? Data is primarily sourced by way of Gatsby Source Plugin. We leverage a combination of 3rd party ( Most of the content that is sourced for the Devhub is managed via a set of Registry Files found at Making a cardTo make the card, most data sources come with some metadata that was either explicitly written with the data (such as frontmatter in a markdown file), assigned in the devhub registry files, or implied by some conventions. The metadata that makes up a card is a Making the pageEssentially most content comes in as Markdown files, we use a transformer plugin called How Data is Annotated to make connectionsEach data point that represents a card can be thought of as an individual Node. All these Nodes come from unlike data structures. The Devhub, based on certain conventions, makes manual connections between these nodes to associate certain relationships. Nodes can be connected to other Special Nodes called Topics. This creates a parent-child relationship. This relationship is many to many. A child node can belong to many topic nodes. We utilize several Gatsby Node API's to accomplish making connections. They can all be found within the Making connections between unlike nodes is complex. We have tried to achieve this by providing a standard interface between sourced nodes within the How Data is IndexedWe are leveraging Elasticlunr as our front end search engine. There is a gatsby plugin that helps initialize and program the index for this plugin. This plus a custom React Hook, External Search SourcesWhen searching through the local index, additional functions can be called to leverage the |
CI/CD PipelineWe are currently leveraging two different pipelines to accomplish CI and CD. Continuous Integration is done with Github Actions. Although not continuous, our deployment to Openshift is accomplished with Jenkins. Github Actions and Journey MapGithub actions have been an excellent way for us to offload some heavy lifting to check unit and integration tests. In addition, the PR clearly displays whether tests passed or not which is a bonus. To modify the Github Action, you can navigate to the Currently we are blocked on running E2E tests with Github Actions. For some reason, we are getting some issues with utilizing the Cypress docker image. This appears to be a known issue and hopefully gets resolved shortly. Jenkins Pipeline and Road Map.Jenkins is responsible for building and deploying our images to each namespace in the Devhub Project Set. It also does extra things like provision a keycloak client during dev deploys. There are some things left to be desired with Jenkins which we will hope to work on:
|
https://www.gatsbyjs.org/tutorial/part-one/ |
Algolia Production AccountOur team account is registered under my email. If you require access to the production Algolia account please contact me :) |
This onboarding kit should be made in mind for junior dev personas.
Somethings to keep in mind
DevHub overview/readmes
Algolia Prod Account
describing project structure
describing project structure pit falls and journey map
tech stack and resources to learn more
unit-testing
e2e testing (and its pitfalls)
styled-components and its journey map
how devhub works
how the ci/cd pipeline works (high-level explanation on the usage of github actions and jenkins)
The text was updated successfully, but these errors were encountered: