refactor(api, shared-data): update command-schema make target to not require version #17555
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
In response to the recent command schema issues with older schema versions having newer commands added, the
command-schema
Make target and correspondinggenerate_command_schema.py
script have been updated as to not need a version be manually entered. Instead, the script will automatically detect the most recent command schema version inshared-data
and automatically update and overwrite that command schema JSON file. This way, as long as a new command schema is made when a chore release branch is made, there is no opportunity for human error when updating the command schema.In a probably unnecessary goal to preserve backwards compatibility with the script, you can still give a version as a positional argument and by default it will still print to standard out. The version will be automatically detected if you don't provided a positional argument, and the flag
--overwrite-shared-data
needs to be included for the file to be overwritten. This way, any outside source relying on this script will still function the same way.Test Plan and Hands on Testing
Changed some protocol engine commands and ensured that the new make target correctly modifies the most recent command schema
Changelog
generate_command_schema.py
to allow automatic detection of most recent command schema version and write to the JSON file in python.PHONY
label missing the initial periodReview requests
While the
generate_command_schema.py
maintains backwards compatibility, I've removed the ability to target a non-most recent version usingmake command-schema
. You can still do this by calling the script manually, but if we want to keep that functionality from the make target please let your voice be heard.Risk assessment
Low, not touching any production code.