Skip to content

feat: Route53 record mutations and change status polling#70

Merged
nathanhuh merged 4 commits intomainfrom
feat/route53-mutations
Apr 6, 2026
Merged

feat: Route53 record mutations and change status polling#70
nathanhuh merged 4 commits intomainfrom
feat/route53-mutations

Conversation

@nathanhuh
Copy link
Copy Markdown
Contributor

Summary

Complete the Route53 M3.6 milestone by adding DNS record mutation operations:

  • Create A/CNAME records via multi-step form (Name → Type → Value → TTL)
  • Edit value and TTL of existing A/CNAME records
  • Delete records with type-to-confirm safety (matches RDS/SG pattern)
  • Change status polling (PENDING → INSYNC) after any mutation
  • Keybindings: c (create), e (edit), d (delete) on record detail/list screens

Also includes:

  • New /senior-review skill for codebase quality review
  • Auto-suggest in /implement-feature when invoked without arguments

Related Issues

Closes #40

Changes

Service Layer

  • CreateRecord, UpdateRecord, DeleteRecord methods using ChangeResourceRecordSets API
  • GetChangeStatus method using GetChange API
  • ChangeInfo model struct
  • ChangeResourceRecordSets and GetChange added to Route53ClientAPI interface

TUI Layer

  • 3 new screens: screenRoute53RecordCreate, screenRoute53RecordEdit, screenRoute53RecordDeleteConfirm
  • Change status indicator on record list ("Change: PENDING..." / "Change: INSYNC")
  • 10 new model state fields for mutation workflow

Skills

  • /senior-review — LoC inventory, 5-category code review, severity-rated findings
  • /implement-feature Phase 0 — auto-suggest next feature from PLAN.md + open issues

Validation

  • make test — all tests pass (9 new tests for mutations + change status)
  • make build — compiles cleanly

- Add create, update, delete operations for A/CNAME DNS records
- Type-to-confirm for record deletion (matches RDS/SG pattern)
- Multi-step create form: Name → Type (A/CNAME) → Value → TTL
- Edit form for value and TTL of existing A/CNAME records
- Change status polling (PENDING → INSYNC) after mutations
- Add ChangeResourceRecordSets and GetChange to Route53ClientAPI
- Add 9 new tests for mutation operations and change status

Closes #40
- Add /senior-review skill for codebase quality review with LoC breakdown,
  severity-rated findings, and refactoring priorities
- Add Phase 0 auto-suggest to /implement-feature that cross-references
  PLAN.md and open GitHub issues to recommend next feature
Copy link
Copy Markdown

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

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

Summary

This PR adds Route53 DNS record mutation operations (create, edit, delete) with change status polling. The implementation is generally solid with comprehensive test coverage (9 new tests) and a well-structured TUI workflow.

Critical Finding

Security Vulnerability Found: The DeleteRecord function contains a critical bug in alias record deletion logic that uses the wrong HostedZoneId parameter. This will cause deletion failures and could potentially corrupt DNS records across zones. This must be fixed before merge.

Review Complete

1 blocking issue identified that requires immediate attention.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

rrs.ResourceRecords = nil
rrs.AliasTarget = &r53types.AliasTarget{
DNSName: awssdk.String(record.AliasTarget),
HostedZoneId: awssdk.String(zoneID),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Security Vulnerability: Alias record deletion uses incorrect HostedZoneId parameter causing potential cross-zone data corruption. The code sets HostedZoneId: awssdk.String(zoneID) for alias target, but this should be the target resource's hosted zone ID (from the original record), not the source zone ID. This will cause deletion failures for cross-zone aliases and could corrupt DNS records if AWS doesn't validate properly.

			HostedZoneId:         awssdk.String(record.AliasTarget),

- DNSRecord now stores AliasHostedZoneId from the alias target
- DeleteRecord uses record.AliasHostedZoneId instead of the source
  zone ID, preventing cross-zone data corruption
- Add test verifying alias deletion uses target zone ID, not source
@amazon-q-developer
Copy link
Copy Markdown

Yes, I'll perform another review of the pull request. Let me analyze the changes in this PR which adds Route53 record mutation operations (create, edit, delete) with change status polling, along with new skills for feature implementation.

Copy link
Copy Markdown

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

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

This PR successfully implements Route53 DNS record mutation operations with comprehensive test coverage. The implementation follows the established patterns for RDS and Security Group mutations, providing a consistent user experience.

Key Strengths:

  • Complete CRUD operations (Create, Update, Delete) for A and CNAME records
  • Proper change status polling with PENDING → INSYNC state tracking
  • Well-structured test coverage with 9 new tests covering mutations and change status
  • Alias record support with correct hosted zone ID handling in delete operations
  • Type-to-confirm deletion safety matching existing patterns

Critical Issue:

  • The parseTTL function needs error handling to prevent silent failures on invalid input

The code is well-organized and production-ready once the TTL parsing issue is addressed.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment on lines +891 to +897
func parseTTL(s string) int64 {
var ttl int64 = 300
if s != "" {
fmt.Sscanf(s, "%d", &ttl)
}
return ttl
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Logic Error: The parseTTL function ignores Sscanf errors, which means invalid TTL inputs (non-numeric strings) silently fall back to the default value of 300. This could mask user input errors. Add error handling to properly validate TTL input before attempting API calls.

Suggested change
func parseTTL(s string) int64 {
var ttl int64 = 300
if s != "" {
fmt.Sscanf(s, "%d", &ttl)
}
return ttl
}
func parseTTL(s string) int64 {
var ttl int64 = 300
if s != "" {
if _, err := fmt.Sscanf(s, "%d", &ttl); err != nil {
// Invalid TTL format, use default
ttl = 300
}
}
return ttl
}

- Check Sscanf return error and negative values
- Use named defaultTTL constant for clarity
- Return default (300) on any invalid input instead of silently ignoring
@nathanhuh
Copy link
Copy Markdown
Contributor Author

/q review

Copy link
Copy Markdown

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

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

Code Review Summary

This PR successfully implements Route53 DNS record mutation operations (create, edit, delete) with change status polling, completing the M3.6 milestone. The implementation is well-structured, thoroughly tested, and follows AWS best practices.

Key Strengths

Service Layer (route53.go)

  • Proper use of UPSERT action for create and update operations follows AWS best practices
  • Correct handling of alias records in delete operations, properly setting alias target and zone ID
  • Comprehensive error handling with wrapped errors for better debugging
  • Clean separation of concerns with helper functions like extractChangeInfo and cleanZoneID

TUI Layer (screen_route53.go)

  • Multi-step form workflow provides good user experience
  • Type-to-confirm deletion pattern matches existing RDS/SG patterns for consistency
  • Change status polling with 2-second intervals provides real-time feedback
  • Proper input validation and field prefilling

Testing (route53_test.go)

  • 9 new comprehensive tests covering success, error, and edge cases
  • Excellent test coverage including alias record deletion with correct hosted zone ID verification
  • Mock client implementation allows isolated unit testing

The code is production-ready and meets all requirements for the Route53 mutation milestone.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@nathanhuh nathanhuh merged commit 565a0e2 into main Apr 6, 2026
2 checks passed
@nathanhuh nathanhuh deleted the feat/route53-mutations branch April 6, 2026 02:00
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.

feat: Route53 record mutations and change status tracking (M3.6 phase 2)

2 participants