Repository navigation
fix: resolve lifecycle policy from Django's matched route - #55
Closed
mojtaba-arvin wants to merge 18 commits into
Closed
mojtaba-arvin wants to merge 18 commits into
mojtaba-arvin wants to merge 18 commits into
Conversation
Owner
Author
|
Superseded by the consolidated integration PR #58, which includes this work and passed the complete required PR gate on exact head |
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.
Problem
LifecycleMiddleware previously extracted versions in the outer request phase, before Django resolved the URL. A raw-path regex could select an earlier API-like version segment in a parent mount instead of the selected child route.
Changes
process_view, after URL resolution and before the selected view.ResolverMatch.routeusing the longest complete registered route suffix, including parent URLResolver prefixes and DRF regex anchors.request.version/path heuristics.Compatibility decision
The canonical routing contract remains version-wide. For unresolved paths, legacy 410 behavior is retained only when one configured version can be identified unambiguously. When a path contains multiple distinct version segments and no route resolves, the middleware does not guess.
Verification
Latest head:
82d9ac6b43fa6008d934ef75ab9fd8e7b7dccfea.Full CI passed
The exact head passed the complete PR gate: unit/integration tests, lint, package build, website verification, tox/workflow validation, Windows, macOS, and every configured Python/Django combination. CodeQL passed as well.
PR remains Draft pending the combined integration check with #44. No merge or ready-for-review action has been taken.