Skip to content

dictybase-playground/dev-notes

Repository files navigation

Useful notes for Dicty web development

dicty specific

  • Documentation for frontend development - both web apps and standalone components
  • Deployment guide
  • gdrive-image-uploadr - has all of the standards to be used in React applications
  • Color scheme - (in order from dark to light):
    • #004080 (darkest, used in header and footer)
    • #0059b3 (halfway point between this and medium, which is kind of bright)
    • #0073e6 (medium)
    • #3399ff
    • #80c1ff
    • #cce6ff
    • #e6f2ff (lightest)

Creating new releases

  1. Make sure all tests are passing and write documentation as necessary
  2. Run npm run build to generate the library
  3. Merge changes into develop, then master
  4. Tag this release:
  • Run git tag -a v1.0.0 -m "version 1.0.0" where the version number is the one that needs to be updated
  • Push tag to branch, i.e. git push origin v1.0.0
  • To delete local tag, run git tag -d tagName
  • To delete remote tag, run git push --delete origin tagName
  1. If updating or creating helm chart, create a tarball with helm package PATH_TO_CHART
  2. Put this tarball in the docs folder in kubernetes-charts repo and then run helm repo index ./docs to update the index.yaml file.

Workflow:

  1. Push changes to develop
  2. Wait for Docker Hub to build it.
  3. Upgrade your chart

Quick workflow:

  1. Build it in your machine with any tag (i.e. docker build -t eric/user-exp:dev1 .)
  • Note: if Dockerfile is not in root path, use docker build -f build/Dockerfile -t eric/user-exp:dev1 .)
  1. Push it to the Minikube Docker daemon (activate with eval $(minikube docker-env))
  2. Upgrade your chart with that particular tag
  • helm upgrade [RELEASE NAME] [CHART] --namespace dictybase [ARGS] --set image.repository=eric/user-exp --set image.tag=dev1 --set image.pullPolicy=IfNotPresent

Dev/prod workflow:

  1. Push to develop -> new image -> pull and test in minikube
  2. Rebase develop in master, create new tag and push both master and tag
  3. New image -> Sidd deploys it to staging cloud

Remember update the staging dockerfile as necessary

Git

  • GitFlow - branching model for Git
  • Delete last commit: git reset --hard HEAD^
  • Delete last commit on remote branch: git push origin +branchName
  • Delete local branch: git branch -d branchName
  • Delete remote branch: git push origin --delete branchName
  • Rebase while in develop: git rebase branchName
  • Exclude folder from search: git grep XYZ ':!docs'

Golang

Testing

Questions to ask for test "contracts":

  1. What does it render?
  2. What props does it receive?
  3. What state does it hold?
  4. What does the component do when the user interacts with it?
  5. What is the context the component is rendered in?
  6. What side effects occur as part of the component lifecycle (i.e. componentDidMount)
  7. Does my component render different things under different circumstances?
  8. When I pass a function as a prop, what does my component use it for? Does it call it, or just give it to another component? If it calls it, what does it call it with?

React concepts

Node.js

Markdown

Resources

DevOps

GitHub Actions

Debugging GH Actions

    steps:
      - name: Dump GitHub context
        env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
        run: echo "$GITHUB_CONTEXT"
      - name: Dump job context
        env:
          JOB_CONTEXT: ${{ toJson(job) }}
        run: echo "$JOB_CONTEXT"
      - name: Dump steps context
        env:
          STEPS_CONTEXT: ${{ toJson(steps) }}
        run: echo "$STEPS_CONTEXT"
      - name: Dump runner context
        env:
          RUNNER_CONTEXT: ${{ toJson(runner) }}
        run: echo "$RUNNER_CONTEXT"
      - name: Dump strategy context
        env:
          STRATEGY_CONTEXT: ${{ toJson(strategy) }}
        run: echo "$STRATEGY_CONTEXT"
      - name: Dump matrix context
        env:
          MATRIX_CONTEXT: ${{ toJson(matrix) }}
        run: echo "$MATRIX_CONTEXT"

About

Useful notes for Dicty web development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published