feat: add 6 validators (batch 3/5) - private_users, managed_oom_rules, restrict_network_interfaces, bind_network_interface, working_directory, unit_env_file#449
Conversation
…etwork_interfaces, bind_network_interface, working_directory, unit_env_file (Resolves #448) Batch 3/5 of the burn-down extension. Each grammar mirrors the systemd C parser: - config_parse_private_users (.nspawn): boolean | "pick" | "identity" | uid[:range] - config_parse_managed_oom_rules: list of filename-safe rule names (string_is_safe STRING_FILENAME) - config_parse_restrict_network_interfaces: optional ~ + list of ALTERNATIVE-length ifnames - config_parse_bind_network_interface: single ALTERNATIVE-length ifname (specifier-aware) - config_parse_working_directory: optional - + (~ | absolute path) - config_parse_unit_env_file: optional - + absolute path Alternative-order gotcha (from #447): for private_users, BOOLEAN is placed LAST so its FlexibleLiteralChoice syntactic regex doesn't greedily match prefixes of "pick"/"identity" and short-circuit the AlternativeCombinator. OptionValueTest missing-function count drops 388 -> 382; found-key count rises 1812 -> 1846. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Test Results1 060 tests 1 060 ✅ 46s ⏱️ Results for commit f499f0b. |
4 tasks
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
Batch 3 of 5. Each grammar derived from systemd C parser:
config_parse_private_users(0)nspawn/nspawn-settings.c:660"pick"/"identity"ORuid(:range)?config_parse_managed_oom_rules(1)load-fragment.c:4093config_parse_restrict_network_interfaces(0)load-fragment.c:5908~+ list ofALTERNATIVE-length ifnamesconfig_parse_bind_network_interface(0)load-fragment.c:6036ALTERNATIVE-length ifname (specifier-aware)config_parse_working_directory(0)load-fragment.c:2576-+ (~OR absolute path)config_parse_unit_env_file(0)load-fragment.c:2637-+ absolute pathResolves #448. Stacked on #447 (batch 2).
Results
OptionValueTestmissing functions: 388 → 382 (−6)Notes
ALTIFNAMSIZ, 128 chars) regex differs from the existingconfig_parse_ifnamevalidator'sIFNAMSIZ(16-char) limit, which is correct sinceRestrictNetworkInterfaces/BindNetworkInterfaceuseifname_valid_full(IFNAME_VALID_ALTERNATIVE).private_usersalternative ordering: BOOLEAN goes LAST because itsFlexibleLiteralChoicesyntactic regex would otherwise eat the first few characters ofpick/identityand short-circuit. Same pattern documented in feat: add 6 validators (batch 2/5) - cpu_quota, htb_class_size, delegate, syscall_errno, address_families, pass_environ #447.ManagedOOMRulesis actually keyed asOOMRules=in the gperf, notManagedOOMRulesets=. Fixed test fixture; validator class name keeps the C-function spelling.Skipped from candidates:
config_parse_log_filter_patterns(0)— PCRE2 regex, can't validate meaningfully without compilingconfig_parse_io_device_weight/latency(0)— path + weight/latency, deferredconfig_parse_path_spec(0),config_parse_cgroup_nft_set— non-trivial syntax variantsTest plan
OptionValueTestandSemanticDataRepositoryTestpass🤖 Generated with Claude Code