Tests: update automation rules test suite for v2 model#12850
Tests: update automation rules test suite for v2 model#12850Copilot wants to merge 9 commits intohumitos/webhook-filters-v2from
Conversation
Co-authored-by: humitos <244656+humitos@users.noreply.github.com>
|
@copilot can you update this PR with the latest changes in base branch and update the tests, please? |
… copilot/sub-pr-12848 Co-authored-by: humitos <244656+humitos@users.noreply.github.com>
…edesign) Agent-Logs-Url: https://github.com/readthedocs/readthedocs.org/sessions/01f059aa-b9ab-4cad-a3e8-675ab67acff8 Co-authored-by: humitos <244656+humitos@users.noreply.github.com>
Done in commit
|
Documentation build overview
Show files changed (2 files in total): 📝 2 modified | ➕ 0 added | ➖ 0 deleted
|
Agent-Logs-Url: https://github.com/readthedocs/readthedocs.org/sessions/f555f801-41b7-4685-ab07-9f5d4bda99b4 Co-authored-by: humitos <244656+humitos@users.noreply.github.com>
| if result: | ||
| assert rule.run(version) is True |
There was a problem hiding this comment.
We are currently doing return True inside .run() but we probably should remove that because we call it manually only when it's needed now.
There was a problem hiding this comment.
Noted — the callers in oauth/tasks.py don't use the return value from run(). Since that's a change to the model in the base branch (humitos/webhook-filters-v2), I'll leave it for that PR to decide whether to remove return True. The test line assert rule.run(version) is True here verifies the current behaviour; it can be dropped once return True is removed from the model.
Agent-Logs-Url: https://github.com/readthedocs/readthedocs.org/sessions/657866b4-c870-4ee0-a475-10018a6745fc Co-authored-by: humitos <244656+humitos@users.noreply.github.com>
Already up to date — the base branch ( |
|
@copilot the file |
…hookAutomationRule/VersionAutomationRule Agent-Logs-Url: https://github.com/readthedocs/readthedocs.org/sessions/61e9ef60-f3ce-4615-b389-4ba26c5b5e4a Co-authored-by: humitos <244656+humitos@users.noreply.github.com>
Done in commit
|
The automation rules v2 PR consolidated
RegexAutomationRule,WebhookAutomationRule, andVersionAutomationRuleinto a singleAutomationRulemodel. This PR updates the test suite to match.test_automation_rules.pyRegexAutomationRule/WebhookAutomationRule/VersionAutomationRulereferences withAutomationRulematch_arg→version_match_pattern,predefined_match_arg→version_predefined_match_pattern,version_type(str) →version_types(list)VersionAutomationRule.ACTIVATE_VERSION_ACTION→AutomationRule.ACTIVATE_VERSION_ACTION, etc.webhook_files_match_pattern=[...](JSONField list) instead ofmatch_arg;test_version_type_filteringtestsmatch_version()instead ofrun()since version type gating is no longer insiderun()TestRegexAutomationRules→TestAutomationRuleVersionMatching,test_add_rule_regex→test_add_ruletest_automation_rule_views.pyprojects_automation_rule_regex_create/edit→projects_automation_rule_create/editAutomationRuleForm(version_predefined_match_pattern,version_types,version_match_pattern)test_empty_custom_match/test_invalid_regex(form no longer validates these); addtest_create_rule_with_webhook_filtercovering the new webhook filter fieldtest_create_rule_default_descriptionnow assertsrule.description is Noneandrule.get_description() == "Activate version"(description is no longer persisted, derived at runtime)test_githubapp_webhook.pyWebhookAutomationRule/VersionAutomationRuleimports withAutomationRulefromreadthedocs.projects.modelsmatch_arg→webhook_files_match_pattern=[...],version_type→version_types=[...],VersionAutomationRule.TRIGGER_BUILD_ACTION→AutomationRule.TRIGGER_BUILD_ACTIONversion_predefined_match_pattern=ALL_VERSIONSto all webhook rule fixtures💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.