-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSDK-9726 - improve modulegen help text and deprecate resource-type flag #4711
base: main
Are you sure you want to change the base?
Conversation
// make sure we support subtypes that are passed with different spacers (e.g., | ||
// "power sensor", "power-sensor", "power_sensor", "powerSensor") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit of flyby logic here. previously, the CLI would complain if we passed power-sensor
but not power_sensor
. Changes here enable us to be more case-agnostic for multi-word resource subtypes.
cc @ale7714 |
Probably gonna hold off on merging this until #4692 is in, as that feature changes some formatting stuff and I want to ensure consistency. cc @purplenicole730 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! and thank you for thinking about resource type/subtype a little bit more in depth, it's good to be aware of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also update the module generation workflow?
return nil | ||
} | ||
} | ||
return fmt.Errorf("given resource '%s' does not exist", inputs.Resource) | ||
return fmt.Errorf("given resource subtype '%s' does not exist", inputs.ResourceSubtype) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that the error would say resource generic does not exist
instead of the inputted generic service
or generic_component
? Not a problem if this was on purpose, but wanted to note
Provides improved help text in terms of the
usage
invocation, as well as clarifying the role/usage of thelanguage
,model-name
,name
,public-namespace
, andresource-subtype
flags.Additionally, removes
resource-type
as a flag we pay attention to/care about. While still supported for backwards compatibility, it is invisible and ignored. This flag is a gotcha since each subtype only has one valid type (except generic, but we can carve out a specific case for that), and a user shouldn't reasonably be expected to understand the component/service distinction that is primarily internal.Tested by creating modules using both old and new code and diffing them to ensure no changes in behavior.
Old help text:
New help text: