Commit 9302c3f
authored
Mark deprecated fields with
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
```proto
// 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
```proto
// 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.
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/frequenz-floss/frequenz-api-dispatch/issues/new?title=✨Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.deprecated option in protobuf (#269)File tree
2 files changed
+4
-1
lines changed- proto/frequenz/api/dispatch/v1
2 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
| |||
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | | - | |
| 441 | + | |
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
| |||
0 commit comments