chore: remove unused rule_num and direct rule zone columns#4785
Draft
tpurschke wants to merge 12 commits into
Draft
chore: remove unused rule_num and direct rule zone columns#4785tpurschke wants to merge 12 commits into
tpurschke wants to merge 12 commits into
Conversation
Rule ordering is handled consistently by rule_num_numeric. The rule_num column was NOT NULL but never read for sorting or display; it is dropped across all layers (DB, Hasura, GraphQL, C#, importer, docs, tests). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-orchestrator into chore/remove-unused-rule-num
Consolidate the rule_num and rule zone-column removals into a single 9.1.10 revision-history entry (drops the duplicate 9.1.10 block and the stray 9.1.9 header that collided with the existing request-workflow 9.1.9), and remove the redundant duplicate get_rulebase_for_owner drop in 9.1.10.sql. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
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.



Summary
Removes two sets of deprecated, unused
rulecolumns that nothing in the product reads.Closes #4789
rule_num— aNOT NULLcolumn that nothing read for sorting or display; rule ordering is handled consistently byrule_num_numeric. Its only consumer was a single GraphQL fetch landing in the C#Rule.RuleOrderNumberproperty, which had zero readers.rule_from_zone/rule_to_zone— direct integer zone columns onrule. Rule zones are represented by therule_from_zoneandrule_to_zonelink tables (like the other_resolvedtables); the direct columns were never populated meaningfully and had no live readers.This PR removes all three columns and their now-dead references across every layer.
Changes by layer
ruletable creation schemarule_from_zone/rule_to_zoneFKs + indices) from foreign-keys, indices, and the delete-cascade maintenance scriptrule_num,rule_from_zone,rule_to_zonefrom therule_apiview andv_active_access_allow_rules/view_rule_with_owner(idempotent funcs / materialized views)9.1.10.sql: drops the dependent views/functions (CASCADE), drops the columns, then the idempotent scripts recreate the views without the columns afterward (upgrade SQL runs before idempotent funcs)product_versionto9.1.10+ a single revision-history entryrule_num,rule_from_zone,rule_to_zoneselect_permissionsand the directsrc_zone/dst_zone/zone/rulesrelationships that depended on the columns, across all rolesruleOverview,getTimeBasedRulesByOwner,getRulesByIdWithRefUids,getManagementForNormalizedConfig,getManagementForLatestNormalizedConfig; update theHelpApiFwoQueryexample to use therule_from_zones/rule_to_zoneslink tablesRule.RuleOrderNumberandNormalizedRule.RuleNum(+ mappings); updateExportTestexpected JSONrule_num(and the direct zone fields) from the rule models, the insert path, and the comparisonexcludesets; droprule_num=0from the vendor normalizers (cp, fortios, fortiadom, asa); update tests + sample config docsValidation
ruff check/ruff formatclean;python -m compileallclean; pyright cleandotnet build— 0 warnings / 0 errorsNotes
fwo_test_installationend-to-end install/upgrade check has not been run yet.rule_num/rule_from_zone/rule_to_zonein the newfirewall.ruletable, so whichever lands second must reconcile these column removals.🤖 Generated with Claude Code