Skip to content

TF-38341: Add Admin Customization and General settings support - #1495

Closed
sanjay-kansyakar-hashicorp wants to merge 3 commits into
mainfrom
sanjay/TF-38341-admin-customization-settings
Closed

sanjay-kansyakar-hashicorp wants to merge 3 commits into
mainfrom
sanjay/TF-38341-admin-customization-settings

Conversation

@sanjay-kansyakar-hashicorp

@sanjay-kansyakar-hashicorp sanjay-kansyakar-hashicorp commented Sep 23, 2026 •

Copy link
Copy Markdown

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 / Update for /admin/customization-settings
    • New fields: InternalSupportURL, InternalDocumentationURL,
      InternalTutorialsURL, and AvatarSources
      ([]AdminAvatarSource{Source, Enabled}; currently only gravatar is valid).
    • SupportURL is exposed read-only (base fallback) and intentionally not
      updatable.
    • Update uses pointer options: a nil pointer leaves an attribute unchanged;
      an empty string clears an optional URL override so the default HashiCorp link
      is restored.
  • Client.Admin.General — Read / Update for /admin/general-settings
    • New field: EnablePublicRegistration (TFE-only; silently ignored on HCP Terraform).

The Internal* URLs and AvatarSources are 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_settings resources).

The generated /admin/general-settings Kiota client lands via the nightly
API-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:

cd v2 && go test . -run 'TestAdmin(Customization|General)Settings' -v

Output

image

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.

@hashicorp-cla-app

hashicorp-cla-app Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sanjay-kansyakar-hashicorp
sanjay-kansyakar-hashicorp force-pushed the sanjay/TF-38341-admin-customization-settings branch from 7a5187e to ff002fe Compare September 23, 2026 06:13
@sanjay-kansyakar-hashicorp
sanjay-kansyakar-hashicorp marked this pull request as ready for review September 23, 2026 06:26
@sanjay-kansyakar-hashicorp
sanjay-kansyakar-hashicorp requested a review from a team as a code owner September 23, 2026 06:26
Comment thread CHANGELOG.md Outdated
Comment thread v2/admin_settings.go Outdated
Comment thread v2/admin_settings.go Outdated
Comment thread v2/admin_settings.go
Comment thread v2/admin_settings.go
Comment thread v2/admin_settings_test.go Outdated
Comment thread v2/admin_settings_test.go Outdated
Comment thread v2/admin_settings_test.go Outdated
Comment thread v2/admin_settings_test.go Outdated
@sanjay-kansyakar-hashicorp
sanjay-kansyakar-hashicorp force-pushed the sanjay/TF-38341-admin-customization-settings branch 2 times, most recently from e6a7a59 to 5a48bec Compare September 23, 2026 13:35
kosyfrances
kosyfrances previously approved these changes Sep 23, 2026

@kosyfrances kosyfrances left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@hamzahashicorp hamzahashicorp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left a comment on Admin setting grouping

Comment thread v2/admin_settings.go
@sanjay-kansyakar-hashicorp
sanjay-kansyakar-hashicorp force-pushed the sanjay/TF-38341-admin-customization-settings branch from 5a48bec to c7c6c6c Compare September 24, 2026 05:31
@sanjay-kansyakar-hashicorp
sanjay-kansyakar-hashicorp changed the base branch from automation/nightly-api-update/20260923 to automation/nightly-api-update/20260924 September 24, 2026 05:54
@sanjay-kansyakar-hashicorp
sanjay-kansyakar-hashicorp changed the base branch from automation/nightly-api-update/20260924 to automation/nightly-api-update/20260923 September 24, 2026 05:55
@sanjay-kansyakar-hashicorp
sanjay-kansyakar-hashicorp changed the base branch from automation/nightly-api-update/20260923 to main September 24, 2026 12:08
@sanjay-kansyakar-hashicorp
sanjay-kansyakar-hashicorp changed the base branch from main to automation/nightly-api-update/20260923 September 24, 2026 12:09
hamzahashicorp
hamzahashicorp previously approved these changes Sep 24, 2026
@hamzahashicorp
hamzahashicorp changed the base branch from automation/nightly-api-update/20260923 to main September 28, 2026 13:24
@hamzahashicorp
hamzahashicorp dismissed their stale review September 28, 2026 13:24

The base branch was changed.

@hamzahashicorp
hamzahashicorp added this pull request to stack #1503 September 28, 2026 19:40
Comment thread v2/admin_settings.go Outdated
Comment thread v2/admin_settings.go Outdated
Comment thread CHANGELOG.md Outdated
Comment thread v2/admin_settings.go
// can be grouped alongside it.
//
// TFE API docs: https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/settings
type AdminSettings struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@hamzahashicorp

Copy link
Copy Markdown
Member

Closing this PR as the functions are already generated

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