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

publish pipeline metadata by default when pushing packages #8921

Merged
merged 3 commits into from
Nov 28, 2018
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
14 changes: 9 additions & 5 deletions Tasks/Common/packaging-common/provenance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,15 @@ export class ProvenanceHelper {
baseUrl: string,
handlers: VsoBaseInterfaces.IRequestHandler[],
options: VsoBaseInterfaces.IRequestOptions): Promise<string> {

// while this feature is in preview, it is enabled by the following variable
const useSessionEnabled = tl.getVariable("Packaging.SavePublishMetadata");
if (useSessionEnabled) {
tl.debug("Creating provenance session");

const publishPackageMetadata = tl.getInput("publishPackageMetadata");
jotaylo marked this conversation as resolved.
Show resolved Hide resolved
let shouldCreateSession = publishPackageMetadata && publishPackageMetadata.toLowerCase() == 'true';
if (shouldCreateSession) {
const useSessionEnabled = tl.getVariable("Packaging.SavePublishMetadata");
shouldCreateSession = shouldCreateSession && !(useSessionEnabled && useSessionEnabled.toLowerCase() == 'false')
}
if (shouldCreateSession) {
tl.debug("Creating provenance session to save pipeline metadata. This can be disabled in the task settings, or by setting build variable Packaging.SavePublishMetadata to false");
const prov = new ProvenanceApi(baseUrl, handlers, options);
const sessionRequest = ProvenanceHelper.CreateSessionRequest(feedId);
try {
Expand Down
3 changes: 2 additions & 1 deletion Tasks/Common/utility-common/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function emitTelemetry(area: string, feature: string, taskSpecificTelemet
if (semver.gte(agentVersion, '2.120.0')) {
// Common Telemetry VARs that will be concatenated with the supplied telem object.
let commonTelem = {
'SYSTEM_TASKINSTANCEID': tl.getVariable('SYSTEM_TASKINSTANCEID'),
'SYSTEM_JOBID': tl.getVariable('SYSTEM_JOBID'),
'SYSTEM_PLANID': tl.getVariable('SYSTEM_PLANID'),
'SYSTEM_COLLECTIONID': tl.getVariable('SYSTEM_COLLECTIONID'),
Expand Down Expand Up @@ -44,7 +45,7 @@ export function emitTelemetry(area: string, feature: string, taskSpecificTelemet
feature,
JSON.stringify(copy));
} else {
tl.debug(`Agent version of ( ${agentVersion} ) does not meet minimum reqiurements for telemetry`);
tl.debug(`Agent version of ( ${agentVersion} ) does not meet minimum requirements for telemetry`);
}
} catch (err) {
tl.debug(`Unable to log telemetry. Err:( ${err} )`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@
"loc.input.label.verbosityRestore": "Verbosity",
"loc.input.help.verbosityRestore": "Specifies the amount of detail displayed in the output.",
"loc.input.label.searchPatternPush": "Path to NuGet package(s) to publish",
"loc.input.help.searchPatternPush": "The pattern to match or path to nupkg files to be uploaded. Multiple patterns can be separated by a semicolon, and you can make a pattern negative by prefixing it with '-:'. Example: `**/*.nupkg;-:**/*.Tests.nupkg`",
"loc.input.help.searchPatternPush": "The pattern to match or path to nupkg files to be uploaded. Multiple patterns can be separated by a semicolon.",
"loc.input.label.nuGetFeedType": "Target feed location",
"loc.input.label.feedPublish": "Target feed",
"loc.input.help.feedPublish": "Select a feed hosted in this organization. You must have Package Management installed and licensed to select a feed here.",
"loc.input.label.publishPackageMetadata": "Publish pipeline metadata",
"loc.input.help.publishPackageMetadata": "Associate this build/release pipeline’s metadata (run #, source code information) with the package",
"loc.input.label.externalEndpoint": "NuGet server",
"loc.input.help.externalEndpoint": "The NuGet service connection that contains the external NuGet server’s credentials.",
"loc.input.label.searchPatternPack": "Path to csproj or nuspec file(s) to pack",
Expand Down
36 changes: 33 additions & 3 deletions Tasks/DotNetCoreCLIV2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions Tasks/DotNetCoreCLIV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 144,
"Patch": 1
"Minor": 145,
"Patch": 0
},
"minimumAgentVersion": "2.0.0",
"instanceNameFormat": "dotnet $(command)",
Expand Down Expand Up @@ -292,6 +292,15 @@
"helpMarkDown": "Select a feed hosted in this organization. You must have Package Management installed and licensed to select a feed here.",
"visibleRule": "command = push && nuGetFeedType = internal"
},
{
"name": "publishPackageMetadata",
"groupName": "pushAdvanced",
"type": "boolean",
"label": "Publish pipeline metadata",
"defaultValue": true,
"helpMarkDown": "Associate this build/release pipeline’s metadata (run #, source code information) with the package",
"visibleRule": "command = push && nuGetFeedType = internal"
},
{
"name": "externalEndpoint",
"aliases": [
Expand Down
13 changes: 11 additions & 2 deletions Tasks/DotNetCoreCLIV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 144,
"Patch": 1
"Minor": 145,
"Patch": 0
},
"minimumAgentVersion": "2.0.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down Expand Up @@ -292,6 +292,15 @@
"helpMarkDown": "ms-resource:loc.input.help.feedPublish",
"visibleRule": "command = push && nuGetFeedType = internal"
},
{
"name": "publishPackageMetadata",
"groupName": "pushAdvanced",
"type": "boolean",
"label": "ms-resource:loc.input.label.publishPackageMetadata",
"defaultValue": true,
"helpMarkDown": "ms-resource:loc.input.help.publishPackageMetadata",
"visibleRule": "command = push && nuGetFeedType = internal"
},
{
"name": "externalEndpoint",
"aliases": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"loc.input.help.publishRegistry": "Registry the command will target.",
"loc.input.label.publishFeed": "Target registry",
"loc.input.help.publishFeed": "Select a registry hosted in this account. You must have Package Management installed and licensed to select a registry here.",
"loc.input.label.publishPackageMetadata": "Publish pipeline metadata",
"loc.input.help.publishPackageMetadata": "Associate this build/release pipeline’s metadata (run #, source code information) with the package",
"loc.input.label.publishEndpoint": "External Registry",
"loc.input.help.publishEndpoint": "Credentials to use for publishing to an external registry.",
"loc.messages.FoundBuildCredentials": "Found build credentials",
Expand Down
42 changes: 36 additions & 6 deletions Tasks/NpmV1/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions Tasks/NpmV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 0,
"Patch": 31
"Minor": 1,
"Patch": 0
},
"runsOn": [
"Agent",
Expand Down Expand Up @@ -128,6 +128,15 @@
"visibleRule": "publishRegistry = useFeed",
"required": true
},
{
"name": "publishPackageMetadata",
"groupName": "advanced",
"type": "boolean",
"label": "Publish pipeline metadata",
"defaultValue": true,
"helpMarkDown": "Associate this build/release pipeline’s metadata (run #, source code information) with the package",
"visibleRule": "command = publish && publishRegistry = useFeed"
},
{
"groupName": "publishRegistries",
"name": "publishEndpoint",
Expand Down
13 changes: 11 additions & 2 deletions Tasks/NpmV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 0,
"Patch": 31
"Minor": 1,
"Patch": 0
},
"runsOn": [
"Agent",
Expand Down Expand Up @@ -128,6 +128,15 @@
"visibleRule": "publishRegistry = useFeed",
"required": true
},
{
"name": "publishPackageMetadata",
"groupName": "advanced",
"type": "boolean",
"label": "ms-resource:loc.input.label.publishPackageMetadata",
"defaultValue": true,
"helpMarkDown": "ms-resource:loc.input.help.publishPackageMetadata",
"visibleRule": "command = publish && publishRegistry = useFeed"
},
{
"groupName": "publishRegistries",
"name": "publishEndpoint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"loc.input.label.nuGetFeedType": "Target feed location",
"loc.input.label.feedPublish": "Target feed",
"loc.input.help.feedPublish": "Select a feed hosted in this account. You must have Package Management installed and licensed to select a feed here.",
"loc.input.label.publishPackageMetadata": "Publish pipeline metadata",
"loc.input.help.publishPackageMetadata": "Associate this build/release pipeline’s metadata (run #, source code information) with the package",
"loc.input.label.allowPackageConflicts": "Allow duplicates to be skipped",
"loc.input.help.allowPackageConflicts": "If you continually publish a set of packages and only change the version number of the subset of packages that changed, use this option. It allows the task to report success even if some of your packages are rejected with 409 Conflict errors.\n\nThis option is currently only available on Azure Pipelines and using Windows agents. If NuGet.exe encounters a conflict, the task will fail.",
"loc.input.label.externalEndpoint": "NuGet server",
Expand Down
13 changes: 11 additions & 2 deletions Tasks/NuGetCommandV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 0,
"Patch": 51
"Minor": 1,
"Patch": 0
},
"runsOn": [
"Agent",
Expand Down Expand Up @@ -227,6 +227,15 @@
"helpMarkDown": "Select a feed hosted in this account. You must have Package Management installed and licensed to select a feed here.",
"visibleRule": "command = push && nuGetFeedType = internal"
},
{
"name": "publishPackageMetadata",
"groupName": "pushAdvanced",
"type": "boolean",
"label": "Publish pipeline metadata",
"defaultValue": true,
"helpMarkDown": "Associate this build/release pipeline’s metadata (run #, source code information) with the package",
"visibleRule": "command = push && nuGetFeedType = internal"
},
{
"name": "allowPackageConflicts",
"type": "boolean",
Expand Down
13 changes: 11 additions & 2 deletions Tasks/NuGetCommandV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 0,
"Patch": 51
"Minor": 1,
"Patch": 0
},
"runsOn": [
"Agent",
Expand Down Expand Up @@ -227,6 +227,15 @@
"helpMarkDown": "ms-resource:loc.input.help.feedPublish",
"visibleRule": "command = push && nuGetFeedType = internal"
},
{
"name": "publishPackageMetadata",
"groupName": "pushAdvanced",
"type": "boolean",
"label": "ms-resource:loc.input.label.publishPackageMetadata",
"defaultValue": true,
"helpMarkDown": "ms-resource:loc.input.help.publishPackageMetadata",
"visibleRule": "command = push && nuGetFeedType = internal"
},
{
"name": "allowPackageConflicts",
"type": "boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
"loc.description": "Authentication for uploading python distributions using twine. Please add \"-r FeedName/EndpointName --config-file $(PYPIRC_PATH)\" to your twine upload command. For feeds present in this organization use feed name as repository(-r) otherwise use the endpoint name defined in the service connection.",
"loc.instanceNameFormat": "Twine Authenticate $(message)",
"loc.group.displayName.feedAuthentication": "Feeds and Authentication",
"loc.group.displayName.advanced": "Advanced",
"loc.input.label.feedList": "My feeds (select below)",
"loc.input.help.feedList": "Select feeds to authenticate present in this organization.",
"loc.input.label.externalSources": "Feeds from external organizations",
"loc.input.help.externalSources": "Select endpoints to authenticate outside this organization. Make sure the endpoints have package upload permissions.",
"loc.input.label.publishPackageMetadata": "Publish pipeline metadata",
"loc.input.help.publishPackageMetadata": "Associate this build/release pipeline’s metadata (run #, source code information) with the package when uploading to my feeds.",
"loc.messages.Info_AddingInternalFeeds": "Adding auth information for %s internal feed(s).",
"loc.messages.Info_AddingExternalFeeds": "Adding auth information for %s external endpoint.",
"loc.messages.Info_SuccessAddingAuth": "Successfully added auth for %s internal feeds and %s external endpoint.",
Expand Down
Loading