Skip to content

Conversation

vivekabhiram
Copy link
Contributor

@vivekabhiram vivekabhiram commented Jun 27, 2025

JIRA Ticket
FUNK-1866

Description

This PR improves the handling of the display_name attribute for Segment Functions of type INSERT_SOURCE, INSERT_DESTINATION, and DESTINATION in the Terraform provider. Specifically, it ensures that the display_name in Terraform state remains consistent with the value provided in the configuration, avoiding unwanted workspace name suffixes that Segment may append for these resource types.

Changes

Ensures display_name is set from the plan for INSERT_SOURCE, INSERT_DESTINATION, and DESTINATION types after create and update.
Maintains the configured display_name in the Terraform state for these types during read operations.
No changes to the provider schema or breaking changes for users.
Made changes for newly added INSERT_SOURCE tests too in _test.go

Motivation

Segment appends the workspace name to the display name for certain function types, which can cause drift between the Terraform configuration and the actual state. This change keeps the Terraform state consistent and avoids unnecessary diffs.

Testing

Acceptance tests for INSERT_SOURCE and other function types pass.
Manual testing with real Segment API confirms correct behavior.
Screenshot 2025-06-26 at 8 41 32 PM
Screenshot 2025-06-27 at 12 50 37 PM

@vivekabhiram vivekabhiram requested a review from a team as a code owner June 27, 2025 07:22
@vivekabhiram vivekabhiram requested a review from twfarhan June 30, 2025 11:29
Copy link

@twfarhan twfarhan left a comment

Choose a reason for hiding this comment

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

LGTM

@vivekabhiram vivekabhiram merged commit b461236 into segmentio:main Jul 1, 2025
10 checks passed
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