artifact-engine 1.280.0 → 1.283.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ class ArtifactEngine {
16
16
  }
17
17
  processItems(sourceProvider, destProvider, artifactEngineOptions) {
18
18
  var artifactDownloadTicketsPromise = new Promise((resolve, reject) => {
19
+ var _a;
19
20
  const workers = [];
20
21
  artifactEngineOptions = artifactEngineOptions || new artifactEngineOptions_1.ArtifactEngineOptions();
21
22
  this.createPatternList(artifactEngineOptions);
@@ -23,6 +24,7 @@ class ArtifactEngine {
23
24
  this.isCaseInsensitiveArtifactMatchingEnabled(destProvider);
24
25
  this.artifactItemStore.flush();
25
26
  logger_1.Logger.verbose = artifactEngineOptions.verbose;
27
+ logger_1.Logger.vsoCommandMode = (_a = artifactEngineOptions.vsoCommandMode) !== null && _a !== void 0 ? _a : 'disabled';
26
28
  this.logger = new logger_1.Logger(this.artifactItemStore);
27
29
  this.logger.logProgress();
28
30
  sourceProvider.artifactItemStore = this.artifactItemStore;
@@ -60,13 +62,18 @@ class ArtifactEngine {
60
62
  }
61
63
  processArtifactItemImplementation(sourceProvider, item, destProvider, artifactEngineOptions, resolve, reject, retryCount) {
62
64
  var retryIfRequired = (err) => {
65
+ if (err && err.nonRetryable) {
66
+ this.artifactItemStore.updateState(item, models.TicketState.Failed);
67
+ reject(err);
68
+ return;
69
+ }
63
70
  if (retryCount === artifactEngineOptions.retryLimit - 1) {
64
71
  this.artifactItemStore.updateState(item, models.TicketState.Failed);
65
72
  reject(err);
66
73
  }
67
74
  else {
68
75
  this.artifactItemStore.increaseRetryCount(item);
69
- logger_1.Logger.logMessage(tl.loc("RetryingDownload", item.path, (retryCount + 1)));
76
+ logger_1.Logger.messageExternalOutput(tl.loc("RetryingDownload", item.path, (retryCount + 1)));
70
77
  // retry interval sequence 5s 15s 45s 135s
71
78
  // 2 min is the time limit for freeing of ports
72
79
  setTimeout(() => this
@@ -90,24 +97,24 @@ class ArtifactEngine {
90
97
  flipNegate: false
91
98
  };
92
99
  if (tl.match([pathToMatch], this.patternList, null, matchOptions).length > 0) {
93
- logger_1.Logger.logInfo("Processing " + item.path);
100
+ logger_1.Logger.infoExternalOutput("Processing " + item.path);
94
101
  sourceProvider.getArtifactItem(item).then((contentStream) => {
95
- logger_1.Logger.logInfo("Got download stream for item: " + item.path);
102
+ logger_1.Logger.infoExternalOutput("Got download stream for item: " + item.path);
96
103
  destProvider.putArtifactItem(item, contentStream)
97
104
  .then((item) => {
98
105
  this.artifactItemStore.updateState(item, models.TicketState.Processed);
99
106
  resolve();
100
107
  }, (err) => {
101
- logger_1.Logger.logInfo("Error placing file " + item.path + ": " + err);
108
+ logger_1.Logger.infoExternalOutput("Error placing file " + item.path + ": " + err);
102
109
  retryIfRequired(err);
103
110
  });
104
111
  }, (err) => {
105
- logger_1.Logger.logInfo("Error getting file " + item.path + ": " + err);
112
+ logger_1.Logger.infoExternalOutput("Error getting file " + item.path + ": " + err);
106
113
  retryIfRequired(err);
107
114
  });
108
115
  }
109
116
  else {
110
- logger_1.Logger.logMessage(tl.loc("SkippingItem", pathToMatch));
117
+ logger_1.Logger.messageExternalOutput(tl.loc("SkippingItem", pathToMatch));
111
118
  this.artifactItemStore.updateState(item, models.TicketState.Skipped);
112
119
  resolve();
113
120
  }
@@ -130,14 +137,14 @@ class ArtifactEngine {
130
137
  this.artifactItemStore.updateState(item, models.TicketState.Processed);
131
138
  resolve();
132
139
  }, (err) => {
133
- logger_1.Logger.logInfo("Error creating folder " + item.path + ": " + err);
140
+ logger_1.Logger.infoExternalOutput("Error creating folder " + item.path + ": " + err);
134
141
  retryIfRequired(err);
135
142
  });
136
143
  }
137
144
  logger_1.Logger.logInfo("Enqueued " + items.length + " for processing.");
138
145
  resolve();
139
146
  }, (err) => {
140
- logger_1.Logger.logInfo("Error getting " + item.path + ":" + err);
147
+ logger_1.Logger.infoExternalOutput("Error getting " + item.path + ":" + err);
141
148
  retryIfRequired(err);
142
149
  });
143
150
  }
@@ -178,11 +185,11 @@ exports.ArtifactEngine = ArtifactEngine;
178
185
  tl.setResourcePath(path.join(path.dirname(__dirname), 'lib.json'));
179
186
  process.on('unhandledRejection', (err) => {
180
187
  ci.publishEvent('reliability', { issueType: 'unhandledRejection', errorMessage: JSON.stringify(err, Object.getOwnPropertyNames(err)) });
181
- logger_1.Logger.logError(tl.loc("UnhandledRejection", err));
188
+ logger_1.Logger.errorExternalOutput(tl.loc("UnhandledRejection", err));
182
189
  throw err;
183
190
  });
184
191
  process.on('uncaughtException', (err) => {
185
192
  ci.publishEvent('reliability', { issueType: 'uncaughtException', errorMessage: JSON.stringify(err, Object.getOwnPropertyNames(err)) });
186
- logger_1.Logger.logError(tl.loc("UnhandledException", err));
193
+ logger_1.Logger.errorExternalOutput(tl.loc("UnhandledException", err));
187
194
  throw err;
188
195
  });
@@ -1,3 +1,4 @@
1
+ import type { VsoCommandMode } from 'azure-pipelines-task-lib/externaloutput';
1
2
  export declare class ArtifactEngineOptions {
2
3
  retryLimit: number;
3
4
  retryIntervalInSeconds: number;
@@ -5,4 +6,5 @@ export declare class ArtifactEngineOptions {
5
6
  parallelProcessingLimit: number;
6
7
  itemPattern: string;
7
8
  verbose: boolean;
9
+ vsoCommandMode?: VsoCommandMode;
8
10
  }
@@ -9,6 +9,7 @@ class ArtifactEngineOptions {
9
9
  this.parallelProcessingLimit = 4;
10
10
  this.itemPattern = '**';
11
11
  this.verbose = false;
12
+ this.vsoCommandMode = 'disabled';
12
13
  }
13
14
  }
14
15
  exports.ArtifactEngineOptions = ArtifactEngineOptions;
@@ -1,13 +1,21 @@
1
+ import type { VsoCommandMode } from 'azure-pipelines-task-lib/externaloutput';
1
2
  import { ArtifactItemStore } from '../Store/artifactItemStore';
2
3
  export declare class Logger {
3
4
  constructor(store: ArtifactItemStore);
4
5
  static logInfo(message: string): void;
5
6
  static logError(message: string): void;
6
7
  static logMessage(message: string): void;
8
+ /** Logs external text while preserving debug output semantics. */
9
+ static infoExternalOutput(message: string): void;
10
+ /** Logs external text while preserving error output semantics. */
11
+ static errorExternalOutput(message: string): void;
12
+ /** Logs external text rather than trusted internal messages or agent commands. */
13
+ static messageExternalOutput(message: string): void;
7
14
  logProgress(): void;
8
15
  logSummary(): void;
9
16
  private padText;
10
17
  static verbose: boolean;
18
+ static vsoCommandMode: VsoCommandMode;
11
19
  private store;
12
20
  private startTime;
13
21
  }
package/Engine/logger.js CHANGED
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Logger = void 0;
13
+ const tl = require("azure-pipelines-task-lib/task");
13
14
  const Models_1 = require("../Models");
14
15
  const ticketState_1 = require("../Models/ticketState");
15
- var tl = require('azure-pipelines-task-lib');
16
16
  const ci = require("./cilogger");
17
+ const externalOutputFeature = 'EnableArtifactEngineExternalOutput';
17
18
  class Logger {
18
19
  constructor(store) {
19
20
  this.store = store;
@@ -28,6 +29,33 @@ class Logger {
28
29
  static logMessage(message) {
29
30
  console.log(message);
30
31
  }
32
+ /** Logs external text while preserving debug output semantics. */
33
+ static infoExternalOutput(message) {
34
+ if (tl.getPipelineFeature(externalOutputFeature)) {
35
+ tl.debugExternalOutput(message, { source: 'remote', vsoCommandMode: Logger.vsoCommandMode });
36
+ }
37
+ else {
38
+ Logger.logInfo(message);
39
+ }
40
+ }
41
+ /** Logs external text while preserving error output semantics. */
42
+ static errorExternalOutput(message) {
43
+ if (tl.getPipelineFeature(externalOutputFeature)) {
44
+ tl.errorExternalOutput(message, { source: 'remote', vsoCommandMode: Logger.vsoCommandMode });
45
+ }
46
+ else {
47
+ Logger.logError(message);
48
+ }
49
+ }
50
+ /** Logs external text rather than trusted internal messages or agent commands. */
51
+ static messageExternalOutput(message) {
52
+ if (tl.getPipelineFeature(externalOutputFeature)) {
53
+ tl.writeExternalOutput(message + '\n', { source: 'remote', vsoCommandMode: Logger.vsoCommandMode });
54
+ }
55
+ else {
56
+ Logger.logMessage(message);
57
+ }
58
+ }
31
59
  logProgress() {
32
60
  if (Logger.verbose) {
33
61
  var progressLogger = () => __awaiter(this, void 0, void 0, function* () {
@@ -96,7 +124,7 @@ class Logger {
96
124
  tl.debug(this.padText("", maxPathLength + 25 + 25 + 10 + 10 + 15, '-'));
97
125
  fileTickets.forEach(ticket => {
98
126
  var duration = (ticket.finishTime.valueOf() - ticket.startTime.valueOf()) / 1000 + " secs";
99
- tl.debug("| " + this.padText(ticket.artifactItem.path, maxPathLength) + " | " + this.padText(ticket.startTime.toISOString(), 25) + " | " + this.padText(ticket.finishTime.toISOString(), 25) + " | " + this.padText(duration, 10) + " | " + this.padText(ticket.state.toString().toUpperCase(), 10) + "|");
127
+ Logger.infoExternalOutput("| " + this.padText(ticket.artifactItem.path, maxPathLength) + " | " + this.padText(ticket.startTime.toISOString(), 25) + " | " + this.padText(ticket.finishTime.toISOString(), 25) + " | " + this.padText(duration, 10) + " | " + this.padText(ticket.state.toString().toUpperCase(), 10) + "|");
100
128
  tl.debug(this.padText("", maxPathLength + 25 + 25 + 10 + 10 + 15, '-'));
101
129
  });
102
130
  }
@@ -109,3 +137,4 @@ class Logger {
109
137
  }
110
138
  }
111
139
  exports.Logger = Logger;
140
+ Logger.vsoCommandMode = 'disabled';
@@ -8,6 +8,11 @@ export declare class FilesystemProvider implements models.IArtifactProvider {
8
8
  getArtifactItems(artifactItem: models.ArtifactItem): Promise<models.ArtifactItem[]>;
9
9
  getArtifactItem(artifactItem: models.ArtifactItem): Promise<NodeJS.ReadableStream>;
10
10
  putArtifactItem(item: models.ArtifactItem, stream: NodeJS.ReadableStream): Promise<models.ArtifactItem>;
11
+ private putArtifactItemLegacy;
12
+ private putArtifactItemSecure;
13
+ private getWriteOpenFlags;
14
+ private createSecurityRejection;
15
+ private resolveSafeOutputPath;
11
16
  isCaseInsensitiveFilesystem(): boolean;
12
17
  dispose(): void;
13
18
  private getItems;
@@ -45,13 +45,20 @@ class FilesystemProvider {
45
45
  return promise;
46
46
  }
47
47
  putArtifactItem(item, stream) {
48
+ if (!tl.getPipelineFeature("EnableArtifactEnginePathValidation") || tl.getPipelineFeature("EnableLegacyArtifactPathValidation")) {
49
+ return this.putArtifactItemLegacy(item, stream);
50
+ }
51
+ return this.putArtifactItemSecure(item, stream);
52
+ }
53
+ // Unmodified pre-fix implementation. Runs verbatim whenever path validation is off, or
54
+ // EnableLegacyArtifactPathValidation is On, so rollback restores the exact legacy behavior.
55
+ putArtifactItemLegacy(item, stream) {
48
56
  return new Promise((resolve, reject) => {
49
57
  let outputItemPath;
50
58
  if (!tl.getPipelineFeature("EnableArtifactEnginePathValidation")) {
51
59
  outputItemPath = path.join(this._rootLocation, item.path);
52
60
  }
53
61
  else {
54
- // Feature on: reject item paths that resolve outside the download root.
55
62
  const resolvedRoot = path.resolve(this._rootLocation);
56
63
  const resolvedTarget = path.resolve(resolvedRoot, item.path);
57
64
  const relative = path.relative(resolvedRoot, resolvedTarget);
@@ -66,13 +73,62 @@ class FilesystemProvider {
66
73
  if (item.itemType === models.ItemType.File) {
67
74
  const folder = path.dirname(outputItemPath);
68
75
  try {
69
- // create parent folder if it has not already been created
70
76
  tl.mkdirP(folder);
71
- logger_1.Logger.logMessage(tl.loc("DownloadingTo", item.path, outputItemPath));
77
+ logger_1.Logger.messageExternalOutput(tl.loc("DownloadingTo", item.path, outputItemPath));
72
78
  const outputStream = fs.createWriteStream(outputItemPath);
73
79
  stream.pipe(outputStream);
74
80
  stream.on("end", () => {
75
- logger_1.Logger.logMessage(tl.loc("DownloadedTo", item.path, outputItemPath));
81
+ logger_1.Logger.messageExternalOutput(tl.loc("DownloadedTo", item.path, outputItemPath));
82
+ if (!item.metadata) {
83
+ item.metadata = {};
84
+ }
85
+ item.metadata[models.Constants.DestinationUrlKey] = outputItemPath;
86
+ });
87
+ stream.on("error", (error) => {
88
+ reject(error);
89
+ });
90
+ outputStream.on("finish", () => {
91
+ this.artifactItemStore.updateFileSize(item, outputStream.bytesWritten);
92
+ resolve(item);
93
+ });
94
+ }
95
+ catch (err) {
96
+ reject(err);
97
+ }
98
+ }
99
+ else {
100
+ try {
101
+ tl.mkdirP(outputItemPath);
102
+ resolve(item);
103
+ }
104
+ catch (err) {
105
+ reject(err);
106
+ }
107
+ }
108
+ });
109
+ }
110
+ // New hardened implementation. Runs only when path validation is on and the legacy
111
+ // rollback flag is off (the new default).
112
+ putArtifactItemSecure(item, stream) {
113
+ return new Promise((resolve, reject) => {
114
+ let outputItemPath;
115
+ try {
116
+ outputItemPath = this.resolveSafeOutputPath(item.path);
117
+ }
118
+ catch (err) {
119
+ reject(err);
120
+ return;
121
+ }
122
+ if (item.itemType === models.ItemType.File) {
123
+ const folder = path.dirname(outputItemPath);
124
+ try {
125
+ tl.mkdirP(folder);
126
+ logger_1.Logger.messageExternalOutput(tl.loc("DownloadingTo", item.path, outputItemPath));
127
+ const writeOptions = { flags: this.getWriteOpenFlags() };
128
+ const outputStream = fs.createWriteStream(outputItemPath, writeOptions);
129
+ stream.pipe(outputStream);
130
+ stream.on("end", () => {
131
+ logger_1.Logger.messageExternalOutput(tl.loc("DownloadedTo", item.path, outputItemPath));
76
132
  if (!item.metadata) {
77
133
  item.metadata = {};
78
134
  }
@@ -81,6 +137,9 @@ class FilesystemProvider {
81
137
  stream.on("error", (error) => {
82
138
  reject(error);
83
139
  });
140
+ outputStream.on("error", (error) => {
141
+ reject(error);
142
+ });
84
143
  outputStream.on("finish", () => {
85
144
  this.artifactItemStore.updateFileSize(item, outputStream.bytesWritten);
86
145
  resolve(item);
@@ -101,6 +160,86 @@ class FilesystemProvider {
101
160
  }
102
161
  });
103
162
  }
163
+ getWriteOpenFlags() {
164
+ let flags = fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_TRUNC;
165
+ if (typeof fs.constants.O_NOFOLLOW === 'number') {
166
+ flags |= fs.constants.O_NOFOLLOW;
167
+ }
168
+ return flags;
169
+ }
170
+ createSecurityRejection(messageKey, itemPath) {
171
+ const err = new Error(tl.loc(messageKey, itemPath));
172
+ err.nonRetryable = true;
173
+ return err;
174
+ }
175
+ resolveSafeOutputPath(itemPath) {
176
+ const resolvedRoot = path.resolve(this._rootLocation);
177
+ const resolvedTarget = path.resolve(resolvedRoot, itemPath);
178
+ const relative = path.relative(resolvedRoot, resolvedTarget);
179
+ if (relative === '..'
180
+ || relative.startsWith('..' + path.sep)
181
+ || path.isAbsolute(relative)) {
182
+ throw this.createSecurityRejection("InvalidArtifactPath", itemPath);
183
+ }
184
+ tl.mkdirP(resolvedRoot);
185
+ let realRoot;
186
+ try {
187
+ realRoot = fs.realpathSync(resolvedRoot);
188
+ }
189
+ catch (err) {
190
+ // Root does not exist yet (e.g. mkdirP was a no-op, or creation is deferred until
191
+ // the first write). Nothing can be a pre-existing symlink at a path that doesn't
192
+ // exist, so fall back to the lexically resolved root.
193
+ realRoot = resolvedRoot;
194
+ }
195
+ const segments = relative.split(path.sep);
196
+ let current = realRoot;
197
+ for (let i = 0; i < segments.length - 1; i++) {
198
+ current = path.join(current, segments[i]);
199
+ let stat;
200
+ try {
201
+ stat = fs.lstatSync(current);
202
+ }
203
+ catch (err) {
204
+ break;
205
+ }
206
+ if (stat.isSymbolicLink()) {
207
+ let real;
208
+ try {
209
+ real = fs.realpathSync(current);
210
+ }
211
+ catch (err) {
212
+ throw this.createSecurityRejection("InvalidArtifactPath", itemPath);
213
+ }
214
+ const relToRoot = path.relative(realRoot, real);
215
+ if (relToRoot === '..'
216
+ || relToRoot.startsWith('..' + path.sep)
217
+ || path.isAbsolute(relToRoot)) {
218
+ throw this.createSecurityRejection("InvalidArtifactPath", itemPath);
219
+ }
220
+ current = real;
221
+ }
222
+ }
223
+ const finalPath = path.join(current, segments[segments.length - 1]);
224
+ try {
225
+ const finalStat = fs.lstatSync(finalPath);
226
+ if (finalStat.isSymbolicLink()) {
227
+ throw this.createSecurityRejection("ArtifactPathIsSymlink", itemPath);
228
+ }
229
+ if (!finalStat.isFile() && !finalStat.isDirectory()) {
230
+ throw this.createSecurityRejection("ArtifactPathIsSpecialFile", itemPath);
231
+ }
232
+ if (finalStat.isFile() && finalStat.nlink > 1) {
233
+ throw this.createSecurityRejection("ArtifactPathIsHardLinked", itemPath);
234
+ }
235
+ }
236
+ catch (err) {
237
+ if (err && err.nonRetryable) {
238
+ throw err;
239
+ }
240
+ }
241
+ return finalPath;
242
+ }
104
243
  isCaseInsensitiveFilesystem() {
105
244
  if (!this._hasDeterminedFilesystemCaseSensitivity) {
106
245
  try {
@@ -120,7 +259,7 @@ class FilesystemProvider {
120
259
  var items = [];
121
260
  fs.readdir(itemsPath, (error, files) => {
122
261
  if (!!error) {
123
- logger_1.Logger.logMessage(tl.loc("UnableToReadDirectory", itemsPath, error));
262
+ logger_1.Logger.messageExternalOutput(tl.loc("UnableToReadDirectory", itemsPath, error));
124
263
  reject(error);
125
264
  return;
126
265
  }
@@ -56,7 +56,7 @@ class WebProvider {
56
56
  res.message.on('error', (error) => {
57
57
  if (zipStream) {
58
58
  zipStream.destroy(error);
59
- logger_1.Logger.logMessage(error.toString());
59
+ logger_1.Logger.messageExternalOutput(error.toString());
60
60
  }
61
61
  reject(error);
62
62
  });
@@ -91,7 +91,7 @@ class WebProvider {
91
91
  res.readBody().then((body) => {
92
92
  fs.readFile(this.getTemplateFilePath(), 'utf8', (err, templateFileContent) => {
93
93
  if (err) {
94
- logger_1.Logger.logMessage(err ? JSON.stringify(err) : "");
94
+ logger_1.Logger.messageExternalOutput(err ? JSON.stringify(err) : "");
95
95
  reject(err);
96
96
  return;
97
97
  }
@@ -108,7 +108,7 @@ class WebProvider {
108
108
  resolve(items);
109
109
  }
110
110
  catch (error) {
111
- logger_1.Logger.logMessage(tl.loc("FailedToParseResponse", body, error));
111
+ logger_1.Logger.messageExternalOutput(tl.loc("FailedToParseResponse", body, error));
112
112
  reject(error);
113
113
  }
114
114
  });
package/README.md CHANGED
@@ -11,6 +11,56 @@ To use Artifact engine in your tasks or app have a look at [E2E.ts](E2ETests/jen
11
11
  ## Usage
12
12
  ![Daily downloads using artifact engine](https://github.com/Microsoft/azure-pipelines-extensions/blob/master/Extensions/ArtifactEngine/usage.png)
13
13
 
14
+ ### External-output logging
15
+
16
+ `ArtifactEngineOptions.vsoCommandMode` controls handling of agent logging-command
17
+ markers in external log messages. The pipeline feature
18
+ `EnableArtifactEngineExternalOutput` must also be enabled (the task receives
19
+ `DISTRIBUTEDTASK_TASKS_ENABLEARTIFACTENGINEEXTERNALOUTPUT=true`).
20
+
21
+ ```ts
22
+ const options = new ArtifactEngineOptions();
23
+ options.vsoCommandMode = 'blockAndTelemetry';
24
+ await engine.processItems(sourceProvider, destinationProvider, options);
25
+ ```
26
+
27
+ | Mode | External-output behavior when the feature is enabled |
28
+ | --- | --- |
29
+ | `disabled` (default) | Neither block commands nor report command telemetry. |
30
+ | `telemetryOnly` | Report commands without blocking them. |
31
+ | `blockOnly` | Block commands without command telemetry. |
32
+ | `blockAndTelemetry` | Block commands and report command telemetry. |
33
+
34
+ The feature is off when absent. With the feature off, external messages use the
35
+ original logging behavior regardless of the mode. Enabling the feature alone is
36
+ not a mitigation: the caller must explicitly select a blocking mode.
37
+ `telemetryOnly` is observation, not protection.
38
+
39
+ For library contributors, use `Logger.infoExternalOutput`,
40
+ `Logger.errorExternalOutput`, and `Logger.messageExternalOutput` for external
41
+ or mixed-origin messages, including artifact paths, metadata,
42
+ response bodies, and error text. These methods use task-lib's external-output
43
+ helpers, preserving debug, error, and ordinary output respectively:
44
+
45
+ ```ts
46
+ Logger.messageExternalOutput(tl.loc('DownloadingTo', item.path, outputItemPath));
47
+ ```
48
+
49
+ Keep `Logger.logInfo`, `Logger.logError`, and `Logger.logMessage` for trusted
50
+ internal messages. A trusted format string does not make interpolated external
51
+ values trusted. Only the logged text is filtered; artifact data and paths are
52
+ not modified. The verbose summary's artifact-path row uses the external API;
53
+ internal counts, progress, headings, and intentional telemetry commands do not.
54
+
55
+ The logging mode is process-wide static Logger state, like `verbose`.
56
+ Each `processItems` invocation resets it, including when options are omitted.
57
+ Concurrent engine runs with different modes are not isolated.
58
+
59
+ Consuming tasks must update their bundled library and explicitly pass a mode.
60
+ Server-side feature registration/propagation and package/task rollout are
61
+ separate from this library change. Existing task-level output filtering should
62
+ not be removed as part of adopting this API.
63
+
14
64
  ## Architecture
15
65
  ![Architecture](https://github.com/Microsoft/azure-pipelines-extensions/blob/master/Extensions/ArtifactEngine/sequence.svg)
16
66
 
@@ -3,7 +3,10 @@
3
3
  "loc.messages.FailedToParseResponse": "Fehler beim Analysieren des Antworttexts: %s. Erhaltener Fehler: %s",
4
4
  "loc.messages.DownloadingTo": "Download von \"%s\" nach \"%s\" wird durchgeführt.",
5
5
  "loc.messages.DownloadedTo": "Download von \"%s\" nach \"%s\" wurde durchgeführt.",
6
- "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
6
+ "loc.messages.InvalidArtifactPath": "Der Artifactpfad \"%s\" liegt außerhalb des Downloadverzeichnisses.",
7
+ "loc.messages.ArtifactPathIsSymlink": "Der Artifactpfad \"%s\" ist bereits ein symbolischer Link und wurde abgelehnt.",
8
+ "loc.messages.ArtifactPathIsHardLinked": "Der Artifactpfad \"%s\" ist bereits eine Datei mit einem Hardlink und wurde abgelehnt.",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "Der Artifactpfad \"%s\" ist bereits eine Datei, die kein regulärer Dateityp ist (z. B. ein Gerät, eine Pipe oder ein Socket), und wurde abgelehnt.",
7
10
  "loc.messages.UnableToReadDirectory": "Das Verzeichnis \"%s\" kann nicht gelesen werden. Fehler: %s",
8
11
  "loc.messages.RetryingDownload": "Download von \"%s\" wird erneut versucht, Wiederholungsanzahl: %s",
9
12
  "loc.messages.SkippingItem": "Die Verarbeitung des Elements \"%s\" wird übersprungen.",
@@ -4,6 +4,9 @@
4
4
  "loc.messages.DownloadingTo": "Downloading %s to %s",
5
5
  "loc.messages.DownloadedTo": "Downloaded %s to %s",
6
6
  "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
7
+ "loc.messages.ArtifactPathIsSymlink": "Artifact path %s already exists as a symbolic link and was rejected.",
8
+ "loc.messages.ArtifactPathIsHardLinked": "Artifact path %s already exists as a hard-linked file and was rejected.",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "Artifact path %s already exists as a non-regular file (e.g. a device, pipe, or socket) and was rejected.",
7
10
  "loc.messages.UnableToReadDirectory": "Unable to read directory %s. Error: %s",
8
11
  "loc.messages.RetryingDownload": "Retrying download of %s, retry count: %s",
9
12
  "loc.messages.SkippingItem": "Skipped processing item %s",
@@ -3,7 +3,10 @@
3
3
  "loc.messages.FailedToParseResponse": "No se pudo analizar el cuerpo de la respuesta: %s. Error: %s",
4
4
  "loc.messages.DownloadingTo": "Descargando %s en %s",
5
5
  "loc.messages.DownloadedTo": "%s descargado en %s",
6
- "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
6
+ "loc.messages.InvalidArtifactPath": "La ruta de acceso del artefacto %s se resuelve fuera del directorio de descarga.",
7
+ "loc.messages.ArtifactPathIsSymlink": "La ruta de acceso del artefacto %s ya existe como vínculo simbólico y se rechazó.",
8
+ "loc.messages.ArtifactPathIsHardLinked": "La ruta de acceso del artefacto %s ya existe como archivo con vínculo físico y se rechazó.",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "La ruta de acceso del artefacto %s ya existe como archivo no habitual (por ejemplo, un dispositivo, una canalización o un socket) y se rechazó.",
7
10
  "loc.messages.UnableToReadDirectory": "No se puede leer el directorio %s. Error: %s",
8
11
  "loc.messages.RetryingDownload": "Reintentando la descarga de %s, número de reintentos: %s",
9
12
  "loc.messages.SkippingItem": "Procesamiento de %s omitido",
@@ -3,7 +3,10 @@
3
3
  "loc.messages.FailedToParseResponse": "Échec d’analyse du corps de la réponse : %s, erreur : %s",
4
4
  "loc.messages.DownloadingTo": "Téléchargement de %s à %s",
5
5
  "loc.messages.DownloadedTo": "Téléchargé de %s à %s",
6
- "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
6
+ "loc.messages.InvalidArtifactPath": "Le chemin d’accès de l’artefact %s se résout en dehors du répertoire de téléchargement.",
7
+ "loc.messages.ArtifactPathIsSymlink": "Le chemin d’accès de l’artefact %s existe déjà en tant que lien symbolique et a été rejeté.",
8
+ "loc.messages.ArtifactPathIsHardLinked": "Le chemin d’accès de l’artefact %s existe déjà en tant que fichier à liens physiques et a été rejeté.",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "Le chemin d’accès de l’artefact %s existe déjà en tant que fichier non standard (par exemple, un périphérique, un tube ou un socket) et a été rejeté.",
7
10
  "loc.messages.UnableToReadDirectory": "Impossible de lire le répertoire %s. Erreur : %s",
8
11
  "loc.messages.RetryingDownload": "Nouvelle tentative de téléchargement de %s, nombre de tentatives : %s",
9
12
  "loc.messages.SkippingItem": "Traitement de l’élément ignoré %s",
@@ -3,7 +3,10 @@
3
3
  "loc.messages.FailedToParseResponse": "Non è stato possibile analizzare il corpo della risposta: %s. Errore restituito: %s",
4
4
  "loc.messages.DownloadingTo": "Download di %s in %s",
5
5
  "loc.messages.DownloadedTo": "%s scaricato in %s",
6
- "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
6
+ "loc.messages.InvalidArtifactPath": "Il percorso dell'artifact %s viene risolto all'esterno della directory di download.",
7
+ "loc.messages.ArtifactPathIsSymlink": "Il percorso dell'artifact %s esiste già come collegamento simbolico ed è stato rifiutato.",
8
+ "loc.messages.ArtifactPathIsHardLinked": "Il percorso dell'artifact %s esiste già come file con collegamento fisico ed è stato rifiutato.",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "Il percorso dell'artifact %s esiste già come file non normale (ad esempio un dispositivo, una pipe o un socket) ed è stato rifiutato.",
7
10
  "loc.messages.UnableToReadDirectory": "Non è possibile leggere la directory %s. Errore: %s",
8
11
  "loc.messages.RetryingDownload": "Nuovo tentativo di download di %s. Conteggio dei tentativi: %s",
9
12
  "loc.messages.SkippingItem": "Elaborazione dell'elemento %s ignorata",
@@ -3,7 +3,10 @@
3
3
  "loc.messages.FailedToParseResponse": "応答本文を解析できませんでした: %s、エラー発生: %s",
4
4
  "loc.messages.DownloadingTo": "%s を %s へダウンロード中",
5
5
  "loc.messages.DownloadedTo": "%s を %s へダウンロード済み",
6
- "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
6
+ "loc.messages.InvalidArtifactPath": "アーティファクト パス %s はダウンロード ディレクトリの外部に解決されます。",
7
+ "loc.messages.ArtifactPathIsSymlink": "アーティファクト パス %s は既にシンボリック リンクとして存在するため、拒否されました。",
8
+ "loc.messages.ArtifactPathIsHardLinked": "アーティファクト パス %s は既にハード リンクされたファイルとして存在するため、拒否されました。",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "アーティファクト パス %s は既に特殊ファイル (デバイス、パイプ、ソケットなど) として存在するため、拒否されました。",
7
10
  "loc.messages.UnableToReadDirectory": "ディレクトリ %s を読み取ることができません。エラー: %s",
8
11
  "loc.messages.RetryingDownload": "%s のダウンロードを再試行しています。再試行回数: %s",
9
12
  "loc.messages.SkippingItem": "項目 %s の処理をスキップしました",
@@ -3,7 +3,10 @@
3
3
  "loc.messages.FailedToParseResponse": "응답 본문 %s을(를) 구문 분석하지 못했습니다. 오류: %s",
4
4
  "loc.messages.DownloadingTo": "%s을(를) %s에 다운로드하는 중",
5
5
  "loc.messages.DownloadedTo": "%s을(를) %s에 다운로드함",
6
- "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
6
+ "loc.messages.InvalidArtifactPath": "아티팩트 경로 %s이(가) 다운로드 디렉터리 외부로 확인됩니다.",
7
+ "loc.messages.ArtifactPathIsSymlink": "아티팩트 경로 %s이(가) 이미 심볼릭 링크로 존재하여 거부되었습니다.",
8
+ "loc.messages.ArtifactPathIsHardLinked": "아티팩트 경로 %s이(가) 이미 하드 링크된 파일로 존재하여 거부되었습니다.",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "아티팩트 경로 %s이(가) 이미 일반 파일이 아닌 파일(예: 장치, 파이프 또는 소켓)로 존재하여 거부되었습니다.",
7
10
  "loc.messages.UnableToReadDirectory": "디렉터리 %s을(를) 읽을 수 없습니다. 오류: %s",
8
11
  "loc.messages.RetryingDownload": "%s 다운로드를 다시 시도하는 중, 다시 시도 횟수: %s회",
9
12
  "loc.messages.SkippingItem": "항목 %s의 처리를 건너뜀",
@@ -3,7 +3,10 @@
3
3
  "loc.messages.FailedToParseResponse": "Не удалось проанализировать текст ответа: %s. Ошибка: %s",
4
4
  "loc.messages.DownloadingTo": "Идет скачивание %s в %s",
5
5
  "loc.messages.DownloadedTo": "Скачано %s в %s",
6
- "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
6
+ "loc.messages.InvalidArtifactPath": "Путь к артефакту %s указывает за пределы каталога скачивания.",
7
+ "loc.messages.ArtifactPathIsSymlink": "Путь к артефакту %s уже существует как символическая ссылка и был отклонен.",
8
+ "loc.messages.ArtifactPathIsHardLinked": "Путь к артефакту %s уже существует как файл с жесткой ссылкой и был отклонен.",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "Путь к артефакту %s уже существует как нестандартный файл (например, устройство, канал или сокет) и был отклонен.",
7
10
  "loc.messages.UnableToReadDirectory": "Не удается считать каталог %s. Ошибка: %s",
8
11
  "loc.messages.RetryingDownload": "Повторная попытка скачать %s, всего попыток: %s",
9
12
  "loc.messages.SkippingItem": "Пропущена обработка элемента %s",
@@ -3,7 +3,10 @@
3
3
  "loc.messages.FailedToParseResponse": "未能分析响应正文: %s,显示错误: %s",
4
4
  "loc.messages.DownloadingTo": "正在将 %s 下载至 %s",
5
5
  "loc.messages.DownloadedTo": "已将 %s 下载至 %s",
6
- "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
6
+ "loc.messages.InvalidArtifactPath": "项目路径 %s 解析到下载目录之外。",
7
+ "loc.messages.ArtifactPathIsSymlink": "项目路径 %s 已作为符号链接存在,已被拒绝。",
8
+ "loc.messages.ArtifactPathIsHardLinked": "项目路径 %s 已作为硬链接文件存在,已被拒绝。",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "项目路径 %s 已作为非常规文件(例如设备、管道或套接字)存在,已被拒绝。",
7
10
  "loc.messages.UnableToReadDirectory": "未能读取目录 %s。错误: %s",
8
11
  "loc.messages.RetryingDownload": "重新尝试下载 %s,重试计数: %s",
9
12
  "loc.messages.SkippingItem": "已跳过处理项目 %s",
@@ -3,7 +3,10 @@
3
3
  "loc.messages.FailedToParseResponse": "無法剖析回應主體: %s,收到錯誤: %s",
4
4
  "loc.messages.DownloadingTo": "正在將 %s 下載到 %s",
5
5
  "loc.messages.DownloadedTo": "已將 %s 下載到 %s",
6
- "loc.messages.InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
6
+ "loc.messages.InvalidArtifactPath": "成品路徑 %s 解析到下載目錄外部。",
7
+ "loc.messages.ArtifactPathIsSymlink": "成品路徑 %s 已作為符號連結存在,已遭拒絕。",
8
+ "loc.messages.ArtifactPathIsHardLinked": "成品路徑 %s 已作為硬連結檔案存在,已遭拒絕。",
9
+ "loc.messages.ArtifactPathIsSpecialFile": "成品路徑 %s 已作為非一般檔案 (例如裝置、管道或通訊端) 存在,已遭拒絕。",
7
10
  "loc.messages.UnableToReadDirectory": "無法讀取目錄 %s。錯誤: %s",
8
11
  "loc.messages.RetryingDownload": "正在重試下載 %s,重試次數: %s",
9
12
  "loc.messages.SkippingItem": "已跳過處理項目 %s",
package/lib.json CHANGED
@@ -5,6 +5,9 @@
5
5
  "DownloadingTo": "Downloading %s to %s",
6
6
  "DownloadedTo": "Downloaded %s to %s",
7
7
  "InvalidArtifactPath": "Artifact path %s resolves outside the download directory.",
8
+ "ArtifactPathIsSymlink": "Artifact path %s already exists as a symbolic link and was rejected.",
9
+ "ArtifactPathIsHardLinked": "Artifact path %s already exists as a hard-linked file and was rejected.",
10
+ "ArtifactPathIsSpecialFile": "Artifact path %s already exists as a non-regular file (e.g. a device, pipe, or socket) and was rejected.",
8
11
  "UnableToReadDirectory": "Unable to read directory %s. Error: %s",
9
12
  "RetryingDownload": "Retrying download of %s, retry count: %s",
10
13
  "SkippingItem": "Skipped processing item %s",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artifact-engine",
3
- "version": "1.280.0",
3
+ "version": "1.283.1",
4
4
  "description": "Artifact Engine to download artifacts from jenkins, teamcity, vsts",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,8 +16,8 @@
16
16
  "email": "omeshp@microsoft.com"
17
17
  },
18
18
  "dependencies": {
19
- "azure-pipelines-task-lib": "^5.278.0",
20
- "handlebars": "4.7.9",
19
+ "azure-pipelines-task-lib": "^5.281.2",
20
+ "handlebars": "4.7.10",
21
21
  "minimatch": "3.1.5",
22
22
  "tunnel": "0.0.4"
23
23
  },
@@ -37,7 +37,7 @@
37
37
  "nock": "^14.0.6",
38
38
  "nyc": "^15.0.0",
39
39
  "sinon": "4.0.1",
40
- "typescript": "4.0.2",
40
+ "typescript": "4.9.5",
41
41
  "xml2js": "^0.6.2"
42
42
  },
43
43
  "files": [