Skip to content

test: pin the get_endpoint_id resolution order to the guard-core 142 contract - #26

Merged
rennf93 merged 1 commit into
masterfrom
fix/drift-endpoint-id-contract
Oct 7, 2026
Merged

rennf93 merged 1 commit into
masterfrom
fix/drift-endpoint-id-contract

Conversation

@rennf93

@rennf93 rennf93 commented Oct 7, 2026

Copy link
Copy Markdown
Member

The scheduled Upstream Drift job (run against guard-core@master) went red on test_get_endpoint_id_with_route: guard-core #142 changed get_endpoint_id to prefer state.guard_route_id over the guard_endpoint_id extra before the redacted method:path fallback, and this test's bare Mock() auto-created a truthy guard_route_id attribute. The test now pins the full resolution order explicitly (route id -> extra -> fallback). Local proof: full suite 278 passed at 100% line coverage against the local guard-core master checkout.

…contract

The upstream-drift suite runs this adapter against guard-core@master, where
get_endpoint_id now prefers state.guard_route_id over the guard_endpoint_id
extra before the redacted method:path fallback. The bare Mock() in this test
auto-created a truthy guard_route_id attribute, so the first assertion saw
the Mock instead of the extra and the drift run went red. Pin the full
resolution order explicitly: route id wins, then the extra, then the
fallback. Full suite green locally against the local guard-core master
(278 passed, 100% line coverage).
@rennf93 rennf93 added the no-issue PR not linked to an issue label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for opening your first pull request on djangoapi-guard!

Quick checklist before review (most of these are enforced by CI, but worth a glance):

  • make lint — ruff format, ruff check, mypy, and vulture
  • make test (or make local-test) — full test suite passes with 100% coverage
  • make security — bandit, safety, and pip-audit all clean
  • make quality — radon and xenon complexity thresholds respected
  • No # noqa / # type: ignore shortcuts; pre-existing violations in touched files are fixed
  • Added an entry under ## Unreleased in CHANGELOG.md
  • If you touched a public API, updated the relevant page under docs/
  • If the change involves engine logic, the corresponding fix landed in guard-core first

See CONTRIBUTING.md for the full workflow and the Code of Conduct for the community standards we follow.

Welcome aboard — a maintainer will review shortly.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 2e7c4457-8fba-42ce-8dfd-521b78129d09
  • Autopilot · 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.

@github-actions github-actions Bot added area: decorators Touches Django-specific decorator wiring or re-exports tests Test suite changes labels Oct 7, 2026
@rennf93
rennf93 merged commit 4316eb7 into master Oct 7, 2026
13 of 14 checks passed
@rennf93
rennf93 deleted the fix/drift-endpoint-id-contract branch October 7, 2026 21:05
@rennf93
rennf93 restored the fix/drift-endpoint-id-contract branch October 8, 2026 01:49
@rennf93
rennf93 deleted the fix/drift-endpoint-id-contract branch October 8, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: decorators Touches Django-specific decorator wiring or re-exports no-issue PR not linked to an issue tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant