fix/refactor: Resolve ESLint errors, fix Ballerina PII bug, and overhaul CI pipeline#60
Merged
HasithaErandika merged 6 commits intomainfrom Apr 22, 2026
Merged
fix/refactor: Resolve ESLint errors, fix Ballerina PII bug, and overhaul CI pipeline#60HasithaErandika merged 6 commits intomainfrom
HasithaErandika merged 6 commits intomainfrom
Conversation
…alog and add project audit tracking file
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…tor violation summary string formatting.
…steps, configuration guides, and architectural details
…s while optimizing initial component state management.
…ne to run unit tests only
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
This PR wraps a session of quality and reliability work across the full stack:
no-explicit-any,react-hooks/set-state-in-effect) and the downstream TypeScript type errors they caused inuseCandidates.maskPii/unmaskPiithat caused 3 Ballerina unit tests to fail silently, and corrects a stale test assertion ("JSON profile"→"JSON object").bal testnever hangs or fails due to a missing live server in CI.No new APIs or data-model changes are introduced. This is a pure quality/reliability uplift.
Type of change
Checklist
Fixes #123).What changed
ed07433— fix: close marking criteria edit modal before confirmation dialogreact-frontend/src/…/MarkingCriteria.tsx— modal close/confirm sequencing fixed.a8af390— feat: update and improve Docker configurationballerina-gateway/Dockerfile— multi-stage build cleanup and layer optimisation.ballerina-gateway/docker-compose.yml— service definitions updated.docker-compose.yml— full-stack compose updated to match.cd7aaf0— test: add AI grading unit tests, fix security test port, refactor violation summaryballerina-gateway/tests/ai_grading_test.bal— full suite of pure-unit tests coveringparseScore,buildGradingPrompt,buildCvParsePrompt, score constants, and audit-action constants (all taggedgroups: ["ai-grading", "unit"]).ballerina-gateway/tests/hf_gate_test.bal— gate threshold/label tests and PII redaction contract tests.ballerina-gateway/tests/security_test.bal— corrected listener port from stale value to9092.ballerina-gateway/modules/services/grading_service.bal— trailing-comma bug insummarizeViolationsfixed.ac56bfc— docs: overhaul project documentationREADME.md— updated architecture overview, installation steps, and environment variable reference.doc/README.md— updated to match current module structure.doc/api-endpoints.md— corrected endpoint list to match live API.doc/getting-started.md— step-by-step guide rewritten for the current stack.207dd93— refactor: improve frontend type safety and component state managementsrc/types/api.ts— replaced 6×anyonTranscriptResponseoptional fields withstring | Array<Record<string, string>>unions.src/hooks/useCandidates.ts— handler return types narrowed fromPromise<unknown>toPromise<{ emailSent?: boolean }>.src/components/dashboard/TranscriptModal.tsx— removed synchronoussetStatefrom effect body; replaced 6×anyin.map()callbacks withRecord<string, string> | string.src/pages/dashboard/views/CandidateTranscript.tsx— samesetState-in-effect fix; dropped unusedsetErrorsetter.src/pages/dashboard/views/Candidates.tsx—let result: anynarrowed to{ emailSent?: boolean } | undefined.3782cf0— refactor: categorise Ballerina tests with groups and update CI pipelinemodules/utils/redaction_util.bal—maskPiiandunmaskPiihad their map-traversal logic completely inverted relative to thepiiMapconvention (key = placeholder, value = original PII).maskPiinow correctly replaces original PII (value) with the placeholder token (key);unmaskPiirestores the original PII from the placeholder.tests/utils_test.bal— stale assertion"JSON profile"→"JSON object"(phrase never existed in the prompt); all 4 tests taggedgroups: ["unit"].tests/services_test.bal— all 6 tests taggedgroups: ["unit"].tests/connection_test.bal— all 7 tests taggedgroups: ["integration"](live external APIs).tests/security_test.bal— all 3 tests taggedgroups: ["integration"](requires running gateway onlocalhost:9092).tests/api_test.bal— both tests taggedgroups: ["integration"](requires running gateway)..github/workflows/ci.yml:npx tsc --noEmittype-check step; addedVITE_API_BASE_URLenv var so the Vite production build succeeds in CI.bal test→bal test --groups unitso integration tests never block the CI gate.--groups unitconvention andactions/upload-artifactpath semantics.How to verify / QA steps
Frontend
Backend (unit tests only — no credentials or live services needed)
Backend (integration tests — requires real credentials + running services)
Docker
docker-compose up --build # full-stack compose at repo rootScreenshots / Recordings
No UI changes in this PR.
Rollout / Migration plan
No schema changes. No data migrations. Safe to deploy directly on top of any existing instance.
Backwards compatibility & Breaking changes
All changes are internal (type annotations, test grouping, CI steps, bug fixes in utility functions). The
maskPii/unmaskPiilogic fix corrects the function bodies to match their documented contracts — no callers in production code were using the incorrect behaviour.Security considerations
redaction_util.balbug fix ensures PII is correctly masked before being sent to the HuggingFace gate and correctly revealed only on recruiter-authorised reveal calls. The previous inversion was a correctness defect, not an active security vulnerability (the functions were not yet wired into the live grading pipeline for PII flow), but the fix tightens the privacy guarantee.Config.toml.examplecontains only placeholder strings. Real credentials remain intests/Config.toml(existing practice — not changed by this PR).Release notes (one-liner)
Related PRs / References
Suggested reviewers