@daghis/teamcity-mcp 1.9.1 → 1.9.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.2](https://github.com/Daghis/teamcity-mcp/compare/v1.9.1...v1.9.2) (2025-09-21)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **teamcity:** restore artifact rules update compatibility ([#185](https://github.com/Daghis/teamcity-mcp/issues/185)) ([1d67268](https://github.com/Daghis/teamcity-mcp/commit/1d67268e6ee837db38ab9be27a94a5f3e072ab83))
9
+
3
10
  ## [1.9.1](https://github.com/Daghis/teamcity-mcp/compare/v1.9.0...v1.9.1) (2025-09-20)
4
11
 
5
12
 
package/dist/index.js CHANGED
@@ -1346,6 +1346,38 @@ var ArtifactManager = class _ArtifactManager {
1346
1346
  };
1347
1347
 
1348
1348
  // src/teamcity/build-configuration-update-manager.ts
1349
+ var ARTIFACT_RULES_SETTINGS_FIELD = "settings/artifactRules";
1350
+ var ARTIFACT_RULES_LEGACY_FIELD = "artifactRules";
1351
+ var isArtifactRulesRetryableError = (error2) => {
1352
+ if (error2 == null || typeof error2 !== "object") return false;
1353
+ if (!("response" in error2)) return false;
1354
+ const response = error2.response;
1355
+ const status = response?.status;
1356
+ return status === 400 || status === 404;
1357
+ };
1358
+ var setArtifactRulesWithFallback = async (api, buildTypeId, artifactRules) => {
1359
+ try {
1360
+ await api.setBuildTypeField(buildTypeId, ARTIFACT_RULES_SETTINGS_FIELD, artifactRules);
1361
+ } catch (err) {
1362
+ if (!isArtifactRulesRetryableError(err)) {
1363
+ throw err;
1364
+ }
1365
+ const status = err.response?.status;
1366
+ debug("Retrying artifact rules update via legacy field", {
1367
+ buildTypeId,
1368
+ status
1369
+ });
1370
+ try {
1371
+ await api.setBuildTypeField(buildTypeId, ARTIFACT_RULES_LEGACY_FIELD, artifactRules);
1372
+ } catch (fallbackError) {
1373
+ debug("Legacy artifact rules update failed", {
1374
+ buildTypeId,
1375
+ status: fallbackError.response?.status
1376
+ });
1377
+ throw fallbackError;
1378
+ }
1379
+ }
1380
+ };
1349
1381
  var BuildConfigurationUpdateManager = class {
1350
1382
  client;
1351
1383
  constructor(client) {
@@ -1555,6 +1587,14 @@ var BuildConfigurationUpdateManager = class {
1555
1587
  }
1556
1588
  if (settings.length > 0) {
1557
1589
  for (const setting of settings) {
1590
+ if (setting.name === "artifactRules") {
1591
+ await setArtifactRulesWithFallback(
1592
+ this.client.modules.buildTypes,
1593
+ currentConfig.id,
1594
+ setting.value
1595
+ );
1596
+ continue;
1597
+ }
1558
1598
  await this.client.modules.buildTypes.setBuildTypeField(
1559
1599
  currentConfig.id,
1560
1600
  `settings/${setting.name}`,
@@ -40100,9 +40140,9 @@ var FULL_MODE_TOOLS = [
40100
40140
  );
40101
40141
  }
40102
40142
  if (typedArgs.artifactRules !== void 0) {
40103
- await adapter.modules.buildTypes.setBuildTypeField(
40143
+ await setArtifactRulesWithFallback(
40144
+ adapter.modules.buildTypes,
40104
40145
  typedArgs.buildTypeId,
40105
- "settings/artifactRules",
40106
40146
  typedArgs.artifactRules
40107
40147
  );
40108
40148
  }
@@ -40123,9 +40163,9 @@ var FULL_MODE_TOOLS = [
40123
40163
  );
40124
40164
  }
40125
40165
  if (typedArgs.artifactRules !== void 0) {
40126
- await adapter.modules.buildTypes.setBuildTypeField(
40166
+ await setArtifactRulesWithFallback(
40167
+ adapter.modules.buildTypes,
40127
40168
  typedArgs.buildTypeId,
40128
- "settings/artifactRules",
40129
40169
  typedArgs.artifactRules
40130
40170
  );
40131
40171
  }