ReviewOS

also looking at this

stacks/buddy

test: cover the untested halves of the big integration files

#1443
Merged glennmichael123 wants to merge test/deep-integration-coverage into main
4 files +2344 -83
src/registry/registry-client.tsmodified+0-83
Changes to src/registry/registry-client.ts
@@ -931,21 +931,6 @@ export class RegistryClient {
931931 }
932932 }
933933
934 /**
935 * Extract major version number from a version string
936 */
937 private getMajorVersion(version: string): string {
938 return version.replace(/^[v^~>=<]+/, '').split('.')[0] || '0'
939 }
940
941 /**
942 * Extract minor version number from a version string
943 */
944 private getMinorVersion(version: string): string {
945 const parts = version.replace(/^[v^~>=<]+/, '').split('.')
946 return parts[1] || '0'
947 }
948
949934 /**
950935 * Get outdated Composer packages
951936 */
@@ -1112,74 +1097,6 @@ export class RegistryClient {
11121097 }
11131098 }
11141099
1115 /**
1116 * Find the best patch, minor, and major updates for a package
1117 */
1118 private async findBestUpdates(currentVersion: string, availableVersions: string[], _constraint: string): Promise<{ version: string, type: 'patch' | 'minor' | 'major' }[]> {
1119 const { getUpdateType } = await import('../utils/helpers')
1120 const candidates: { version: string, type: 'patch' | 'minor' | 'major' }[] = []
1121
1122 // Parse current version
1123 const currentParts = this.parseVersion(currentVersion)
1124 if (!currentParts) {
1125 return []
1126 }
1127
1128 let bestPatch: string | null = null
1129 let bestMinor: string | null = null
1130 let bestMajor: string | null = null
1131
1132 for (const version of availableVersions) {
1133 // Skip dev/alpha/beta versions for now (could be enhanced later)
1134 if (version.includes('dev') || version.includes('alpha') || version.includes('beta') || version.includes('RC')) {
1135 continue
1136 }
1137
1138 const versionParts = this.parseVersion(version)
1139 if (!versionParts) {
1140 continue
1141 }
1142
1143 // Skip versions that are not newer
1144 const comparison = this.compareVersions(version, currentVersion)
1145 if (comparison <= 0) {
1146 continue
1147 }
1148
1149 const updateType = getUpdateType(currentVersion, version)
1150
1151 // Find best update for each type
1152 if (updateType === 'patch' && versionParts.major === currentParts.major && versionParts.minor === currentParts.minor) {
1153 if (!bestPatch || this.compareVersions(version, bestPatch) > 0) {
1154 bestPatch = version
1155 }
1156 }
1157 else if (updateType === 'minor' && versionParts.major === currentParts.major) {
1158 if (!bestMinor || this.compareVersions(version, bestMinor) > 0) {
1159 bestMinor = version
1160 }
1161 }
1162 else if (updateType === 'major') {
1163 if (!bestMajor || this.compareVersions(version, bestMajor) > 0) {
1164 bestMajor = version
1165 }
1166 }
1167 }
1168
1169 // Add the best candidates
1170 if (bestPatch) {
1171 candidates.push({ version: bestPatch, type: 'patch' })
1172 }
1173 if (bestMinor) {
1174 candidates.push({ version: bestMinor, type: 'minor' })
1175 }
1176 if (bestMajor) {
1177 candidates.push({ version: bestMajor, type: 'major' })
1178 }
1179
1180 return candidates
1181 }
1182
11831100 /**
11841101 * Parse a version string into major.minor.patch
11851102 */