also looking at this
fix: read composer.json from the project path, and drop groups the strategy filter emptied
#1444
3 files
+13
-12
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -2187,15 +2187,16 @@ export class Buddy { | ||
| 2187 | 2187 | } |
| 2188 | 2188 | } |
| 2189 | 2189 | |
| 2190 | if (groupUpdates.length > 0) { | |
| 2191 | // Apply group-specific strategy if defined | |
| 2192 | let filteredUpdates = groupUpdates | |
| 2193 | if (groupConfig.strategy) { | |
| 2194 | filteredUpdates = this.filterUpdatesByStrategy(groupUpdates, groupConfig.strategy) | |
| 2195 | } | |
| 2190 | // Apply group-specific strategy if defined | |
| 2191 | let filteredUpdates = groupUpdates | |
| 2192 | if (groupConfig.strategy) { | |
| 2193 | filteredUpdates = this.filterUpdatesByStrategy(groupUpdates, groupConfig.strategy) | |
| 2194 | } | |
| 2196 | 2195 | |
| 2197 | // Note: Minimum release age filtering is already applied globally before grouping, | |
| 2198 | // so we don't need to apply it again here | |
| 2196 | // Note: minimum release age filtering is already applied globally before | |
| 2197 | // grouping. Push only when something survives the group's strategy filter — | |
| 2198 | // an empty group would otherwise reach the PR loop as a no-op entry. | |
| 2199 | if (filteredUpdates.length > 0) { | |
| 2199 | 2200 | |
| 2200 | 2201 | groups.push({ |
| 2201 | 2202 | name: groupConfig.name, |
| @@ -952,7 +952,7 @@ export class RegistryClient { | ||
| 952 | 952 | } |
| 953 | 953 | |
| 954 | 954 | // First, let's log what composer.json contains |
| 955 | const composerJsonPath = path.join(process.cwd(), 'composer.json') | |
| 955 | const composerJsonPath = path.join(this.projectPath, 'composer.json') | |
| 956 | 956 | this.logger.info(`🔍 Reading composer.json from: ${composerJsonPath}`) |
| 957 | 957 | |
| 958 | 958 | if (!fs.existsSync(composerJsonPath)) { |
| @@ -749,9 +749,9 @@ describe('buddy orchestration', () => { | ||
| 749 | 749 | expect(fooTypes?.updates.map((update: PackageUpdate) => update.name)).toEqual(['@types/bun-foo']) |
| 750 | 750 | |
| 751 | 751 | // '@types/node' is claimed by the Types group but its minor update is |
| 752 | // filtered out by the group's patch strategy. | |
| 753 | const types = groups.find((group: { name: string }) => group.name === 'Types') | |
| 754 | expect(types?.updates).toEqual([]) | |
| 752 | // filtered out by the group's patch strategy — and a group left empty | |
| 753 | // by its own strategy filter is not emitted at all. | |
| 754 | expect(groups.find((group: { name: string }) => group.name === 'Types')).toBeUndefined() | |
| 755 | 755 | |
| 756 | 756 | const nonMajor = groups.find((group: { name: string }) => group.name === 'Non-Major Updates') |
| 757 | 757 | expect(nonMajor?.updates.map((update: PackageUpdate) => update.name)).toEqual(['react']) |