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

Simple change detection of JSON resource arguments #1758

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

monde
Copy link
Collaborator

@monde monde commented Oct 11, 2023

Simple change detection of JSON resource arguments. Completely ignores string formatting and instead considers the actual object representation of the JSON. Intended for use by DiffSuppressFunc.

Closes #1633
Closes #1631
Closes #1565
Closes #1518
Closes #1454
Closes #891

$ TF_ACC=1 go test -tags unit -mod=readonly -test.v -run ^TestNoChangeInObjectUnmarshaledFromJSON$ ./okta 2>&1
=== RUN   TestNoChangeInObjectUnmarshaledFromJSON
=== PAUSE TestNoChangeInObjectUnmarshaledFromJSON
=== CONT  TestNoChangeInObjectUnmarshaledFromJSON
=== RUN   TestNoChangeInObjectUnmarshaledFromJSON/there_is_no_change_-_same_same
=== RUN   TestNoChangeInObjectUnmarshaledFromJSON/there_is_no_change_-_same_objects,_different_string_formatting
=== RUN   TestNoChangeInObjectUnmarshaledFromJSON/there_is_no_change_-_attributes_in_different_order_
=== RUN   TestNoChangeInObjectUnmarshaledFromJSON/there_is_change_-_different_values
=== RUN   TestNoChangeInObjectUnmarshaledFromJSON/there_is_change_-_slice_out_of_order
=== RUN   TestNoChangeInObjectUnmarshaledFromJSON/there_is_no_change_-_new_resource_value_will_be_blank
--- PASS: TestNoChangeInObjectUnmarshaledFromJSON (0.00s)
    --- PASS: TestNoChangeInObjectUnmarshaledFromJSON/there_is_no_change_-_same_same (0.00s)
    --- PASS: TestNoChangeInObjectUnmarshaledFromJSON/there_is_no_change_-_same_objects,_different_string_formatting (0.00s)
    --- PASS: TestNoChangeInObjectUnmarshaledFromJSON/there_is_no_change_-_attributes_in_different_order_ (0.00s)
    --- PASS: TestNoChangeInObjectUnmarshaledFromJSON/there_is_change_-_different_values (0.00s)
    --- PASS: TestNoChangeInObjectUnmarshaledFromJSON/there_is_change_-_slice_out_of_order (0.00s)
    --- PASS: TestNoChangeInObjectUnmarshaledFromJSON/there_is_no_change_-_new_resource_value_will_be_blank (0.00s)
PASS
ok      github.com/okta/terraform-provider-okta/okta    0.696s

and instead considers the actual object representation of the JSON.

Closes #1633
Closes #1631
Closes #1565
Closes #1454
Closes #891
@exitcode0
Copy link
Contributor

Perhaps this can also address #1518 (closed by stalebot)
looks like we're already addressing app_settings_json idk if we also wan't to address app_links_json?

@exitcode0
Copy link
Contributor

also #1504 might be relevant? ¯\(ツ)

@monde
Copy link
Collaborator Author

monde commented Oct 11, 2023

I think #1504 is similar, but specifically different in terms of the use of plain json.

@monde monde merged commit 96f69bc into master Oct 11, 2023
2 checks passed
@monde monde deleted the 891_json_change_detection branch October 11, 2023 15:11
@monde monde mentioned this pull request Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment