Skip to content

docs(service): add ADR and spec for config annotations#3506

Draft
jrschumacher wants to merge 1 commit into
opentdf:mainfrom
jrschumacher:docs/service-config-annotations-adr-spec
Draft

docs(service): add ADR and spec for config annotations#3506
jrschumacher wants to merge 1 commit into
opentdf:mainfrom
jrschumacher:docs/service-config-annotations-adr-spec

Conversation

@jrschumacher
Copy link
Copy Markdown
Member

Proposed Changes

  • add a service-level ADR for configuration annotations used to generate Helm values and related deployment artifacts
  • add a reusable configuration annotation spec under service/pkg/config/ covering tags, intermediate schema, Helm projection rules, validation, and portability
  • add a service/adr/README.md index for platform-service ADRs

Checklist

  • I have added or updated unit tests
  • I have added or updated integration tests (if appropriate)
  • I have added or updated documentation

Testing Instructions

Documentation-only change; no tests were run.

Signed-off-by: Ryan Schumacher <jschumacher@virtru.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 674e96d1-c84d-4a73-bd25-bc6326a94930

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a formal framework for synchronizing platform configuration with deployment artifacts. By introducing a structured annotation layer on Go configuration structs, the changes enable the automated generation of Helm values, JSON schemas, and documentation, significantly reducing the risk of configuration drift between the application source of truth and Kubernetes deployment manifests.

Highlights

  • Architecture Decision Record: Added a new ADR (0001) detailing the strategy for using configuration annotations to drive consistent Helm value and deployment artifact generation.
  • Configuration Specification: Introduced a comprehensive specification for configuration annotations, defining how Go struct tags will map to Helm values, Kubernetes secrets, and configuration documentation.
  • Documentation Index: Created a new index file at service/adr/README.md to organize and track platform-service architecture decisions.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


Go structs hold the truth we seek, With tags to make the future peak. Helm values flow from code so clean, No more drift in the machine.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces ADR-0001 and a comprehensive specification for generating Helm deployment artifacts from Go configuration structs using custom annotations. The proposed system aims to eliminate drift between application code and Helm charts by making the Go source the single source of truth. The review feedback focuses on refining the annotation specification, specifically recommending the prohibition of commas in tag values to prevent parsing issues, suggesting pipe-separated lists for aliases to align with Go idioms, adding sync.RWMutex to the list of ignored runtime types, and clarifying the syntax for overriding sensitive field detection.

* Tokens are trimmed of surrounding whitespace.
* Empty tokens are ignored.
* Duplicate keys are invalid unless a key explicitly allows repeated values.
* Values SHOULD avoid commas. If comma-containing values are needed, move that metadata to a sidecar registry rather than overloading struct tags.
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.

medium

The grammar defines tokens as comma-separated (line 52), which means any value containing a comma (e.g., in an example or deprecated message) will be incorrectly split by the parser. The specification should either strictly forbid commas in values or define an escaping mechanism.

Suggested change
* Values SHOULD avoid commas. If comma-containing values are needed, move that metadata to a sidecar registry rather than overloading struct tags.
* Values MUST NOT contain commas. If comma-containing values are needed, move that metadata to a sidecar registry rather than overloading struct tags.

| `sensitive` | boolean | Field contains a secret or credential and MUST NOT be emitted as a literal non-secret Helm value. |
| `internal` | boolean | Runtime/internal field that is not operator-facing. Implies exclusion from Helm values unless overridden. |
| `deprecated` | string | Marks the field deprecated. The value SHOULD identify a version, replacement path, or reason. |
| `alias` | config path | Legacy config path accepted for compatibility. May be repeated if the parser supports repeated keys. |
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.

medium

Standard Go struct tag parsing logic typically does not support duplicate keys within a single tag string (e.g., config:"alias=a,alias=b"). It is more idiomatic to use a pipe-separated list for multiple values, similar to the enum key definition.

Suggested change
| `alias` | config path | Legacy config path accepted for compatibility. May be repeated if the parser supports repeated keys. |
| alias | pipe-separated list | Legacy config paths accepted for compatibility. |

* the field is unexported;
* `mapstructure:"-"` or `json:"-"` is present;
* `config:"ignore"` is present;
* the field type is known to be runtime-only, such as `sync.Mutex`, `context.Context`, function types, channels, or embedded filesystem handles.
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.

medium

Include sync.RWMutex in the list of known runtime-only types that the generator should automatically skip.

Suggested change
* the field type is known to be runtime-only, such as `sync.Mutex`, `context.Context`, function types, channels, or embedded filesystem handles.
* the field type is known to be runtime-only, such as sync.Mutex, sync.RWMutex, context.Context, function types, channels, or embedded filesystem handles.

* an exported field is unsupported and not explicitly ignored;
* a `helm.path` is invalid or collides with an incompatible field;
* `config:"sensitive"` is combined with `helm:"source=configmap"`;
* a field name matches common secret terms such as `password`, `secret`, `token`, `private`, or `credential` but lacks either `config:"sensitive"` or an explicit non-sensitive override;
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.

medium

The specification mentions an "explicit non-sensitive override" to satisfy lint rules for fields with sensitive-looking names. Since boolean flags without an equals sign are treated as true (line 60), the spec should explicitly define sensitive=false as the intended syntax for this override.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant