Skip to content

fix: [PL-63285]: Usergroup v2 update #1254

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

Merged
merged 8 commits into from
Jul 2, 2025
Merged

Conversation

abhishekdas06
Copy link
Contributor

@abhishekdas06 abhishekdas06 commented Jul 1, 2025

Title: [Component/Feature] Short Description of the Change

Summary:
Provide a brief overview of what the PR does and why it is needed.

Details:
Explain the changes in detail, including any relevant context or background information.

Related Issues:
Reference any related issues or tickets

Testing Instructions:
Describe how the changes were tested. Include any test cases or steps to verify the functionality.
Please include the below test scenario with your changes.

  • Create the resource and execute terraform apply. (Verify the resource is created)
  • Execute terraform apply again without any changes. (Verify no changes should be done)
  • Update the resource and execute terraform apply. (Verify the resource updated successfully)
  • Remove the content from resource file and execute terraform apply. (Verify the resource has been deleted)
  • Add again the resource and execute the terraform apply. (Verify the resource is created)
  • Verify the import the resource file is working fine.
  • In case of remote entity, Verify for both default and non default branch.

#Testing

Imported resource with user_emails

Screenshot 2025-07-01 at 12 28 07 PM

Terrafrom plan mentions 0 changes
Screenshot 2025-07-01 at 12 33 33 PM

Without any user_email or users field

Screenshot 2025-07-01 at 12 34 24 PM
State file shows only user_emails and users is null which is expected
Screenshot 2025-07-01 at 12 35 01 PM

With users field

Terraform import doesn't have access to user_emails field or users field while importing hence it will always import using users_email.
In case userGroupV2 API is not present in customers environment then we fallback to V1 API behaviour

Screenshot 2025-07-01 at 4 05 50 PM

Terraform plan

For already created resources, we only see the diff based on the fields which have been provided.
During plan we have the information of whether user_email or users is present
Screenshot 2025-07-01 at 4 08 12 PM

Screenshots:
Include before and after screenshots to visually demonstrate the changes.
Checklist:

  • Code changes are well-documented.
  • Tests have been added/updated.
  • Changes have been tested locally.
  • Documentation has been updated.
PR Check triggers
  • Build: trigger build
  • Sub Category Field Check: trigger subcategoryfieldcheck
  • gitleaks: trigger gitleaks

@CLAassistant
Copy link

CLAassistant commented Jul 1, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ritek01
❌ abhishekdas06
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Member

@ritek01 ritek01 left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@abhishekdas06 abhishekdas06 changed the title Usergroup v2 update fix: [PL-63285]: Usergroup v2 update Jul 2, 2025
@abhishekdas06 abhishekdas06 merged commit c766189 into main Jul 2, 2025
13 of 16 checks passed
@abhishekdas06 abhishekdas06 deleted the usergroup-v2-update branch July 2, 2025 08:47
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.

4 participants