Replace console.* with pino logger in backend services and enable no-console ESLint rule - #1322
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace console.* with pino logger in backend services and enable no-console ESLint rule
What was solved
#1252 — B-74: Log with pino instead of console in jobs
Replace console.log/console.warn calls in backend background jobs and services with the existing pino logger, ensuring structured logs include market id and tx hash fields, and enable the ESLint no-console rule so console.* is disallowed in src/.
Addressed:
#1253 — B-75: Integration tests for wallet auth challenge flow
Add an end-to-end integration test suite for the wallet auth challenge flow (challenge → sign → authenticated request) under backend/tests, using a Stellar Keypair.random() to sign challenges and covering expired challenge, reused challenge, and wrong signer failure cases, wired to run in CI.
Addressed:
#1254 — B-76: Integration tests for admin routes
Add HTTP-level Supertest integration tests for the admin routes (admin resolve, dispute-resolve, and oracle CRUD), covering unauthenticated 401, invalid body 400, and success cases, with contract calls mocked at the service boundary.
Addressed:
#1255 — B-77: Jest global setup with isolated test database
Add a Jest globalSetup for the backend that resets an isolated test database via
prisma migrate reset --forceagainstDATABASE_URL_TEST, and consolidate the scattered test files under a consistent folder convention with behaviour-describing names (removing issue-number-based names).Addressed:
globalSetuptobackend/jest.config.tsthat runsprisma migrate reset --forceagainstDATABASE_URL_TESTDATABASE_URL_TEST(isolated test DB) rather than the dev/prodDATABASE_URLbackend/__tests__/or co-located__tests__dirs) instead of the current mix of__tests__/,src/api/__tests__,src/services/__tests__, andtests/issues-907-...Changes
backend/src/logger.ts(modify)backend/src/services/indexer.service.ts(modify)backend/.eslintrc.json(modify)backend/__tests__/walletAuth.integration.test.ts(create)backend/__tests__/admin.api.test.ts(create)backend/jest.config.ts(modify)backend/package.json(modify)backend/.env.example(modify)Approach
Issues
Closes #1252
Closes #1253
Closes #1254
Closes #1255