Add an optional parameter prTitle to BaseCommand.GitHubSubmitManifests and avoid breaking existing calls of this function.
For PR Title validation, let GitHub Api handle the validation and show exception message to user. The downside is (I think) the messages won't be localized, but the upside being anytime the validation (let's say PR title max length) changes at the api side, we wouldn't have to update it manually in the code 👀
In case title exceeds max length, it will be caught in ApiValidationException. The current limit seems to be 1024 characters (albeit the error response message says 256 chars)
Since --prtitle for update command is only applicable when the --submit flag is used, then what if a user was to use --prtitle in the update command without setting the submit flag?
I looked at getting a native solution from CommandLineParser to handle this option dependency on another option, but couldn't find the capability in the module to do so. Related issue: https://github.com/commandlineparser/commandline/issues/3
The alternative would be to handle it manually in the code and print a localized warning message something like "Submit flag is not set. The value of title is ignored.", but since this seems like a harmless scenario I decided not to handle it. Please let me know if I am thinking wrong about any of this.
359
Description of the changes
prTitle
to BaseCommand.GitHubSubmitManifests and avoid breaking existing calls of this function.ApiValidationException
. The current limit seems to be 1024 characters (albeit the error response message says 256 chars)<PackageId> version <PackageVersion>
will be used.ArgumentException
Need feedback
Since
--prtitle
forupdate
command is only applicable when the--submit
flag is used, then what if a user was to use --prtitle in the update command without setting the submit flag?I looked at getting a native solution from CommandLineParser to handle this option dependency on another option, but couldn't find the capability in the module to do so. Related issue: https://github.com/commandlineparser/commandline/issues/3
The alternative would be to handle it manually in the code and print a localized warning message something like "Submit flag is not set. The value of title is ignored.", but since this seems like a harmless scenario I decided not to handle it. Please let me know if I am thinking wrong about any of this.
Microsoft Reviewers: Open in CodeFlow