Skip to content
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

Log more descriptive error message if version option input is invalid UPack@0 #18925

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"loc.messages.PackagesPublishedSuccessfully": "Packages were published successfully",
"loc.messages.PackagesFailedToPublish": "Packages failed to publish",
"loc.messages.UnknownFeedType": "Unknown feed type '%s'",
"loc.messages.Error_NoVersionOptionSpecifiedForPublish": "Invalid versionOption/versionPublishSelector provided. Must be set to 'major', 'minor', 'patch', or 'custom'",
"loc.messages.Error_NoSourceSpecifiedForPublish": "No external source was specified for publish",
"loc.messages.Error_NoSourceSpecifiedForDownload": "No external source was specified for download",
"loc.messages.Error_UnexpectedErrorArtifactTool": "An unexpected error occurred while trying to push the package. Exit code(%s) and error(%s)",
Expand Down
3 changes: 2 additions & 1 deletion Tasks/UniversalPackagesV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"category": "Package",
"version": {
"Major": 0,
"Minor": 227,
"Minor": 228,
"Patch": 0
},
"runsOn": [
Expand Down Expand Up @@ -427,6 +427,7 @@
"PackagesPublishedSuccessfully": "Packages were published successfully",
"PackagesFailedToPublish": "Packages failed to publish",
"UnknownFeedType": "Unknown feed type '%s'",
"Error_NoVersionOptionSpecifiedForPublish": "Invalid versionOption/versionPublishSelector provided. Must be set to 'major', 'minor', 'patch', or 'custom'",
"Error_NoSourceSpecifiedForPublish": "No external source was specified for publish",
"Error_NoSourceSpecifiedForDownload": "No external source was specified for download",
"Error_UnexpectedErrorArtifactTool": "An unexpected error occurred while trying to push the package. Exit code(%s) and error(%s)",
Expand Down
3 changes: 2 additions & 1 deletion Tasks/UniversalPackagesV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"category": "Package",
"version": {
"Major": 0,
"Minor": 227,
"Minor": 228,
"Patch": 0
},
"runsOn": [
Expand Down Expand Up @@ -427,6 +427,7 @@
"PackagesPublishedSuccessfully": "ms-resource:loc.messages.PackagesPublishedSuccessfully",
"PackagesFailedToPublish": "ms-resource:loc.messages.PackagesFailedToPublish",
"UnknownFeedType": "ms-resource:loc.messages.UnknownFeedType",
"Error_NoVersionOptionSpecifiedForPublish": "ms-resource:loc.messages.Error_NoVersionOptionSpecifiedForPublish",
"Error_NoSourceSpecifiedForPublish": "ms-resource:loc.messages.Error_NoSourceSpecifiedForPublish",
"Error_NoSourceSpecifiedForDownload": "ms-resource:loc.messages.Error_NoSourceSpecifiedForDownload",
"Error_UnexpectedErrorArtifactTool": "ms-resource:loc.messages.Error_UnexpectedErrorArtifactTool",
Expand Down
4 changes: 3 additions & 1 deletion Tasks/UniversalPackagesV0/universalpublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ export async function run(artifactToolPath: string): Promise<void> {
if (versionRadio === "custom") {
version = tl.getInput("versionPublish");
}
else {
else if (versionRadio in ["major", "minor", "patch"]) {
feedUri = await pkgLocationUtils.getFeedUriFromBaseServiceUri(serviceUri, accessToken);
version = await getNextPackageVersion(feedUri, accessToken, projectId, feedId, packageName);
} else {
throw new Error(tl.loc("Error_NoVersionOptionSpecifiedForPublish"));
}
tl.debug(tl.loc("Info_UsingArtifactToolPublish"));

Expand Down