Handle api_key alias in flags token assertions#19
Merged
Conversation
Member
Author
|
some sdks fail because they send api_token isntead of token which is an alias for the /flags request |
minimal-adapter Compliance ReportDate: 2026-05-22 08:23:55 UTC ✅ All Tests Passed!16/16 tests passed Feature_Flags Tests✅ 16/16 tests passed View Details
|
parallel-adapter Compliance ReportDate: 2026-05-22 08:24:18 UTC ✅ All Tests Passed!16/16 tests passed Feature_Flags Tests✅ 16/16 tests passed View Details
|
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
tests/test_feature_flag_support.py:183-200
**Missing negative test cases for alias path**
The parametrized test covers both happy paths (body contains `token` and body contains `api_key`) but omits: (1) the case where neither field is present (should raise `AssertionError`), and (2) the case where `api_key` is present but its value doesn't match `expected` (also should raise). Without these, a regression that accidentally swallows the failure path would not be caught by the test suite.
Reviews (1): Last reviewed commit: "Handle api_key alias in flags token asse..." | Re-trigger Greptile |
This was referenced May 22, 2026
ioannisj
approved these changes
May 22, 2026
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
Some SDKs send
api_keyinstead oftokenin/flagsrequest bodies. The harness default assertion expectstoken, causing otherwise valid requests to fail the feature flag contract.Changes
api_keyto satisfy/flagsrequest field assertions fortoken.tokenandapi_keyrequest body fields.api_keyalias values.0.5.2inpyproject.tomlanduv.lock.0.5.2changelog entry documenting the fix.Checklist
Test plan
uv run --with pytest --with pytest-asyncio pytest tests/test_feature_flag_support.py