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

Add upack changes back into the task. Fix help markdowns for inputs. #10074

Merged
merged 5 commits into from
Apr 10, 2019
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 @@ -3,28 +3,27 @@
"loc.helpMarkDown": "Needs Package Management extension to be installed",
"loc.description": "Download a package from a Package Management feed in Azure Artifacts or TFS. \r\n Requires the Package Management extension.",
"loc.instanceNameFormat": "Download Package $(definition)",
"loc.releaseNotes": "Adds support to download Maven, Python, Universal and Npm packages.",
"loc.group.displayName.advancedOptions": "Advanced",
"loc.input.label.packageType": "Package Type",
"loc.input.help.packageType": "Select the package type",
"loc.input.label.feed": "Feed",
"loc.input.help.feed": "Select the feed",
"loc.input.label.view": "View",
"loc.input.help.view": "Select the view",
"loc.input.help.view": "Select a view to use only versions promoted to that view.",
"loc.input.label.definition": "Package",
"loc.input.help.definition": "Select the package to download.",
"loc.input.help.definition": "If you don't find the package in the list, you can provide the package ID, which you can find using the instructions [here](https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.0#get-packages).",
"loc.input.label.version": "Version",
"loc.input.help.version": "Version of the package",
"loc.input.label.files": "Files",
"loc.input.help.files": "Set the files pattern filter",
"loc.input.help.files": "Specify which files to download using [file matching patterns](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/file-matching-patterns?view=azure-devops).",
"loc.input.label.extract": "Extract package contents",
"loc.input.help.extract": "Check to extract package contents.",
"loc.input.help.extract": "Instead of extracting the package contents and removing the archive, the artifact folder will contain the package archive.",
"loc.input.label.downloadPath": "Destination directory",
"loc.input.help.downloadPath": "Path on the agent machine where the package will be downloaded",
"loc.messages.FailedToGetPackageMetadata": "Fetching package metadata using url %s failed with error %s",
"loc.messages.FailedToDownloadPackage": "Failed to download package file from %s got the following error: %s",
"loc.messages.PackageDownloadSuccessful": "Package download successful",
"loc.messages.CredentialsNotFound": "Could not determine credentials to connect to Package Management service.",
"loc.messages.StartingDownloadOfPackage": "Starting download of NuGet package %s to location %s",
"loc.messages.StartingDownloadOfPackage": "Starting download of package %s to location %s",
"loc.messages.ExtractingPackage": "Extracting package %s to directory %s",
"loc.messages.PackageTypeNotSupported": "Only Nuget, Python, Universal, Npm, and Maven packages types can be downloaded using this task.",
"loc.messages.ExtractionFailed": "Failed to extract package with error %s",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DownloadPackageV1/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function main(): Promise<void> {
return Promise.resolve();
}

if (packageType === "Universal") {
if (packageType === "upack") {
return await downloadUniversalPackage(downloadPath, feedId, packageId, version);
}

Expand Down
21 changes: 10 additions & 11 deletions Tasks/DownloadPackageV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"version": {
"Major": 1,
"Minor": 151,
"Patch": 0
"Patch": 1
},
"demands": [],
"preview": true,
"releaseNotes": "Adds support to download Maven, Python and Npm packages.",
"releaseNotes": "Adds support to download Maven, Python, Universal and Npm packages.",
"minimumAgentVersion": "2.115.0",
"groups": [
{
Expand All @@ -29,13 +29,13 @@
"type": "pickList",
"label": "Package Type",
"required": true,
"helpMarkDown": "Select the package type",
"defaultValue": "nuget",
"options": {
"maven": "Maven",
"npm": "Npm",
"nuget": "NuGet",
"pypi": "Python"
"pypi": "Python",
"upack": "Universal"
}
},
{
Expand All @@ -46,8 +46,7 @@
"required": true,
"properties": {
"EditableOptions": "True"
},
"helpMarkDown": "Select the feed"
}
},
{
"name": "view",
Expand All @@ -58,7 +57,7 @@
"properties": {
"EditableOptions": "True"
},
"helpMarkDown": "Select the view"
"helpMarkDown": "Select a view to use only versions promoted to that view."
},
{
"name": "definition",
Expand All @@ -69,7 +68,7 @@
"properties": {
"EditableOptions": "True"
},
"helpMarkDown": "Select the package to download."
"helpMarkDown": "If you don't find the package in the list, you can provide the package ID, which you can find using the instructions [here](https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.0#get-packages)."
aasim marked this conversation as resolved.
Show resolved Hide resolved
},
{
"name": "version",
Expand All @@ -93,7 +92,7 @@
"EditableOptions": "True"
},
"groupName": "advancedOptions",
"helpMarkDown": "Set the files pattern filter"
"helpMarkDown": "Specify which files to download using [file matching patterns](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/file-matching-patterns?view=azure-devops)."
aasim marked this conversation as resolved.
Show resolved Hide resolved
},
{
"name": "extract",
Expand All @@ -106,7 +105,7 @@
"EditableOptions": "True"
},
"groupName": "advancedOptions",
"helpMarkDown": "Check to extract package contents."
"helpMarkDown": "Instead of extracting the package contents and removing the archive, the artifact folder will contain the package archive."
},
{
"name": "downloadPath",
Expand Down Expand Up @@ -173,7 +172,7 @@
"FailedToDownloadPackage": "Failed to download package file from %s got the following error: %s",
"PackageDownloadSuccessful": "Package download successful",
"CredentialsNotFound": "Could not determine credentials to connect to Package Management service.",
"StartingDownloadOfPackage": "Starting download of NuGet package %s to location %s",
"StartingDownloadOfPackage": "Starting download of package %s to location %s",
"ExtractingPackage": "Extracting package %s to directory %s",
"PackageTypeNotSupported": "Only Nuget, Python, Universal, Npm, and Maven packages types can be downloaded using this task.",
"ExtractionFailed": "Failed to extract package with error %s",
Expand Down
9 changes: 4 additions & 5 deletions Tasks/DownloadPackageV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"version": {
"Major": 1,
"Minor": 151,
"Patch": 0
"Patch": 1
},
"demands": [],
"preview": true,
Expand All @@ -29,13 +29,13 @@
"type": "pickList",
"label": "ms-resource:loc.input.label.packageType",
"required": true,
"helpMarkDown": "ms-resource:loc.input.help.packageType",
"defaultValue": "nuget",
"options": {
"maven": "Maven",
"npm": "Npm",
"nuget": "NuGet",
"pypi": "Python"
"pypi": "Python",
"upack": "Universal"
}
},
{
Expand All @@ -46,8 +46,7 @@
"required": true,
"properties": {
"EditableOptions": "True"
},
"helpMarkDown": "ms-resource:loc.input.help.feed"
}
},
{
"name": "view",
Expand Down
5 changes: 3 additions & 2 deletions Tasks/DownloadPackageV1/universal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ function downloadPackageUsingArtifactTool(
execOptions: IExecOptions
) {
let command = new Array<string>();

var verbosity = tl.getVariable("Packaging.ArtifactTool.Verbosity") || "Error";

command.push("universal", "download",
"--feed", options.feedId,
"--service", options.accountUrl,
"--package-name", options.packageName,
"--package-version", options.packageVersion,
"--path", downloadPath,
"--patvar", "UNIVERSAL_DOWNLOAD_PAT",
"--verbosity", tl.getInput("verbosity"));
"--verbosity", verbosity);

console.log(tl.loc("Info_Downloading", options.packageName, options.packageVersion, options.feedId));
const execResult: IExecSyncResult = artifactToolRunner.runArtifactTool(
Expand Down