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

chore: reconfigured trigger conditions for precommit action #128

Merged
merged 39 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7992220
chore: reconfigured trigger conditions for precommit action
BallardRobinett Feb 2, 2024
90fa9f6
chore: added this branch to push list
BallardRobinett Feb 2, 2024
3fda2f5
chore: modified PR condition and updated action
BallardRobinett Feb 2, 2024
2e9e626
chore: added dev-env-setup action
BallardRobinett Feb 2, 2024
1c40c85
chore: comment out backend setup code
BallardRobinett Feb 2, 2024
ab5ab96
chore: add requirements.txt
BallardRobinett Feb 2, 2024
79803b9
add config file
BallardRobinett Feb 2, 2024
9c8eb02
chore: added precommit config files
BallardRobinett Feb 2, 2024
b40f463
chore: modified config files
BallardRobinett Feb 2, 2024
f28076d
chore: update tsconfig
BallardRobinett Feb 3, 2024
1f9d7bf
chore: add config file and uncomment backend config
BallardRobinett Feb 5, 2024
9af1253
chore: add bc_ops makefile
BallardRobinett Feb 5, 2024
ad8912e
chore: add bc_ops tool versions file
BallardRobinett Feb 5, 2024
4978658
chore: update Makefile
BallardRobinett Feb 5, 2024
f4976e2
chore: adding test pre-commit workflow
BallardRobinett Feb 6, 2024
e20d39e
chore: switched to different precommit worklow template
BallardRobinett Feb 6, 2024
80d851e
chore: added eslint to yarn, modified pre commit config
BallardRobinett Feb 6, 2024
09398f3
chore: update python version
BallardRobinett Feb 6, 2024
91e54d2
chore: changes from running prettier on all files
BallardRobinett Feb 6, 2024
e50d184
chore: trying to find why error is happening
BallardRobinett Feb 6, 2024
8a0526c
chore: init eslint
BallardRobinett Feb 6, 2024
1cd7cb5
chore: trying some changes to config files
BallardRobinett Feb 6, 2024
0eaaff9
make yarn install happen in workflow
BallardRobinett Feb 6, 2024
b041a13
chore: adding eslint manually
BallardRobinett Feb 6, 2024
720b03d
chore: modify pre commit config
BallardRobinett Feb 6, 2024
793b67d
chore: try installing eslint from config
BallardRobinett Feb 6, 2024
a7e3401
chore: add eslint workflow
BallardRobinett Feb 7, 2024
50f57e4
chore: remove eslint from precommit workflow
BallardRobinett Feb 7, 2024
767568f
chore: adding prettier changes
BallardRobinett Feb 7, 2024
c0c9f6a
chore: update package versions
BallardRobinett Feb 8, 2024
2ccb1a6
chore: change bc_obps to server dir
BallardRobinett Feb 8, 2024
703301c
chore: update packages eslint
BallardRobinett Feb 8, 2024
c1ddb32
chore: remove unnecessary packages
BallardRobinett Feb 8, 2024
ca91aeb
chore: remove workflow condition specific to this branch
BallardRobinett Feb 8, 2024
7d0b73b
chore: removed unused packages
BallardRobinett Feb 8, 2024
2093bc8
chore: reinstall yarn packages and commit yarn lock
BallardRobinett Feb 8, 2024
1b081b8
chore: readd eslint to package.json
BallardRobinett Feb 8, 2024
73f8bfc
chore: modify eslint to run on client dir
BallardRobinett Feb 9, 2024
dc22a87
chore: delete bc_obps dir (replaced by server dir)
BallardRobinett Feb 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .bin/pre-commit-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -euxo pipefail

pushd client || exit 1
files=("$@")
files=("${files[@]/#/../}") # add ../ to each element

# --ignore-unknown prevents prettier from complaining about file types it doesn't know about
yarn run prettier --ignore-unknown --write "${files[@]}"
9 changes: 9 additions & 0 deletions .bin/pre-commit-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -euxo pipefail

pushd client || exit 1
files=("$@")
files=("${files[@]/#/../}") # add ../ to each element

yarn run eslint -c ./.eslintrc.js "${files[@]}"
25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: "plugin:react/recommended",
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "react"],
rules: {},
};
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/bug-template.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
name: Bug Template
about: For documenting bugs as per our bug process
title: ''
title: ""
labels: bug
assignees: ''

assignees: ""
---

#### Describe the Bug:

#### Probability:

(How likely the bug is to happen, scored from 1-5. For example, probability of 5 is something like "it happens to all users every time they log in." whereas probability of 1 "only happens to certain users when a really specific and unlikely path is followed.")

#### Impact:
#### Impact:

(How bad the bug is when it does happen, scored from 1-5. For example, effect of 5 is "the entire app crashes and makes it unusable for all users" or "the bug causes the wrong data to be saved, with critical information (e.g. payment) being affected." whereas effect of 1 is "It makes some styling look a little bit weird.")

<img src="https://www.getzephyr.com/sites/default/files/riksk%20matrix.jpg" alt="Bug Matrix" width="250" height="250"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
---
name: Discovery and Service Design Task Template
about: Discovery and Service Design Task Template
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

#### Goal of Ticket


#### Describe the task

A clear and concise description of what the task is.
Expand All @@ -25,7 +23,9 @@ A clear and concise description of what the task is.
Add any other context about the task here.

#### Definition of Ready:
Note: If any of the points are not applicable: delete or mark N/A

Note: If any of the points are not applicable: delete or mark N/A

- [ ] Topic is clearly Defined.
- [ ] Task Description is Clear.
- [ ] People to speak to are identified (if applicable).
Expand All @@ -37,6 +37,7 @@ Add any other context about the task here.
- [ ] Ticket Estimated.

#### Definition of Done.

Note: If any of the points are not applicable: delete or mark N/A

- [ ] Rough User Stories Proposed.
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/task-issue-template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: Task Issue Template
about: For cards that are not user stories, but may be technical, UX-related, or other
about:
For cards that are not user stories, but may be technical, UX-related, or other
tasks.
title: ''
title: ""
labels: Task
assignees: ''

assignees: ""
---

#### Describe the task
Expand Down
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/tech-debt-template.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
name: Tech Debt Template
about: Tech Debt Template
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

### Description of the Tech Debt

#### Tech Debt Triage

The purpose of our technical debt triage process is to analyze technical debt to determine risk level of the technical debt and the value in tackling that technical debt.

#### Risk Value Scoring:

| Level | Value |
| ------ | ----- |
| High | <div align="center">3 |
| Medium | <div align="center">2 |
| Low | <div align="center">1 |
| Level | Value |
| ------ | --------------------- |
| High | <div align="center">3 |
| Medium | <div align="center">2 |
| Low | <div align="center">1 |

| Technical Debt - Risk Types | Level | Value |
| ----------------------------------------------------------------------------------------------------------------------------- | ----- | ----- |
Expand All @@ -27,4 +27,4 @@ The purpose of our technical debt triage process is to analyze technical debt to
| System Fault Risk - Risk of system errors or application downtime | | |
| Time Scale Risk - Compound risk effect if left alone. How much more difficult to fix or dangerous will this become over time? | | |
| Time Sink Risk - How much will this tech debt slow the development process down | | |
| <div align="right">**TOTAL SCORE:** | | |
| <div align="right">**TOTAL SCORE:** | | |
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/user-story-template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: User Story Template
about: User stories are broken down product backlog items that are user-focused and
about:
User stories are broken down product backlog items that are user-focused and
vertically-sliced.
title: ''
title: ""
labels: User Story
assignees: ''

assignees: ""
---

#### Description:
Expand Down
56 changes: 56 additions & 0 deletions .github/actions/dev-env-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Set up registration dev environment"
description: "Sets up asdf and configures the cache"
runs:
using: composite
steps:
- name: asdf setup
uses: asdf-vm/actions/setup@v3
- uses: actions/cache@v4
id: asdf-cache-client
with:
path: |
~/.asdf
./client/.tool-versions
key: ${{ runner.os }}-asdf-cache-client-${{ hashFiles('client/.tool-versions') }}
- uses: actions/cache@v3
id: asdf-cache-backend
with:
path: |
~/.asdf
./server/.tool-versions
key: ${{ runner.os }}-asdf-cache-backend-${{ hashFiles('server/.tool-versions') }}
- uses: actions/cache@v3
id: yarn-cache
with:
path: |
~/.cache/yarn
./client/node_modules
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('client/yarn.lock') }}-v2
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
working-directory: ./server
shell: bash
- name: Install server dev tools
working-directory: ./server
shell: bash
run: |
make install_backend_asdf_tools
make start_pg
make create_db
29 changes: 29 additions & 0 deletions .github/workflows/eslint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ESLint

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
cd client
yarn install

- name: Run ESLint
run: |
cd client
yarn run eslint
29 changes: 4 additions & 25 deletions .github/workflows/precommit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,14 @@ name: Precommit tests

on:
push:
branches:
- '*'
branches: [main, develop]
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

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

you'll want PR only on main and develop too (at least that's how it's setup everywhere else)

branches:
- '*'
branches: [main, develop]

jobs:
pre-commit:
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to remove the dependency on install_dev_tools or import that job too if it's necessary

needs: install-dev-tools
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: dev env setup
uses: ./.github/actions/dev-env-setup
- name: set pre-commit cache directory
run: |
echo "PRE_COMMIT_HOME=$GITHUB_WORKSPACE/.pre-commit-cache" >> $GITHUB_ENV
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: create commitlint COMMIT_EDITMSG if not exists
run: |
if test -f ".git/COMMIT_EDITMSG"; then
echo "COMMIT_EDITMSG EXISTS, skipping"
else
touch .git/COMMIT_EDITMSG
fi
- uses: actions/cache@v3
with:
path: |
./.pre-commit-cache
key: pre-commit-${{ env.PY }}-${{ hashFiles('.pre-commit-config.yaml') }}-v3
- run: pre-commit run --all-files
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.0
Loading
Loading