Skip to content

feat: type WAF rule tools with appwrite-console 0.10 - #129

Merged
ChiragAgg5k merged 1 commit into
mainfrom
feat/console-sdk-0.10
Oct 8, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
feat/console-sdk-0.10

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Bumps appwrite-console from >=0.8.1,<0.9 to >=0.10.0,<0.11, so the WAF tools match the API:

  • waf_create_*_rule and waf_update_*_rule take conditions as an array of strings. With 0.8.1 the tool schema said a single string, and the API rejected it.
  • waf_get_rule returns the model for the rule's action, keeping fields like difficulty, ttl and location that the generic WafRule dropped.

0.9.0 also changed the analytics property tools (no timezone) and OAuth2 resource (now a list of URIs). The API-key catalog keeps the same 27 services and 676 tools.

test_waf_rule_tools_take_conditions_as_a_list_of_strings fails on 0.8.1 and passes on 0.10.0.

appwrite-console 0.8.1 typed WAF conditions as one string and returned the generic WafRule, so WAF create and update tools sent conditions the API rejects and get_rule dropped the action-specific fields. 0.10.0 takes conditions as a list of strings and returns the model for each rule's action.
@hansi-codes

hansi-codes Bot commented Oct 8, 2026

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The change is otherwise narrowly scoped, with one minor test-coverage gap for the claimed WAF response-model behavior.

The project now requires appwrite-console 0.10.x, and the unit suite checks that WAF create/update tools expose conditions as arrays of strings. The lockfile resolves the new dependency to 0.10.0.

Verdict New comments Fixed Still open
✅ Approved 1 0 0
Finding Where
🟡 Cover the action-specific WAF get response tests/unit/test_server.py:1031
Fix with agent prompt
### Issue 1
tests/unit/test_server.py:1031-1033
**Cover the action-specific WAF get response**

The dependency bump is also meant to make `waf_get_rule` preserve action-specific fields such as `difficulty`, `ttl`, and `location`, but this new test only checks create/update input schemas. A regression to the generic `WafRule` response would still pass; please add a model or fixture assertion for the richer get response.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
📂 Walkthrough · 3
File Change
pyproject.toml Raises the appwrite-console dependency range to 0.10.x.
uv.lock Resolves appwrite-console to 0.10.0 and updates the lock metadata.
tests/unit/test_server.py Adds schema assertions for WAF create/update condition lists.

Reviewed 0f51024 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · Looks good to merge. Summary

Comment thread tests/unit/test_server.py
Comment on lines +1031 to +1033
def test_waf_rule_tools_take_conditions_as_a_list_of_strings(self):
manager = register_services(object(), profile=OAUTH_PROFILE)
tools = {tool.name: tool for tool in manager.get_all_tools()}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cover the action-specific WAF get response

The dependency bump is also meant to make waf_get_rule preserve action-specific fields such as difficulty, ttl, and location, but this new test only checks create/update input schemas. A regression to the generic WafRule response would still pass; please add a model or fixture assertion for the richer get response.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/unit/test_server.py
Line: 1031-1033

Comment:
**Cover the action-specific WAF get response**

The dependency bump is also meant to make `waf_get_rule` preserve action-specific fields such as `difficulty`, `ttl`, and `location`, but this new test only checks create/update input schemas. A regression to the generic `WafRule` response would still pass; please add a model or fixture assertion for the richer get response.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · testing · Reply if this doesn't apply.

@ChiragAgg5k
ChiragAgg5k merged commit a143b3c into main Oct 8, 2026
5 checks passed
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.

1 participant