Skip to content

Add missing CLI endpoints#113

Open
JoshSEdwards wants to merge 7 commits into
vinyldns:mainfrom
JoshSEdwards:implement-missing-api-endpoints
Open

Add missing CLI endpoints#113
JoshSEdwards wants to merge 7 commits into
vinyldns:mainfrom
JoshSEdwards:implement-missing-api-endpoints

Conversation

@JoshSEdwards
Copy link
Copy Markdown
Contributor

@JoshSEdwards JoshSEdwards commented Jan 5, 2026

Summary

  • add CLI commands for health/status/metrics endpoints (ping/health/color/metrics-prometheus/status/status-update)
  • add CLI commands for zone extras (details, backend IDs, deleted changes, failed changes, ACL rule add/delete)
  • add CLI commands for record set extras (update, count, history, failed changes)
  • add CLI commands for ownership transfer (request/approve/reject/cancel)
  • add CLI commands for group/user extras (group-change, group-valid-domains, user, user-lock, user-unlock)
  • add CLI commands for batch review (approve/reject/cancel)
  • extend Bats suite with coverage for new commands and error-path checks

Dependency

  • updated github.com/vinyldns/go-vinyldns to v0.9.18, which includes the client methods needed by these commands
  • removed the need for a local go.mod replace now that the go-vinyldns changes have been released

Test/CI Updates

  • updated acceptance tests to run against VinylDNS 0.21.6, since the old 0.9.10 test API does not expose several endpoints covered by this PR
  • updated the Makefile test harness to support the newer VinylDNS quickstart script layout while retaining the old script fallback
  • adjusted Bats fixtures for current VinylDNS validation rules and quickstart defaults

Validation

  • GitHub Actions build is passing
  • CLA is passing
  • Snyk security and license checks are passing
  • local compile check: go test ./...

VDNS-253

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Jan 5, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@JoshSEdwards JoshSEdwards changed the title Add missing CLI endpoints for VDNS-253 Add missing CLI endpoints Jan 5, 2026
Comment thread src/zones_extra.go Outdated
}

func zoneACLRuleCreate(c *cli.Context) error {
zoneID, err := getZoneID(client(c), c.String("zone-id"), c.String("zone-name"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

client() is being called twice in this function, once here and once more on line 126. That second call can be removed if the client is created once at the top of the function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 65b5fdf. We create the client once at the top of the function now and reuse it for both getZoneID and ZoneACLRuleCreate.

Comment thread src/zones_extra.go Outdated
}

func zoneACLRuleDelete(c *cli.Context) error {
zoneID, err := getZoneID(client(c), c.String("zone-id"), c.String("zone-name"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar to previous comment, client() is being called twice in this function, once here and once more on line 156. That second call can be removed if the client is created once at the top of the function.

Copy link
Copy Markdown
Contributor Author

@JoshSEdwards JoshSEdwards May 28, 2026

Choose a reason for hiding this comment

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

Fixed in 65b5fdf. Same cleanup as the previous comment. The client is initialized once at the top of the function and reused in zoneACLRuleDelete too

Comment thread src/zones.go
func zoneSync(c *cli.Context) error {
client := client(c)
id, err := getZoneID(client, c.String("zone-id"), c.String("zone-name"))
z, err := client.ZoneSync(id)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a preexisting issue so it could be fixed in a separate PR, but the error from getZoneID on line 255 is silently overwritten by the := on line 256. If the zone lookup fails, id will be empty and ZoneSync will be called with a blank ID, producing a confusing error. We could add an error check after line 255 to remedy this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 65b5fdf. Added an explicit error check after getZoneID so we return the lookup error instead of calling ZoneSync with an empty ID.

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.

2 participants