Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

CI frontend #98

Closed
4 tasks
markus2330 opened this issue Mar 12, 2023 · 5 comments · Fixed by #171
Closed
4 tasks

CI frontend #98

markus2330 opened this issue Mar 12, 2023 · 5 comments · Fixed by #171
Assignees

Comments

@markus2330
Copy link
Contributor

markus2330 commented Mar 12, 2023

CI features not related to deployment, to be executed as separate build job on our Docker agents:

  • unit tests?
  • reformatting?
  • linter?
  • import database in PR tests (scraper)

(? refers that we don't know how to do it yet, not that we don't want it)

@markus2330 markus2330 changed the title CI tests CI Mar 12, 2023
This was referenced Mar 12, 2023
@markus2330 markus2330 changed the title CI CI frontend Mar 16, 2023
@markus2330
Copy link
Contributor Author

I moved some tasks to #63, here only the frontend tasks remain.

@badnames @aidnurs can you help out here a bit which commands are needed to do all tests, building of docu, reformatting, etc.?

@lukashartl All the jobs should be executed in parallel (backend+frontend).

@aidnurs
Copy link
Contributor

aidnurs commented Mar 16, 2023

Hey guys,

can you help out here a bit which commands are needed to do all tests, building of docu, reformatting, etc.?

I suppose npm run build executes the linter as well, right @buenaflor? I suggest to setup the linter so that it fails if the formatting doesn't correspond to our prettier configs in prettier.config.js instead of the pipeline formats every file automatically on the build itself, so the developer is aware of every change.

Additionally, we could add npm run test to package.json doing nothing for the time being(adapt it later once we have a test system), so we have the CD pipeline fixed and ready.

Except for these 2 things, we should be good. If something additional regarding the topic comes to my mind, I'll let you know for sure.

@markus2330
Copy link
Contributor Author

Have we already enabled all the eslint-plugin-react-hooks rules?

Is the code currently formatted via https://prettier.io?

@buenaflor
Copy link
Contributor

buenaflor commented Mar 21, 2023

Currently it uses a pre-commit hook to invoke the linting/formatting with ESLint and Prettier.

npx lint-staged should be the command if you take a look at package.json
So ideally we just use that during the CI build.

  "lint-staged": {
    "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
      "prettier --write"
    ],
    "src/**/*.{js,jsx,ts,tsx,json}": [
      "eslint --max-warnings=0"
    ]
  }

@Bushuo
Copy link
Contributor

Bushuo commented Mar 21, 2023

@buenaflor
I think we need two more scripts for that. If nothing is staged in the commit, npx lint-staged won't do anything

# paulb in ~/Projects/uni/bakk/PermaplanT/frontend on git:authors o [12:37:19] 
$ npx lint-staged
→ No staged files found.

Usually I have scripts like this in my projects

// package.json
...
"scripts": {
  "format": "prettier --write .",
   "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint ."
}
...

I did not try this yet. I can earliest in the evening today.

@Benjaminimal Benjaminimal linked a pull request Mar 26, 2023 that will close this issue
14 tasks
@Benjaminimal Benjaminimal moved this from Current Sprint to In Progress in PermaplanT Mar 26, 2023
@Benjaminimal Benjaminimal moved this from In Progress to In Review in PermaplanT Mar 26, 2023
@github-project-automation github-project-automation bot moved this from In Review to Done in PermaplanT Mar 29, 2023
lukashartl added a commit that referenced this issue Mar 31, 2023
lukashartl added a commit that referenced this issue Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants