chore: setup project linting, formatting, and CI workflows with impro…#21
Conversation
…ved test reporting
|
Thanks for the explanation @Johnsource-hub . I understand why application code changes were included, since introducing CI often exposes existing compilation errors, failing tests, missing dependencies, and other issues that need to be addressed before the pipeline can pass. My main concern is that the artifacts attached to the PR still appear to show failures:
Can you clarify whether those files were generated before or after your fixes? Also, could you provide evidence that the current branch successfully passes: npm run lint
npm run format
npx prisma validate
npx tsc --noEmit
npm testor share a successful GitHub Actions run/screenshot from this branch? If those artifacts are outdated and the current branch passes all checks, that would address my concern regarding the CI acceptance criteria. |
|
@Johnsource-hub any update? |
|
working on it |
…tent code formatting across the codebase
|
done |
|
@Johnsource-hub please help fix conflict also you are yet to share a screenshot that the CI passed |
|
@Johnsource-hub what is the update |
#closes
#20
I have successfully set up the CI/CD pipeline using GitHub Actions to automatically trigger on pull requests and pushes to the main branch.
Here is what was accomplished:
CI Pipeline Creation: Created .github/workflows/ci.yml incorporating steps to checkout the code, setup Node.js v20, install dependencies, run Prisma generation and validation, linting/formatting checks, type checking (npx tsc --noEmit), and Jest unit tests.
Dependency Configuration: Updated package.json with appropriate "lint" and "format" scripts. Added the necessary ESLint and Prettier devDependencies (eslint, prettier, @typescript-eslint/parser, @typescript-eslint/eslint-plugin). Also installed i18next that was missing.
ESLint & Prettier Configurations: Created basic configurations (.eslintrc.json and .prettierrc) so the pipeline runs efficiently and checks the code structure reliably.
Fixing Existing Codebase Issues: While testing the CI pipeline locally, I found several existing compilation errors and broken unit tests in the codebase which would have blocked the CI workflow:
Fixed missing braces in tests/stellar.service.test.ts.
Fixed malformed merge conflict code inside src/services/user.service.ts affecting Stellar wallet generation.
Refactored src/services/stellar.service.ts to actually encrypt Stellar wallet secrets (which its unit tests expected) and fixed the GeneratedWallet type.
Fixed missing t translation variables and shadowing block-scoped user variables in src/services/message-processor.service.ts.
Removed duplicate Prisma client instantiations from src/services/group.service.ts that conflicted with each other.
Adjusted message-processor.service.test.ts and user.service.test.ts to mock and expect the correct language formats and translation strings.