Skip to content

chore(queues): extract shared defaultJobOptions presets#316

Merged
therealbrad merged 1 commit into
mainfrom
chore/queue-config-standardization
May 14, 2026
Merged

chore(queues): extract shared defaultJobOptions presets#316
therealbrad merged 1 commit into
mainfrom
chore/queue-config-standardization

Conversation

@therealbrad
Copy link
Copy Markdown
Contributor

Description

Refactor testplanit/lib/queues.ts to remove repeated defaultJobOptions boilerplate by extracting three named presets at the top of the file:

  • STANDARD_RETRYattempts: 3, exponential backoff (5s), complete 7d/1000, fail 14d
  • NO_RETRY_LIGHT_RETENTIONattempts: 1, no backoff, complete 1d/100, fail 7d
  • NO_RETRY_MEDIUM_RETENTIONattempts: 1, no backoff, complete 7d/500, fail 14d

Each queue's defaultJobOptions now spreads the matching preset and overrides only the fields that diverge, so each queue's policy reads as base + deltas at a glance.

Pattern Queues
{ ...STANDARD_RETRY } (no overrides) forecast, notification, budgetAlert
STANDARD_RETRY + retention overrides sync, auditLog
STANDARD_RETRY + delay override repoCache
{ ...NO_RETRY_LIGHT_RETENTION } (no overrides) autoTag, duplicateScan, magicSelect
NO_RETRY_LIGHT_RETENTION + retention overrides testmoImport, elasticsearchReindex, generateFromUrl
{ ...NO_RETRY_MEDIUM_RETENTION } (LOCKED) copyMove, stepScan
Fully inline (every field bespoke) email, webhookDispatch

Bit-for-bit identical defaultJobOptions for every queue. Net: 48 insertions, 138 deletions, one file.

Preserved:

  • Audit-log queue's doc-link block comment (audit-log-reliability.md)
  • LOCKED markers on copyMove + stepScan (moved from inline to line-above the spread, semantically equivalent)
  • Webhook-dispatch's custom backoff strategy comment block
  • All lazy-init / valkey-check / error-handler boilerplate

Originally filed as 999.3 from Phase 63 reliability hardening (see .planning/milestones/v0.22.1/63-reliability-hardening/63-CONTEXT.md:147).

Related Issue

N/A — internal backlog cleanup.

Type of Change

  • Refactoring (no functional changes)

How Has This Been Tested?

  • Unit tests — pnpm precommit (lint + format:check + 6743 tests) passed locally
  • Integration tests
  • E2E tests
  • Manual testing

Test Configuration:

  • OS: macOS (Darwin 25.4.0)
  • Node version: v24.14.0

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Pull three recurring retry/retention shapes into named constants
(STANDARD_RETRY, NO_RETRY_LIGHT_RETENTION, NO_RETRY_MEDIUM_RETENTION) at
the top of testplanit/lib/queues.ts. Each queue's defaultJobOptions now
spreads the matching preset and overrides only the fields that diverge,
so each queue's policy reads as base + deltas at a glance.

The webhook-dispatch queue stays fully inline because every field is
bespoke (custom backoff strategy, 7-attempt curve, large retention). The
email queue is also inline — its attempts/delay/retention all differ
from STANDARD_RETRY, so the spread would be dead weight.

Bit-for-bit identical defaultJobOptions for every queue; doc-link block
on auditLog and LOCKED markers on copyMove / stepScan preserved.

Closes 999.3 (BullMQ queue config standardization, filed from Phase 63
.planning/milestones/v0.22.1/63-reliability-hardening/63-CONTEXT.md).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@therealbrad therealbrad merged commit 259e16d into main May 14, 2026
5 checks passed
@therealbrad therealbrad deleted the chore/queue-config-standardization branch May 14, 2026 19:30
@therealbrad
Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 0.28.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@therealbrad
Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 0.28.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

therealbrad added a commit that referenced this pull request May 19, 2026
…nts (#319)

release-please auto-generated the v0.28.0 section based on commit history
and listed ~30 review-approval features whose source code was reverted in
PR #317 before the release. None of those features actually shipped in
v0.28.0. The GitHub release page has already been corrected; this commit
brings the in-repo CHANGELOG.md in line so future release-please runs
have a clean baseline.

The actual v0.28.0 contents are Turkish/Russian locale support (#318),
the shared queue presets (#316), and the cleanup itself (#317).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
therealbrad added a commit that referenced this pull request May 19, 2026
Brings the v0.28.0 i18n release (Turkish + Russian locales, queue-presets
refactor, polluted-CHANGELOG cleanup) onto the parameterized-test-cases
branch so it merges as v0.29.0.

Conflict resolutions:

- testplanit/CHANGELOG.md, docs/docs/{faq,user-guide/user-profile}.md:
  took main (cleaned v0.28.0 entry + 15-locale list).
- testplanit/{schema.zmodel,prisma/schema.prisma}: union — added
  tr_TR and ru_RU to the Locale enum, kept the ITERATION_* AuditAction
  values from this branch.
- testplanit/i18n/{navigation,dateFnsLocales}.ts, testplanit/crowdin.yml:
  union of locale lists.
- testplanit/package.json: main's 0.28.0 version + branch's
  worker:iteration-generation script + the fix-zenstack-symlink.js call
  in `generate`.
- testplanit/lib/queues.ts, queueNames.ts, ecosystem.config.js,
  scripts/build-workers.js: registered the iteration-generation queue
  and worker alongside main's new STANDARD_RETRY / NO_RETRY_*
  JobsOptions constants from #316.
- 13 messages/*.json locale files: branch's parameter strings are pure
  additions over main's content, so HEAD wins for every conflict block.
- testplanit/app/api/users/[userId]/route.ts: took main's refactor to
  shared Zod enum constants (Theme, Locale, ItemsPerPage, DateFormat,
  TimeFormat) so the new locales flow through automatically.
- testplanit/app/api/llm/generate-test-cases/{expand,outline,shared}.ts:
  kept branch's includeParameters admin gate + buildSystemPrompt
  signature extension.
- testplanit/lib/services/testRunSummary*.ts and
  webhooks/event-emitters/testRunEvents.{ts,test.ts}: kept branch's
  getPerCaseIterationCounts + per-iteration redacted-values
  assembly (D-13 / INT-03 / INT-04).
- testplanit/app/[locale]/projects/settings/[projectId]/webhooks/
  webhook-outbound-form.tsx: kept the iteration.result.recorded event
  + the "result.recorded" → resultRecorded i18n path mapping.
- Various MCP e2e specs + admin pages: took main's
  eslint-disable-next-line comments (silence no-console / no-var /
  react-hooks/refs warnings that the branch lost).
- testplanit/lib/hooks/__model_meta.ts +
  testplanit/lib/openapi/zenstack-openapi.json: regenerated via
  `pnpm generate` after schema resolution.
- docs/blog/2026-05-18-introducing-parameterized-test-cases.md:
  v0.28.0 → v0.29.0 (release will follow this branch's merge to main.

Verified: undefined
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "lint" not found (0 errors), undefined
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "type-check" not found, undefined
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "build" not found all
clean on the merged tree.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EOF
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant