Skip to main content

Development Workflow

How the team works — branching, PRs, code review, debugging, and fixing common issues.


Git Branching Strategy

Branch TypeNamingPurposeExample
mainmain / masterProduction-ready code. Auto-deploys.
featurefeature/short-descriptionNew functionalityfeature/pipeline-filters
fixfix/issue-descriptionBug fixesfix/save-crash-on-empty-config
refactorrefactor/areaCode cleanup, no behavior changerefactor/operator-config-panel

Rules

  • Always branch from main
  • Keep branches short-lived (1-3 days)
  • One feature/fix per branch
  • Delete branch after merge

Commit Messages

Use clear, descriptive commit messages:

feat: add filter sidebar to pipeline list page

fix: prevent crash when saving operator with empty config

refactor: extract FormRenderer field types into separate files

docs: add testing guide to build section
PrefixWhen to Use
feat:New feature or capability
fix:Bug fix
refactor:Code restructuring, no behavior change
style:Formatting, whitespace, missing semicolons
docs:Documentation only
test:Adding or updating tests
chore:Build config, dependencies, tooling

Pull Request Process

Creating a PR

  1. Push your branch: git push -u origin feature/my-feature
  2. Open a PR against main
  3. Fill in the PR template:
## What
Brief description of the change.

## Why
What problem does this solve or what feature does it add?

## How to Test
Steps to verify the change works:
1. Navigate to ...
2. Click ...
3. Verify ...

## Screenshots
(if UI changes)

PR Checklist (Before Requesting Review)

  • pnpm lint passes with no new errors
  • pnpm build succeeds (TypeScript check + production build)
  • Tested manually in the browser
  • No console.log left in code (use console.error sparingly for real errors)
  • No hardcoded URLs, tokens, or credentials
  • New files follow naming conventions (PascalCase components, camelCase hooks, kebab-case folders)
  • React Query mutations invalidate related queries on success
  • Error states handled (API failures show toast or inline error)

Code Review Guidelines

What Reviewers Look For

AreaCheck
CorrectnessDoes it work? Edge cases handled?
API integrationCorrect endpoint? Response parsed properly? Errors handled?
State managementRight layer? (React Query for server, Zustand for UI, RHF for forms)
Component structureReusing @dtx/ui components? Not reinventing existing patterns?
TypesTypeScript types explicit at boundaries? No any?
Side effectsCleanup in useEffect? No memory leaks?
UXLoading states? Error messages? Disabled buttons during mutations?

Review Turnaround

Aim for same-day reviews. If blocked, ping the reviewer.


Debugging Tips

API Issues

Chrome DevTools → Network tab is your primary tool for API debugging.

SymptomWhat to Check
Request not sentIs the mutation triggered? Check React Query DevTools.
401 UnauthorizedToken expired? Check Authorization header in Network tab. Keycloak refresh may have failed.
403 ForbiddenUser doesn't have the required role. Check Keycloak realm roles.
404 Not FoundWrong endpoint path? Check the service file and Vite proxy config.
422 ValidationExpand response body in Network tab — errors[] shows which fields failed.
CORS ErrorRequest going to wrong port? Check Vite proxy in vite.config.ts.
Empty responseBackend might return 204 No Content — check if parseApiResponse handles it.

State Issues

React DevTools (browser extension):

  1. Install React DevTools
  2. Open DevTools → Components tab
  3. Click any component to inspect its props, state, and hooks
  4. Use the search bar to find components by name

React Query DevTools (built-in):

  1. Look for the React Query floating icon in dev mode
  2. Click to see all active queries, their status, and cached data
  3. Useful for: stale data, failed queries, cache invalidation issues

Zustand DevTools:

  • usePipelineStore state: Check IndexedDB in DevTools → Application → IndexedDB
  • useWorkflowDesignerStore state: Check localStorage in DevTools → Application → Local Storage
  • useAccessManagementStore state: Check sessionStorage in DevTools → Application → Session Storage

Styling Issues

ProblemSolution
Class not applyingCheck for Tailwind typo. Use Tailwind IntelliSense extension.
Dark mode brokenVerify .dark-mode class on root element. Check dark variant exists.
Layout shiftCheck for missing min-h, min-w, or flex-shrink-0.
Z-index conflictModals use high z-index. Check z-* Tailwind utilities.

Troubleshooting Common Issues

Keycloak Login Failures

SymptomCauseFix
Login page doesn't loadKeycloak server not runningStart Keycloak or point .env.local to DEV environment
"Invalid redirect URI"Keycloak client misconfiguredAdd http://localhost:3000/* to valid redirect URIs in Keycloak admin
Token refresh failsRealm or client ID mismatchVerify VITE_KEYCLOAK_REALM and VITE_KEYCLOAK_CLIENT_ID in .env.local
Infinite login loopCookie conflictClear cookies for localhost, try incognito

Vite Dev Server

SymptomCauseFix
Port 3000 already in useAnother process on the portKill the process: lsof -i :3000 then kill <PID>
HMR not workingFile watcher limitLinux: increase fs.inotify.max_user_watches
Slow startupLarge node_modulesRun pnpm store prune to clean pnpm cache
Proxy errors (502)Backend service not runningStart the backend service or update .env.local to point to DEV

pnpm Install

SymptomCauseFix
"ERR_PNPM_PEER_DEP"Peer dependency conflictCheck pnpm-workspace.yaml catalog for version mismatches
"command not found: pnpm"pnpm not installednpm install -g pnpm@10
Lockfile conflictDifferent pnpm versionsUse the version in packageManager field of package.json
"EACCES permission denied"File permission issueDon't use sudo. Fix ownership: chown -R $USER node_modules

TypeScript Errors

SymptomCauseFix
22 errors in @dtx/ui SelectKnown issue — self-referencing imports in Select componentsTracked in Technical Debt. Does not block dev server, only blocks pnpm build.
"Cannot find module @/"Path alias not resolvedRestart VS Code TypeScript server: Cmd+Shift+P → "TypeScript: Restart TS Server"
"Property does not exist"Backend added a new fieldUpdate the type definition in types/{service}.types.ts

Build Failures

SymptomCauseFix
Type check failsTypeScript strict modeFix the type error — don't use // @ts-ignore
Out of memoryLarge buildIncrease Node memory: NODE_OPTIONS=--max-old-space-size=4096 pnpm build
Missing dependencyNot in pnpm-workspace.yaml catalogAdd to catalog and run pnpm install

Development Environment Tips

Pointing to DEV Backend

If you don't have backend services running locally, update .env.local to proxy through the DEV environment:

VITE_API_BASE_URL=http://100.91.186.89:30000/api

The Vite dev proxy will forward requests to the remote backend.

Useful Browser Extensions

ExtensionPurpose
React DevToolsComponent tree, state, props inspection
Redux DevToolsWorks with Zustand via middleware (optional)
JSON ViewerFormat JSON API responses in browser
Keycloak DevToolsInspect tokens, roles, sessions