Add baseline CI/CD: typecheck, lint, and Docker image publish - #1
Merged
Conversation
- CI workflow runs TypeScript typecheck (tsc --noEmit) and ruff lint on nlp-service for every push/PR to main. - Docker publish workflow builds and pushes server + nlp-service images to GHCR on push to main. - Add Dockerfiles for both services (verified building locally). - Fix pre-existing unused-import lint violations in nlp-service surfaced by adding ruff. Co-Authored-By: Paperclip <noreply@paperclip.ing>
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
Addresses the CI/CD audit finding (0 GitHub Actions workflows, no test config) tracked internally as WID-196, part of the WID-122 repo audit.
.github/workflows/ci.yml— runs on every push/PR tomain:tsc --noEmit, vianpm test)rufflint onnlp-service/.github/workflows/docker-publish.yml— on push tomain, builds and pushesserverandnlp-serviceDocker images to GHCR (ghcr.io/wider-community/resolve-ai/...). No new secrets required — uses the built-inGITHUB_TOKEN.Dockerfile(root, Node/Express viatsx) andnlp-service/Dockerfile(Python/FastAPI) — both verified building successfully locally.nlp-service/(main.py,test_service.py) surfaced by addingruff— mechanical, no behavior change — so CI is green from the first run.Scope notes / known gaps
server.tsis not covered by the TypeScript typecheck.tsconfig.jsononly includessrc/**/*, andserver.ts(the app entrypoint) has 2 pre-existing type errors (AgentContextmissingsentiment/sentimentScore/etc. fields) that are outside the scope of a CI/CD baseline change. Filed as a follow-up.nlp-service/test_service.pyis a manual smoke script (loads a spaCy model, calls Gemini) rather than an assertion-based test, so it isn't wired into CI. Typecheck + lint are the "test" baseline for now.maincould not be configured via the API — the org is on the GitHub Free plan, which does not support branch protection rules (or rulesets) on private repos (403: Upgrade to GitHub Pro or make this repository public). This needs a plan upgrade or a visibility change, decided by org ownership.permissions: packages: writeat the job level, which should work even though the repo's default workflow token permission isread-only. If the push step fails with a permissions error, enable "Read and write permissions" under Settings → Actions → General → Workflow permissions.Test plan
npm ci && npx tsc --noEmitpasses cleanly onsrc/**ruff check nlp-servicepasses cleanly after the import fixesdocker build -t resolve-ai-server:test .succeeds locallydocker build -t resolve-ai-nlp:test nlp-servicesucceeds locally