Skip to content

Commit d15fa7d

Browse files
committed
feat: introduce deprecated_at + superseded_by, drop comment-out pattern
Replaces the fragile comment-out convention for disabling old minor versions with two structured properties on each version entry: - deprecated_at: ISO-8601 timestamp marking when the version was taken out of the build matrix. Build tooling skips entries that have this set. - superseded_by: optional pointer to the replacement version, used by the README generator and to inform users which tag to migrate to. Why: - Comment-text parsing in build-new-releases.yml's grep was treating newly-commented-out version blocks as new versions and failing the prepare-matrix step. Structural data is robust against this. - YAML stays parseable and grep-friendly; tools handle disabled entries as data, not text. - Deprecation history is preserved (architecture, distribution, tags stay intact) and rendered in the README for users. Changes: - asterisk/supported-asterisk-builds.yml: migrate all previously commented-out blocks (18.9-cert17, 20.7-cert{7,8,9}, 20.17.0, 20.18.0, 20.18.2, 21.12.0, 21.12.1, 22.7.0, 22.8.0, 22.8.2, 22.8-cert1, 23.1.0, 23.2.0, 23.2.2) to active YAML structure with deprecated_at and superseded_by. Migration timestamp is the conversion day; exact original deprecation dates were not tracked. 18.9-cert17 also gets a 'reason' note documenting its compilation issue. - .github/actions/generate-build-matrix/action.yml: skip entries with deprecated_at when generating the build matrix. - .github/workflows/build-new-releases.yml: replace grep-based detection with structural diff. Loads YAML at HEAD and HEAD^, computes active_versions (has os_matrix, no deprecated_at) on each side, reports the set difference. Also skips deprecated_at in the matrix-generation step. - .github/workflows/validate-generation.yml: skip deprecated entries in consistency checks. - scripts/regenerate-all-configs.sh, scripts/build-all.sh, scripts/build-asterisk.sh: skip deprecated entries in matrix enumeration. build-asterisk.sh also reports deprecated status when a user asks for a deprecated version explicitly. - scripts/update-readme-versions.py: emit a separate '## Deprecated Versions' table in the README with version, deprecated date, and superseded_by. - README.md: regenerated with new tables and bumped example version references from 22.8.2 (now deprecated) to 22.9.0 (current latest). Active count drops from 31 to 25; 16 versions move to the new deprecated section. See issue #136.
1 parent 107c87e commit d15fa7d

9 files changed

Lines changed: 385 additions & 170 deletions

File tree

‎.github/actions/generate-build-matrix/action.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ runs:
9090
if not version or 'os_matrix' not in build:
9191
continue
9292
93+
# Skip deprecated versions (kept in YAML for history but not built)
94+
if build.get('deprecated_at'):
95+
continue
96+
9397
# Apply version filters
9498
if filter_version:
9599
# Exact version match takes precedence

‎.github/workflows/build-new-releases.yml‎

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,62 @@ jobs:
3030
with:
3131
fetch-depth: 0
3232

33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.13"
37+
38+
- name: Install Python dependencies
39+
run: pip install pyyaml
40+
3341
- name: Extract new versions
3442
id: extract-versions
3543
run: |
3644
if [ "${{ github.event_name }}" = "pull_request" ]; then
3745
echo "🔍 Detecting new Asterisk versions in PR..."
38-
# Fetch base branch for comparison
3946
git fetch origin ${{ github.base_ref }}
4047
COMPARE_REF="origin/${{ github.base_ref }}"
4148
else
4249
echo "🔍 Detecting new Asterisk versions in push to main..."
43-
# Compare with previous commit
4450
COMPARE_REF="HEAD^"
4551
fi
4652
47-
# Get diff of supported-asterisk-builds.yml
48-
NEW_VERSIONS=$(git diff $COMPARE_REF...HEAD -- asterisk/supported-asterisk-builds.yml | \
49-
grep '^+.*version:' | \
50-
sed 's/^+.*version: *"\([^"]*\)".*/\1/' | \
51-
grep -v '^$' | \
52-
tr '\n' ' ' | \
53-
sed 's/ $//')
53+
# Compare YAML structurally: a version is "new" if it is active
54+
# (has os_matrix, no deprecated_at) at HEAD but was not active at
55+
# COMPARE_REF. This is robust against comment-out style edits and
56+
# other text-level diff noise.
57+
BASE_YAML=$(git show "$COMPARE_REF:asterisk/supported-asterisk-builds.yml" 2>/dev/null || echo "")
58+
HEAD_YAML=$(cat asterisk/supported-asterisk-builds.yml)
59+
60+
NEW_VERSIONS=$(BASE_YAML="$BASE_YAML" HEAD_YAML="$HEAD_YAML" python3 - <<'PY'
61+
import os, sys, yaml
62+
63+
def active_versions(text):
64+
if not text:
65+
return set()
66+
try:
67+
data = yaml.safe_load(text) or {}
68+
except yaml.YAMLError as e:
69+
print(f"⚠️ Failed to parse YAML: {e}", file=sys.stderr)
70+
return set()
71+
out = set()
72+
for build in data.get('latest_builds', []) or []:
73+
version = build.get('version')
74+
if not version:
75+
continue
76+
if 'os_matrix' not in build:
77+
continue
78+
if build.get('deprecated_at'):
79+
continue
80+
out.add(version)
81+
return out
82+
83+
base = active_versions(os.environ.get('BASE_YAML', ''))
84+
head = active_versions(os.environ.get('HEAD_YAML', ''))
85+
new = sorted(head - base)
86+
print(' '.join(new))
87+
PY
88+
)
5489
5590
if [ -z "$NEW_VERSIONS" ]; then
5691
echo "has_new_versions=false" >> $GITHUB_OUTPUT
@@ -139,6 +174,10 @@ jobs:
139174
print(f'⏭️ Skipping {version} (no os_matrix - disabled)', file=sys.stderr)
140175
continue
141176
177+
if build.get('deprecated_at'):
178+
print(f'⏭️ Skipping {version} (deprecated since {build[\"deprecated_at\"]})', file=sys.stderr)
179+
continue
180+
142181
os_matrix = build['os_matrix']
143182
additional_tags = build.get('additional_tags', '')
144183

‎.github/workflows/validate-generation.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,18 @@ jobs:
3636
for build in data.get('latest_builds', []):
3737
version = build.get('version')
3838
os_matrix = build.get('os_matrix')
39+
deprecated_at = build.get('deprecated_at')
3940
4041
# Skip intentionally disabled versions
4142
if not os_matrix:
4243
print(f"⏭️ Skipping {version} (intentionally disabled)")
4344
continue
4445
46+
# Skip deprecated versions (kept in YAML for history)
47+
if deprecated_at:
48+
print(f"⏭️ Skipping {version} (deprecated since {deprecated_at})")
49+
continue
50+
4551
for os_config in os_matrix:
4652
dist = os_config.get('distribution')
4753

‎README.md‎

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ docker run --rm -p 5060:5060/udp andrius/asterisk:latest
1313
docker run --rm andrius/asterisk:latest asterisk -V
1414

1515
# Use specific version for production
16-
docker run --rm -p 5060:5060/udp andrius/asterisk:22.8.2_debian-trixie
16+
docker run --rm -p 5060:5060/udp andrius/asterisk:22.9.0_debian-trixie
1717

1818
# Or build latest stable version locally and run locally built container
19-
./scripts/build-asterisk.sh 22.8.2
20-
docker run --rm -p 5060:5060/udp 22.8.2_debian-trixie
19+
./scripts/build-asterisk.sh 22.9.0
20+
docker run --rm -p 5060:5060/udp 22.9.0_debian-trixie
2121

2222
```
2323

@@ -76,21 +76,45 @@ All supported Asterisk versions with automatic variant detection. Generated buil
7676
| **1.4.44** | 1.4 | Jessie | amd64 |
7777
| **1.2.40** | 1.2 | Stretch | amd64 |
7878

79+
## Deprecated Versions
80+
81+
These versions are no longer built but kept here for historical reference. Existing images remain in the registries until manually pruned.
82+
83+
| Version | Deprecated | Superseded by |
84+
| ------- | ---------- | ------------- |
85+
| **23.2.2** | 2026-05-04 | `23.3.0` |
86+
| **23.2.0** | 2026-05-04 | `23.3.0` |
87+
| **23.1.0** | 2026-05-04 | `23.3.0` |
88+
| **22.8.2** | 2026-05-04 | `22.9.0` |
89+
| **22.8-cert1** | 2026-05-04 | `22.8-cert2` |
90+
| **22.8.0** | 2026-05-04 | `22.9.0` |
91+
| **22.7.0** | 2026-05-04 | `22.9.0` |
92+
| **21.12.1** | 2026-05-04 | `21.12.2` |
93+
| **21.12.0** | 2026-05-04 | `21.12.2` |
94+
| **20.18.2** | 2026-05-04 | `20.19.0` |
95+
| **20.18.0** | 2026-05-04 | `20.19.0` |
96+
| **20.17.0** | 2026-05-04 | `20.19.0` |
97+
| **20.7-cert9** | 2026-05-04 | `20.7-cert10` |
98+
| **20.7-cert8** | 2026-05-04 | `20.7-cert10` |
99+
| **20.7-cert7** | 2026-05-04 | `20.7-cert10` |
100+
| **18.9-cert17** | 2026-05-04 | `18.9-cert18` |
101+
102+
79103
## Additional Tags
80104

81105
The build system supports semantic Docker tags for easier version management. These tags are defined in the `additional_tags` property of `asterisk/supported-asterisk-builds.yml` and automatically applied during builds.
82106

83107
## Docker Tags Format
84108

85-
This project uses a dual-tagging system: **version-specific tags** in the format `{version}_{os}-{distribution}` (e.g., `22.8.2_debian-trixie`) for precise deployment, and semantic tags (e.g., `latest`, `stable`, `22`, `23-rc`, `20-cert`) for convenient version management.
109+
This project uses a dual-tagging system: **version-specific tags** in the format `{version}_{os}-{distribution}` (e.g., `22.9.0_debian-trixie`) for precise deployment, and semantic tags (e.g., `latest`, `stable`, `22`, `23-rc`, `20-cert`) for convenient version management.
86110

87111
Primary tags include the full OS and distribution context, while additional semantic tags are defined per version in the build matrix using the additional_tags property. Multi-architecture builds create unified manifests under the same tag names, automatically selecting the correct architecture.
88112

89-
For development, use semantic tags like `asterisk:latest` or `asterisk:stable`, and for production a specific tag like `asterisk:22.8.2_debian-trixie` that guarantee exact version and environment reproducibility.
113+
For development, use semantic tags like `asterisk:latest` or `asterisk:stable`, and for production a specific tag like `asterisk:22.9.0_debian-trixie` that guarantee exact version and environment reproducibility.
90114

91115
### Current Tag Meanings
92116

93-
- **`latest`** - Points to the most current stable release (currently **22.8.2**)
117+
- **`latest`** - Points to the most current stable release (currently **22.9.0**)
94118
- **`stable`** - Alias for the latest stable production version
95119
- **`22`** - Major version tag for the Asterisk 22.x series
96120
- **`23-rc`** - Release candidate tag for Asterisk 23.x pre-releases
@@ -119,15 +143,15 @@ Additional tags are configured per version in the build matrix:
119143
```yaml
120144
# In asterisk/supported-asterisk-builds.yml
121145
latest_builds:
122-
- version: "22.8.2"
146+
- version: "22.9.0"
123147
additional_tags: "latest,stable,22"
124148
os_matrix:
125149
- os: "debian"
126150
distribution: "trixie"
127151
architectures: ["amd64", "arm64"]
128152
```
129153
130-
When building, both version-specific tags (`22.8.2_debian-trixie`) and semantic tags (`latest`, `stable`, `22`) are created for the same image.
154+
When building, both version-specific tags (`22.9.0_debian-trixie`) and semantic tags (`latest`, `stable`, `22`) are created for the same image.
131155

132156
## Key Features
133157

@@ -244,21 +268,21 @@ These overrides are applied automatically during ANY config generation:
244268
./scripts/discover-latest-versions.sh --output-yaml --updates-only
245269
246270
# Build specific version
247-
./scripts/build-asterisk.sh 22.8.2 --force-config
271+
./scripts/build-asterisk.sh 22.9.0 --force-config
248272
249273
# Build with specific distribution
250-
./scripts/build-asterisk.sh 22.8.2 debian bookworm
274+
./scripts/build-asterisk.sh 22.9.0 debian bookworm
251275
252276
# Preview build without execution
253-
./scripts/build-asterisk.sh 22.8.2 --dry-run
277+
./scripts/build-asterisk.sh 22.9.0 --dry-run
254278
255279
# Test configurations and builds
256-
./scripts/test-build.sh --mode config "22.8.2" # Fast validation
257-
./scripts/test-build.sh --mode build "22.8.2" # Full Docker build
258-
./scripts/test-build.sh --mode validate "22.8.2" # Complete testing
280+
./scripts/test-build.sh --mode config "22.9.0" # Fast validation
281+
./scripts/test-build.sh --mode build "22.9.0" # Full Docker build
282+
./scripts/test-build.sh --mode validate "22.9.0" # Complete testing
259283
260284
# Generate config only
261-
python3 scripts/generate-config.py 22.8.2 trixie
285+
python3 scripts/generate-config.py 22.9.0 trixie
262286
```
263287

264288
### Template Modification
@@ -287,13 +311,13 @@ After template changes, rebuild with `--force-config`:
287311

288312
```bash
289313
# Validate configuration
290-
python3 scripts/generate-dockerfile.py configs/generated/asterisk-22.8.2-trixie.yml --validate
314+
python3 scripts/generate-dockerfile.py configs/generated/asterisk-22.9.0-trixie.yml --validate
291315

292316
# Test health check
293-
docker run --rm asterisk:22.8.2_debian-trixie /usr/local/bin/healthcheck.sh --verbose
317+
docker run --rm asterisk:22.9.0_debian-trixie /usr/local/bin/healthcheck.sh --verbose
294318

295319
# Run container with shell
296-
docker run -it --rm asterisk:22.8.2_debian-trixie /bin/bash
320+
docker run -it --rm asterisk:22.9.0_debian-trixie /bin/bash
297321
```
298322

299323
## Examples

0 commit comments

Comments
 (0)