Skip to content

Mark deprecated fields with deprecated option in protobuf#269

Merged
Marenz merged 1 commit intov0.x.xfrom
copilot/fix-252
Aug 11, 2025
Merged

Mark deprecated fields with deprecated option in protobuf#269
Marenz merged 1 commit intov0.x.xfrom
copilot/fix-252

Conversation

Copy link
Contributor

Copilot AI commented Aug 7, 2025

This PR adds the protobuf deprecated option to properly mark deprecated fields and message types in the dispatch API schema.

Changes Made

  1. CategorySet message: Added option deprecated = true; to mark the entire message type as deprecated
  2. component_categories field: Added [deprecated = true] to mark the field as deprecated
  3. Release Notes: Updated RELEASE_NOTES.md to document the deprecation changes

Before

// Deprecated: Use `CategoryTypeSet` instead
message CategorySet {
  // Set of component categories
  repeated frequenz.api.common.v1alpha8.microgrid.electrical_components
      .ElectricalComponentCategory categories = 1;
}

// Deprecated: Component categories
// Use `CategoryTypeSet` instead  
// In future versions, this field will be removed.
CategorySet component_categories = 2;

After

// Deprecated: Use `CategoryTypeSet` instead
message CategorySet {
  option deprecated = true;
  // Set of component categories
  repeated frequenz.api.common.v1alpha8.microgrid.electrical_components
      .ElectricalComponentCategory categories = 1;
}

// Deprecated: Component categories
// Use `CategoryTypeSet` instead
// In future versions, this field will be removed.
CategorySet component_categories = 2 [deprecated = true];

Benefits

  • Clear deprecation signaling: Code generators will now properly mark these elements as deprecated in generated client libraries
  • Developer warnings: Developers using these deprecated fields will receive appropriate deprecation warnings
  • API clarity: Makes the deprecation status explicit in the protobuf schema itself, not just in comments
  • Future-proof: Prepares for eventual removal of these deprecated elements

The changes follow the official protobuf specification for marking deprecated elements and maintain full backward compatibility while providing clear deprecation signals to API consumers.

Fixes #252.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Contributor Author

Copilot AI commented Aug 7, 2025

@Marenz 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI changed the title [WIP] Mark deprecated fields with deprecated option Mark deprecated fields with deprecated option in protobuf Aug 7, 2025
Copilot AI requested a review from Marenz August 7, 2025 08:44
@github-actions github-actions bot added the part:protobuf Affects the protocol buffer definition files label Aug 7, 2025
Copy link
Contributor

@Marenz Marenz left a comment

Choose a reason for hiding this comment

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

Looks good but also update the RELEASE_NOTES.md file

@Marenz
Copy link
Contributor

Marenz commented Aug 7, 2025

@copilot please update the release notes file

Copy link
Contributor Author

Copilot AI commented Aug 7, 2025

@copilot please update the release notes file

Updated the RELEASE_NOTES.md file to document the protobuf deprecation changes in commit 17bdc11.

Copilot AI requested a review from Marenz August 7, 2025 11:53
@github-actions github-actions bot added part:docs Affects the documentation part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) labels Aug 7, 2025
@Marenz Marenz marked this pull request as ready for review August 7, 2025 12:29
Copilot AI review requested due to automatic review settings August 7, 2025 12:29
@Marenz Marenz requested a review from a team as a code owner August 7, 2025 12:29
@Marenz Marenz enabled auto-merge August 7, 2025 12:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR properly marks deprecated protobuf elements with the official deprecated option to provide clear deprecation signals to API consumers and code generators.

  • Added option deprecated = true; to the CategorySet message
  • Added [deprecated = true] to the component_categories field in TargetComponents
  • Updated release notes to document the deprecation changes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
proto/frequenz/api/dispatch/v1/dispatch.proto Added protobuf deprecation options to CategorySet message and component_categories field
RELEASE_NOTES.md Documented the deprecation changes for API consumers

… field

Co-authored-by: Marenz <424752+Marenz@users.noreply.github.com>
@Marenz Marenz disabled auto-merge August 11, 2025 11:27
@Marenz Marenz merged commit 9302c3f into v0.x.x Aug 11, 2025
29 checks passed
@Marenz Marenz deleted the copilot/fix-252 branch August 11, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark deprecated fields with deprecated option

3 participants

Comments