Skip to content

refactor settings api to be simpler and more type safe - #7127

Merged
afbrock merged 1 commit into
v2from
adam/simpler_settings_api
Apr 3, 2026
Merged

afbrock merged 1 commit into
v2from
adam/simpler_settings_api

Conversation

@afbrock

@afbrock afbrock commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Why are the changes needed?

The previous API was clunky when we went to start using it, so before it gets any adoption we are changing the interface to be simpler, easier to understand and use, and type safe.

What changes were proposed in this pull request?

This PR removes the 'raw' unstructured APIs and instead only allows get/getForEdit/Update using the structured and typed settings message.

How was this patch tested?

Unit tests and devbox testing with the included buf curl scripts. (along with the cloud pr: https://github.com/unionai/cloud/pull/15164 )

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

@afbrock
afbrock force-pushed the adam/simpler_settings_api branch from 276a4bf to d1b4565 Compare April 1, 2026 18:15
@afbrock
afbrock force-pushed the adam/simpler_settings_api branch 2 times, most recently from 9d79bbf to 869166d Compare April 1, 2026 23:10
@afbrock
afbrock requested a review from jeevb April 2, 2026 18:58
Comment on lines +33 to +35
extend google.protobuf.FieldOptions {
string desc = 50000;
}

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.

TIL

// SettingState controls how a setting at a given scope behaves when no value
// is set. The VALUE state is implicit: it is inferred from which value field
// inside the SettingValue oneof is populated.
// desc is a field option that attaches a human-readable description to a

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.

I think you can create a "settings" directory... and move these two files to it, so your types can be Int64 instead of Int64Setting

@afbrock
afbrock force-pushed the adam/simpler_settings_api branch 2 times, most recently from dc9aa47 to 3370e89 Compare April 3, 2026 02:37
Signed-off-by: Adam Brock <adam@union.ai>
@afbrock
afbrock force-pushed the adam/simpler_settings_api branch from 3370e89 to 304b374 Compare April 3, 2026 18:29
@afbrock
afbrock merged commit 987377d into v2 Apr 3, 2026
17 checks passed
@afbrock
afbrock deleted the adam/simpler_settings_api branch April 3, 2026 18:38
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.

2 participants