Skip to content

feat(domain discovery): add support for Domain Discovery commands #1482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

FarhanSajid1
Copy link

@FarhanSajid1 FarhanSajid1 commented May 21, 2025

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass tests?

This PR adds commands for tools and a domain subcommand. The tools command will be used for placing tools moving forward.

Once a user has enabled Domain Discovery on their accounts, they should have access to the Domain Discovery endpoints.

The commands make use of the status and suggest implementation which were added in fastly/go-fastly#672.

The core changes:

  • Add a root command for tools, which can be reused
  • Add a subcommand for domains, which will be a child of tools.
  • Add suggest and status subcommands under tools
  • Tests for suggest and status subcommands

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

User Impact

  • What is the user impact of this change?

Users that have enabled domain discovery on their accounts can use the suggest and status commands.

Usage:

Fastly Tools

fastly tools --help
USAGE
  fastly tools <command> [<args> ...]

Tools for working with the Fastly platform

Fastly Domain Tools

fastly tools domain --help
USAGE
  fastly tools domain <command> [<args> ...]

Domain Discovery API tools

Status Usage:

fastly tools domain status --help
USAGE
  fastly tools domain status [<flags>] <domain>

Status Commands

Check domain name availability

fastly tools domain status fastly-testing.org --scope=estimate
fastly tools domain status

Suggest Usage:

fastly tools domain suggest --help
USAGE
  fastly tools domain suggest [<flags>] <query> ...

Returns domain search results for a given query

Suggest Commands

fastly domain-v1 tools suggest apple
fastly tools domain suggest --keywords food,kitchen --defaults=club who what 

Are there any considerations that need to be addressed for release?

No breaking changes

@FarhanSajid1 FarhanSajid1 requested a review from Integralist May 21, 2025 16:13
@FarhanSajid1 FarhanSajid1 changed the title Farhansajid1/domain tools feat(domain discovery): add support for Domain Discovery commands May 21, 2025
@FarhanSajid1 FarhanSajid1 marked this pull request as ready for review May 21, 2025 18:48
@FarhanSajid1 FarhanSajid1 requested a review from a team as a code owner May 21, 2025 18:48
@FarhanSajid1 FarhanSajid1 requested a review from kpfleming May 21, 2025 18:48
Copy link
Collaborator

@Integralist Integralist left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks @FarhanSajid1

Just a couple of minor/nit comments and suggestions (approving to unblock).

func NewRootCommand(parent argparser.Registerer, g *global.Data) *RootCommand {
var c RootCommand
c.Globals = g
c.CmdClause = parent.Command(CommandName, "Tools for interacting with Domains")
Copy link
Contributor

Choose a reason for hiding this comment

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

This description seems to general/vague to me, and suggests that it might hold commands for managing domains.

Copy link
Author

Choose a reason for hiding this comment

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

updated, let me know if that makes sense

Comment on lines 36 to 38
// Optional.
cmd.RegisterFlagBool(cmd.JSONFlag())
cmd.CmdClause.Flag("scope", "Scope determines the availability check to perform, specify `estimate` for an estimated check").Action(cmd.scope.Set).StringVar(&cmd.scope.Value)
Copy link
Contributor

Choose a reason for hiding this comment

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

@case-fastly should we expose this flag in the CLI? Not sure that's necessary.

Comment on lines 63 to 68
WantOutput: `Domain Subdomain Zone Path
fastlytest.ing fastlytest. ing
fastlytesti.ng fastlytesti. ng
fastlytesting.com fastlytesting. com
fastlytesting.net fastlytesting. net
fastlytest.in fastlytest. in /g
Copy link
Contributor

Choose a reason for hiding this comment

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

@case-fastly is this output satisfactory?

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.

3 participants