Repository navigation
TF-38341: Add Admin Customization and General settings support - #1495
sanjay-kansyakar-hashicorp wants to merge 3 commits into
Conversation
7a5187e to
ff002fe
Compare
e6a7a59 to
5a48bec
Compare
hamzahashicorp
left a comment
There was a problem hiding this comment.
Left a comment on Admin setting grouping
5a48bec to
c7c6c6c
Compare
The base branch was changed.
| // can be grouped alongside it. | ||
| // | ||
| // TFE API docs: https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/settings | ||
| type AdminSettings struct { |
There was a problem hiding this comment.
It seems like there are now 2 entry points for this resource, the kiota generated and handwritten
client.API.Admin().CustomizationSettings()
client.API.Admin().GeneralSettings()
client.Admin.Settings.Customization
client.Admin.Settings.General
We should go with the generated ones to be inline with other existing resources. Or is there a reason why we need this resource to have 2 entry points?
There was a problem hiding this comment.
Hi Ukeme! thanks for the comment. After looking into it, I'm starting to wonder whether PR 1495 is even needed at all. From my understanding (and please correct me if I'm wrong), the Kiota generated client already covers the API endpoints this PR wishes to complete. For context: here is the JIRA ticket for it: https://hashicorp.atlassian.net/browse/TF-38341
The ticket targets v2, but uses v1 language. Since v2 work goes through the generated client, I think the ticket is effectively complete once the nightly regen lands the general-settings builder. Does that match your understanding?
There was a problem hiding this comment.
that's right, once the nightly that contains your new API endpoints get merged, it becomes available via v2 so the ticket would be done.
|
Closing this PR as the functions are already generated |
Description
Adds ergonomic v2 client support for the admin Customization and General
settings singletons, exposing the new fields so Go automation (and the Terraform
provider) can read and update them programmatically.
New surface under
Client.Admin:Client.Admin.Customization—Read/Updatefor/admin/customization-settingsInternalSupportURL,InternalDocumentationURL,InternalTutorialsURL, andAvatarSources(
[]AdminAvatarSource{Source, Enabled}; currently onlygravataris valid).SupportURLis exposed read-only (base fallback) and intentionally notupdatable.
nilpointer leaves an attribute unchanged;an empty string clears an optional URL override so the default HashiCorp link
is restored.
Client.Admin.General—Read/Updatefor/admin/general-settingsEnablePublicRegistration(TFE-only; silently ignored on HCP Terraform).The Internal* URLs and
AvatarSourcesare only meaningful on Terraform Enterprise;on HCP Terraform they are zero-valued.
This change will be consumed by the Terraform provider in TF-38342
(
tfe_admin_customization_settings/tfe_admin_general_settingsresources).The generated
/admin/general-settingsKiota client lands via the nightlyAPI-update PR (#1494), which this PR is based on. Once #1494 merges to
main,this PR's base should be re-targeted to
main.https://hashicorp.atlassian.net/browse/TF-38341
Testing
Unit tests (httptest-based, no live TFE instance required) cover read, update,
and clear semantics for all new fields:
Output
PCI review checklist
I have documented a clear reason for, and description of, the change I am making.
If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
Revert plan: this is additive (new
Client.Admin.*surface + tests + CHANGELOG).Reverting the PR fully removes the feature with no data migration or state impact.
If applicable, I've documented the impact of any changes to security controls.
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.