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

fix(stacks/vcs): StackVCSRepo nested-struct incorrectly serializing attributes #1029

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mjyocca
Copy link
Contributor

@mjyocca mjyocca commented Jan 9, 2025

Description

hashicorp/jsonapi and by extension google/jsonapi packages have issues serializing nested-structs that are not relationship, but attr. Converting to json struct tag directive for the time being.

Example JSON being serialized currently
{
"attributes": {
  "vcs-repo": {
    "Branch": "main", // should be: `branch`
    "Identifier": "", // should be: `identifier`
    "GHAInstallationID": "ghai-*********", // should be: `github-app-instllation-id`
    "OAuthTokenID": "", // should be: `oauth-token-id`
  }
}
}

Testing plan

External links

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

$ TFE_ADDRESS="https://example" TFE_TOKEN="example" go test ./... -v -run TestFunctionsAffectedByChange

...

@datadog-terraform-cloud-hashicorp
Copy link

datadog-terraform-cloud-hashicorp bot commented Jan 10, 2025

Datadog Report

Branch report: mjyocca/stacks-debug-github-app-install-empty
Commit report: a0d91a6
Test service: hashicorp/go-tfe

✅ 0 Failed, 1421 Passed, 159 Skipped, 19m 19.89s Total Time
➡️ Test Sessions change in coverage: 1 no change

…ttributes

hashicorp/jsonapi and by extension google/jsonapi packages have issues
serializing nested-structs that are not relationship, but attr.
Converting to json struct tag directive for the time being
.
@mjyocca mjyocca force-pushed the mjyocca/stacks-debug-github-app-install-empty branch from 4ffa880 to 4d060ed Compare January 10, 2025 23:08
@mjyocca mjyocca marked this pull request as ready for review January 10, 2025 23:09
@mjyocca mjyocca requested a review from a team as a code owner January 10, 2025 23:09
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.

1 participant