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

Conversation

BallardRobinett
Copy link
Contributor

Issue: #127

Reconfigured the trigger conditions for precommit. It should be on push for main and develop, and on PR to any branch.

To test: create a PR and see if precommit runs.

@@ -2,11 +2,8 @@ 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)

pull_request:
branches:
- '*'

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

@BallardRobinett BallardRobinett force-pushed the 127-fix-precommit-conditions branch from eddddb7 to 767568f Compare February 7, 2024 18:09
Copy link
Contributor

@pbastia pbastia left a comment

Choose a reason for hiding this comment

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

Nice work! A bunch of small version changes, mostly

using: composite
steps:
- name: asdf setup
uses: asdf-vm/actions/setup@v1
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
uses: asdf-vm/actions/setup@v1
uses: asdf-vm/actions/setup@v3

steps:
- name: asdf setup
uses: asdf-vm/actions/setup@v1
- uses: actions/cache@v3
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- uses: actions/cache@v3
- uses: actions/cache@v4

with:
path: |
~/.asdf
./bc_obps/.tool-versions
Copy link
Contributor

Choose a reason for hiding this comment

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

Once you rebase:

Suggested change
./bc_obps/.tool-versions
./server/.tool-versions

key: ${{ runner.os }}-yarn-cache-${{ hashFiles('client/yarn.lock') }}-v2
- name: Set up python
id: setup-python
uses: actions/setup-python@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
uses: actions/setup-python@v4
uses: actions/setup-python@v5

id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.9.16"
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably enough to specify the minor to make sure we get the updates without work on our end

Suggested change
python-version: "3.9.16"
python-version: "3.9"

with:
node-version: 20
- name: Install dependencies
run: yarn install
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there's a lot of value in running eslint over the entire repository, we might be better off scoping this to the client directory (and this way we avoid installing packages at the root of the project)

@@ -2,35 +2,14 @@ name: Precommit tests

on:
push:
branches:
- '*'
branches: [main, develop, 127-fix-precommit-conditions]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
branches: [main, develop, 127-fix-precommit-conditions]
branches: [main, develop]

./.pre-commit-cache
key: pre-commit-${{ env.PY }}-${{ hashFiles('.pre-commit-config.yaml') }}-v3
- run: pre-commit run --all-files
- uses: actions/setup-python@v3
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- uses: actions/setup-python@v3
- uses: actions/setup-python@v5

This also needs a version for python

package.json Outdated
Comment on lines 10 to 11
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

These would likely be better housed in the package.json in the client folder

package.json Outdated
Comment on lines 32 to 36
"dependencies": {
"eslint": "^8.56.0",
"pre-commit": "^1.2.2",
"typescript": "^5.3.3"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There aren't any dependencies that need to be shipped in this package either, I don't think these are needed here

@BallardRobinett BallardRobinett force-pushed the 127-fix-precommit-conditions branch 2 times, most recently from 54898f8 to 767568f Compare February 8, 2024 18:36
Copy link
Contributor

@pbastia pbastia left a comment

Choose a reason for hiding this comment

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

Looks good! The eslint workflow could probably use some caching, but let's put that in a tech debt card. Nice work!

@pbastia pbastia merged commit 989ebd9 into develop Feb 12, 2024
8 checks passed
@pbastia pbastia deleted the 127-fix-precommit-conditions branch February 12, 2024 23:01
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.

2 participants