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

feat(security-email): add support for security email #497

Conversation

mwasilew2
Copy link
Contributor

@mwasilew2 mwasilew2 commented Jan 10, 2024

Description of the change

related to: https://app.clickup.com/t/8693fq8dx

Adds to the terraform provider support for editing security email.

Note: the graphql api doesn't currently support deleting security email and terraform test sdk runs delete after each test

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (non-breaking change that adds documentation)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development
  • Examples for new resources and data sources have been added
  • Default values have been documented in the description (e.g., "Dummy: (Boolean) Blah blah. Defaults to false.)
  • If the action fails that checks the documentation: Run go generate to make sure the docs are up to date

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • Pull Request is no longer marked as "draft"
  • Reviewers have been assigned
  • Changes have been reviewed by at least one other engineer

@Clickup-user
Copy link

@mwasilew2 mwasilew2 force-pushed the CU-8693fq8dx_add-support-for-security_email-to-terraform-provider_Michal-Wasilewski branch from 741fd88 to 941f6d2 Compare January 22, 2024 16:05
@mwasilew2 mwasilew2 marked this pull request as ready for review January 22, 2024 16:10
@mwasilew2
Copy link
Contributor Author

similar to: #495

Copy link
Contributor

@adamconnelly adamconnelly left a comment

Choose a reason for hiding this comment

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

I'm not convinced about the delete behaviour, but other than that it makes sense.

Can you add a test for the resource please?

}

func resourceSecurityEmailDelete(ctx context.Context, data *schema.ResourceData, i interface{}) diag.Diagnostics {
return diag.Errorf("deleting security email is not supported")
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem a great UX. Wouldn't it mean that if you had added this resource, you'd need to remove it from the Terraform state in order to be able to delete the resource?

I wonder if we should do something like this:

  1. Update the API to allow the security email to be set to an empty string / null; or
  2. Turn this into a no-op (maybe with a warning).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you'd need to remove it from the Terraform state in order to be able to delete the resource?

yes

I'll turn it into a warning and remove the resource from the state

spacelift/resource_security_email.go Outdated Show resolved Hide resolved
@mwasilew2 mwasilew2 force-pushed the CU-8693fq8dx_add-support-for-security_email-to-terraform-provider_Michal-Wasilewski branch from bf491c9 to 67aa628 Compare January 26, 2024 10:42
@mwasilew2 mwasilew2 merged commit c42df0c into main Jan 26, 2024
7 checks passed
@mwasilew2 mwasilew2 deleted the CU-8693fq8dx_add-support-for-security_email-to-terraform-provider_Michal-Wasilewski branch January 26, 2024 11:28
truszkowski pushed a commit that referenced this pull request Mar 4, 2024
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