Skip to content

Fixed #140 -- Added route inject config validation before route registration.#172

Merged
DevilsAutumn merged 1 commit into
DevilsAutumn:mainfrom
utk2103:issue_140
Jul 13, 2026
Merged

Fixed #140 -- Added route inject config validation before route registration.#172
DevilsAutumn merged 1 commit into
DevilsAutumn:mainfrom
utk2103:issue_140

Conversation

@utk2103

@utk2103 utk2103 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Quater.add_route() now validates inject names/values at add time by routing through normalize_inject() inside
    build_route_definition(), matching RouteGroup's existing behavior.
  • Dropped redundant normalize_inject() call in RouteGroup.add_route() since validation now lives in the shared builder.
  • Added unit tests covering invalid inject parameter names and non-Resource inject values on Quater.add_route().
  • Documented add-time validation in docs/en/dev/resources.md and recorded the change in docs/en/dev/changelog.md.

Linked Issue

Fixes #140

Contributor Checklist

  • The linked issue was marked accepted before I started.
  • Nobody else was assigned or already working on the issue before I started.
  • My branch is named issue_{issue_number}.
  • The PR is focused on one issue with no unrelated changes.
  • Tests are added or updated when behavior changes.
  • Docs are updated when user-facing behavior changes.
  • Changelog is updated when the change is release-visible.
  • I listed the checks I ran below.

Checks Run

  • uv run pytest tests/unit/test_app_config.py -k "inject" -x — 2 passed
  • uv run pytest tests/unit/test_route_group.py tests/unit/test_app_config.py — 131 passed
  • uv run pytest tests/unit — 905 passed

@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR moves route inject validation into the shared route builder. The main changes are:

  • Quater.add_route() now validates invalid inject names and values at registration time.
  • RouteGroup.add_route() now relies on the shared builder for the same validation.
  • Unit tests cover app-level invalid inject names and non-Resource values.
  • Resource docs and the changelog describe the earlier validation timing.

Confidence Score: 5/5

This looks safe to merge.

No blocking issues found in the changed code.

No files need follow-up.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the inject-validation pytest suite and captured the run details in a log, including the command, working directory, selected pytest node names, EXIT_CODE: 0, and the summary 2 passed, 85 deselected.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/quater/_route_definition.py Centralizes inject validation in the shared route-definition builder.
src/quater/groups.py Removes duplicate route-level inject normalization from RouteGroup.add_route().
tests/unit/test_app_config.py Adds app-level tests for invalid inject names and non-Resource values.
docs/en/dev/resources.md Documents registration-time validation for route inject maps.
docs/en/dev/changelog.md Records the route inject validation timing change.

Reviews (6): Last reviewed commit: "Fixed #140 -- Added route inject config ..." | Re-trigger Greptile

@DevilsAutumn DevilsAutumn left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@utk2103 Thanks, just a small correction, rest everything looks correct.

Comment thread docs/en/dev/changelog.md Outdated
Comment thread docs/en/dev/changelog.md
@DevilsAutumn DevilsAutumn changed the title Refactor inject parameter handling in route definitions and add validation tests for inject values Fix #140 -- Validate route inject config when adding routes to Quater Jul 13, 2026
@DevilsAutumn DevilsAutumn changed the title Fix #140 -- Validate route inject config when adding routes to Quater Fixed #140 -- Added route inject config validation before route registration. Jul 13, 2026
@DevilsAutumn DevilsAutumn merged commit 83eddd8 into DevilsAutumn:main Jul 13, 2026
6 checks passed
@utk2103 utk2103 deleted the issue_140 branch July 13, 2026 10:59
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.

Validate route inject config when adding routes to Quater

2 participants