Skip to content

Commit da613f7

Browse files
committed
🐛 fix(tag): treat compound rolling channel aliases as floating even with digit suffixes
- Detect rolling alias patterns (latest-alpine, stable_arm64, dev.build) before numeric shape parsing - Prevents isTagPinned from misclassifying rolling channels whose architecture or build markers contain digits
1 parent 3ffe2f1 commit da613f7

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

app/tag/precision.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ describe('tag/precision', () => {
3737
expect(getNumericTagShapeFromTransformedTag('1.2.3\rrc1')).toBeNull();
3838
});
3939

40+
test('extracts numeric segments after a multi-byte prefix', () => {
41+
expect(getNumericTagShapeFromTransformedTag('🧪v1.2.3-alpine')).toEqual({
42+
prefix: '🧪v',
43+
numericSegments: ['1', '2', '3'],
44+
suffix: '-alpine',
45+
});
46+
});
47+
4048
test('returns null when the transformed tag trims to an empty string', () => {
4149
expect(getNumericTagShape('1.2.3', '^.*$ => ')).toBeNull();
4250
});
@@ -81,6 +89,12 @@ describe('tag/precision', () => {
8189
expect(isTagPinned('stable', undefined)).toBe(false);
8290
});
8391

92+
test('treats compound rolling channel aliases as not pinned', () => {
93+
expect(isTagPinned('latest-alpine', undefined)).toBe(false);
94+
expect(isTagPinned('stable_arm64', undefined)).toBe(false);
95+
expect(isTagPinned('dev.build', undefined)).toBe(false);
96+
});
97+
8498
test('treats whitespace-only transformed tags as not pinned', () => {
8599
expect(isTagPinned('1.2.3', '^.*$ => ')).toBe(false);
86100
});

app/tag/precision.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,17 @@ export function isTagPinned(tag: string, transformTags: string | undefined): boo
110110
return false;
111111
}
112112

113+
// Rolling aliases like "stable-arm64" should remain floating even when a
114+
// suffix contains digits (for example architecture or build markers).
115+
if (isRollingTagAliasValue(transformedTag)) {
116+
return false;
117+
}
118+
113119
if (getNumericTagShapeFromTransformedTag(transformedTag)) {
114120
return true;
115121
}
116122

117-
return !isRollingTagAliasValue(transformedTag);
123+
return true;
118124
}
119125

120126
export function classifyTagPrecision(

0 commit comments

Comments
 (0)