Add phase lifecycle callbacks and DNS zone file validation tests#106
Merged
Conversation
…, full lifecycle test - Orchestrator.execute_phases() now accepts on_phase_start, on_phase_complete, on_phase_skip, on_phase_error callbacks so callers get live phase notifications - netengines up wires these callbacks to click.echo with timing and colour, replacing the single silent block with per-phase ⧗/✓/✗ lines - Add 5 DNS delegation chain unit tests to TestDNSHandler: NS delegation per TLD, glue A records, platform.internal delegation, listen_ip alignment, and TLD zone SOA+NS correctness - Add TestFullMVPLifecycle.test_full_mvp_lifecycle: end-to-end mock bootstrap (all 9 handlers), callback firing verification, world_spec persistence, and live reload with a new org - Fix test_cli.py execute_phases assertions to allow extra callback kwargs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZK9485jQhx93gzqv2DARZ
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZK9485jQhx93gzqv2DARZ
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
This PR enhances the orchestrator's phase execution with lifecycle callbacks for better observability and adds comprehensive DNS zone file validation tests. It also improves CLI output with real-time phase progress reporting.
Key Changes
Orchestrator Phase Callbacks
Orchestrator.execute_phases():on_phase_start: Called before phase execution beginson_phase_complete: Called after successful phase completionon_phase_skip: Called when a phase is skipped (already completed)on_phase_error: Called when a phase fails with the exceptionPHASE_LABELS), and exception details (for error callback)CLI Improvements
netengine upcommand with real-time phase progress reportingDNS Handler Tests
Added five new test cases to
TestDNSHandlervalidating DNS zone file generation:test_root_zone_file_has_ns_delegation_per_tld: Verifies NS delegation records for each TLDtest_root_zone_file_has_glue_record_per_tld: Validates glue A records for TLD nameserverstest_root_zone_file_has_platform_delegation: Ensures platform.internal delegationtest_tld_output_has_listen_ip_per_tld: Confirms listen_ip configuration per TLDtest_tld_zone_files_have_correct_soa_and_ns: Validates SOA and NS records in TLD zone filesEnd-to-End Test
TestFullMVPLifecycleclass with comprehensive lifecycle test covering:Test Updates
assert_awaited_once_with()calls, allowing for additional callback parametershttps://claude.ai/code/session_01BZK9485jQhx93gzqv2DARZ