@aspruyt/xfg 3.5.2 → 3.5.3

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.
@@ -1,5 +1,5 @@
1
1
  import { isGitHubRepo, getRepoDisplayName } from "./repo-detector.js";
2
- import { GitHubRulesetStrategy } from "./strategies/github-ruleset-strategy.js";
2
+ import { GitHubRulesetStrategy, } from "./strategies/github-ruleset-strategy.js";
3
3
  import { diffRulesets } from "./ruleset-diff.js";
4
4
  import { formatRulesetPlan, } from "./ruleset-plan-formatter.js";
5
5
  // =============================================================================
@@ -49,8 +49,21 @@ export class RulesetProcessor {
49
49
  const currentRulesets = await this.strategy.list(githubRepo, strategyOptions);
50
50
  // Convert desired rulesets to Map
51
51
  const desiredMap = new Map(Object.entries(desiredRulesets));
52
+ // Hydrate rulesets that match desired names with full details from get()
53
+ // The list endpoint only returns summary fields (id, name, target, enforcement)
54
+ // but not rules, conditions, or bypass_actors needed for accurate diffing
55
+ const fullRulesets = [];
56
+ for (const summary of currentRulesets) {
57
+ if (desiredMap.has(summary.name)) {
58
+ const full = await this.strategy.get(githubRepo, summary.id, strategyOptions);
59
+ fullRulesets.push(full);
60
+ }
61
+ else {
62
+ fullRulesets.push(summary);
63
+ }
64
+ }
52
65
  // Compute diff
53
- const changes = diffRulesets(currentRulesets, desiredMap, managedRulesets);
66
+ const changes = diffRulesets(fullRulesets, desiredMap, managedRulesets);
54
67
  // Count changes by type
55
68
  const changeCounts = {
56
69
  create: changes.filter((c) => c.action === "create").length,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aspruyt/xfg",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
4
4
  "description": "CLI tool for repository-as-code",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",