Skip to content
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

Missing command to remove comment & contact from host #203

Open
pederhan opened this issue Jan 26, 2024 · 1 comment
Open

Missing command to remove comment & contact from host #203

pederhan opened this issue Jan 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@pederhan
Copy link
Member

pederhan commented Jan 26, 2024

There is no intuitive way to remove a comment or contact info for a host.

The current way to do it is using host set_comment with empty args for comments:

mreg> host set_comment foo.example.com ""
OK: : Updated comment of foo.example.com to ""

While for contact info, the same approach does not work:

mreg> host set_contact foo.example.com ""
WARNING: : invalid mail address  (target host: foo.example.com)

It's probably not a very common (or indeed useful) scenario to remove contact info, so maybe this behavior is fine?

Suggested solution

A new command host remove_comment could be useful:

mreg> host remove_comment foo.example.com
@pederhan pederhan added enhancement New feature or request good first issue Good for newcomers labels Jan 26, 2024
@terjekv
Copy link
Collaborator

terjekv commented Feb 19, 2024

A few questions:

  1. Should we go for comment_set, and comment_remove to match how RRs and other fields are treated?
  2. These fields are text/char fields, in Django they are never null, so host comment_set foo.example.com "" and host comment_remove foo.example.com are functionally identical.
  3. The contact field is an EmailField. This requires a valid email as per https://docs.djangoproject.com/en/5.0/ref/validators/#django.core.validators.EmailValidator and cannot be NULL (it's a char field underneath).

This leads me to a few thoughts:

  1. If contact is optional, we need to figure out something smart for the field (and that'll have to happen on the server side),
  2. We should probably redesign contact and comment commands, while providing (deprecated) aliases for compatibility, and lastly...
  3. I'll remove the "good first issue" tag. :)

@terjekv terjekv removed the good first issue Good for newcomers label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants