Skip to content

refactor(app): share log query integer parsing and split the editor trigger field policy - #1477

Merged
scttbnsn merged 2 commits into
dev/v1.8from
refactor/log-query-integer
Oct 25, 2026
Merged

scttbnsn merged 2 commits into
dev/v1.8from
refactor/log-query-integer

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Two small cleanups from the quality pass, no behavior change.

  • refactor(log): the three backend log routes (app/api/log.ts, app/api/agent.ts, app/agent/api/index.ts) each carried the same 33-line integer query validation. One strict parser in app/util/parse.ts now serves all three: absent and null pass through, non-string types are rejected, only complete integer syntax is accepted, bounds are checked, and signed, zero and leading-zero inputs behave as before. Auth, level/component filtering and settings are untouched.
  • refactor(config): editor-trigger-snapshot.ts had a complexity of 132 in one function. The field-level policy (what gets a value, what is omitted for references, agents and ambiguous aliases, scalar handling, inherited concurrency and order, case-preserved paths) moved to editor-trigger-field.ts with its own tests. Snapshot collection still owns identity, category and path discovery. Complexity is 18 for the snapshot and 19 for the new descriptor helper; priority order and omission rules are unchanged.

Tests were written first: 36 parser boundary cases and 16 field contract tests failed before the change. Focused suites are green (197 parser and route tests, 202 editor, action, notification and reload tests). The full pre-push gate passed on this head, including 100% backend coverage, build, Biome, Knip, Qlty and workflow checks.

Threat model for review: a self-hosted update manager with authenticated operators. Check that no log route accepts an integer it rejected before and that the editor emits the same field set for every trigger shape. Hostile local maintainers are out of scope.

Changelog

  • ✨ Added parseLogQueryInteger and parser tests for absent, malformed, unsafe, signed, and zero-padded inputs.
  • 🔧 Changed three log routes to use the shared parser for tail and since.
  • ✨ Added triggerFieldDescriptor and tests for trigger field policies.
  • 🔧 Changed trigger snapshot collection to delegate field descriptors to triggerFieldDescriptor.
  • 🔧 The author reports that focused suites and the full pre-push gate passed.

Concerns

  • No current review findings were supplied.

@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
drydock-website Ready Ready Preview Oct 25, 2026 9:05pm UTC
drydockdemo-website Ready Ready Preview Oct 25, 2026 9:05pm UTC

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7748141 and d31e8dc.

Files selected for processing: 8
  • app/agent/api/index.ts
  • app/api/agent.ts
  • app/api/log.ts
  • app/configuration/file/editor-trigger-field.test.ts
  • app/configuration/file/editor-trigger-field.ts
  • app/configuration/file/editor-trigger-snapshot.ts
  • app/util/parse.test.ts
  • app/util/parse.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The changes add a shared parser for log query integers and update three log-entry routes to use it. They also extract trigger field descriptor construction from the editor snapshot into a dedicated function and add tests for its behavior.

Priority: Low

Change: Refactor

Merge Risk: Minimal · up to d31e8

No actionable merge-blocking issue remains; the action editor behavior is covered by existing snapshot tests.

Pre-merge checks: Passed 2
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn
scttbnsn merged commit f31f8db into dev/v1.8 Oct 25, 2026
34 checks passed
@scttbnsn
scttbnsn deleted the refactor/log-query-integer branch October 25, 2026 21:38
scttbnsn added a commit that referenced this pull request Oct 26, 2026
Promote the dev/v1.8 tree (f31f8db) onto main for the rc.7 re-cut. Tree is identical to dev/v1.8; the only content over #1476 is #1477.

This branch was successfully deployed

2 active deployments
Preview – drydock-website — d31e8dca Deployed Oct 25, 2026 by vercel[bot]
Preview – drydockdemo-website — d31e8dca Deployed Oct 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant