T182's sentinel could appear in a random id, so it asserts by value - #146
Merged
Conversation
The employee number 4471 is four decimal digits, all of them hex digits too, so it appears by chance in a request id or a hash. CI failed the listing on one interpreter of four while the other three passed the same code. The check now walks the document and compares values, which is what it was for: putting claims back into the entry still fails it.
|
Warning Review limit reachedNext included review available in 37 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
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.
test_T182_the_pending_listing_withholds_claim_valuesgreps the whole rendered listing for4471, the employee number in its fixture. Those are four decimal digits, and every decimal digit is a hex digit, so the string turns up by chance in a request id or a hash.It failed CI on check (3.12) of PR #145 while 3.11, 3.13 and 3.14 passed the same code, which is the signature of a coincidence rather than a defect. Nothing in that PR touches this file or the operator server.
The test's intent is right and is kept: a claim that leaked through any field must fail it, not just through the
principalkey. So the check now walks the document and compares values and keys, instead of substring-matching a number that hex can spell. The three distinctive strings (CASE-9,employee_no,issuer.example) keep their substring checks, because hex cannot spell them.Checked the check: putting
claimsback into the listing entry (gateway/operator.py:708) still fails the test, at the new assertion. That was the mutation the test was originally written for.Test-only, and it unblocks #145 and #144.