Skip to content

Create ResourceLabels and use for ManagedResource, NetworkConfiguration.#1360

Open
jglogan wants to merge 1 commit intoapple:mainfrom
jglogan:label-refactor
Open

Create ResourceLabels and use for ManagedResource, NetworkConfiguration.#1360
jglogan wants to merge 1 commit intoapple:mainfrom
jglogan:label-refactor

Conversation

@jglogan
Copy link
Copy Markdown
Contributor

@jglogan jglogan commented Mar 27, 2026

  • Closes [Request]: TECH DEBT - Custom type for resource labels. #1359.
  • Create a ResourceLabels type and extract the label validation from NetworkConfiguration into the new type.
  • Create a base AppError type that is compatible with structured logging and delegates message presentation to the error receiver.
  • Define LabelError over AppError for label validation.
  • Slightly reworks NetworkConfiguration entity migration code in NetworksService.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

See related issue.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@github-actions github-actions bot added the cli label Mar 27, 2026

import Collections

public protocol AppError: Error {
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.

Is this going to be the used for the highest level and for generic type of errors (that all resources will follow)? I kind of worked on creating more lower level, managed resource specific handling approach (that each resource will follow but will vary per resource).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't know the answer to that for sure yet. I feel like we'll want to try as much as we can in the coming month and evolve to something sensible by the next release.

What I was going for with this error is:

  • Supports a caused-by chain.
  • Supports structured log output
  • Delegates presentation to an error receiver that is responsible for making sense of chained errors, compound errors, and error metadata and mapping it to one or more log messages.
  • For easier compatibility, doesn't rely on enum for error typing.

@katiewasnothere katiewasnothere self-requested a review March 30, 2026 17:08
- Create a ResourceLabels type and extract the label
  validation from NetworkConfiguration into the new
  type.
- Create a base AppError type that is compatible
  with structured logging and delegates message presentation
  to the error receiver.
- Define LabelError over AppError for label validation.
- Slightly reworks NetworkConfiguration entity migration
  code in NetworksService.
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.

[Request]: TECH DEBT - Custom type for resource labels.

3 participants