refactor: Simplify template logic - reduce from 6 to 3 categories, remove variant_type, keep validation, remove tests

Simplified template logic: reduced from 6 categories (required, modifiers, optional, versioned, conditional, flags) to 3 categories (required, modifiers, optional). Removed variant_type and replaced with modifier-based approach (version, bootloader replaced, hardware_support). All validation methods kept for recipe generation and validation. Removed tests directory (tests/test_recipe_generator.py, tests/integration/, tests/container/). Removed non-ISO workflows (validate-recipes, test-generation, container-tests, validate-ingredients). Updated Makefile, requirements.txt, and documentation. All 20 recipes successfully generated, validated, and flattened.
This commit is contained in:
Lukas Greve
2026-03-27 12:13:51 +01:00
parent 789e0e05d4
commit 288ed0a249
79 changed files with 83 additions and 1464 deletions
-38
View File
@@ -1,38 +0,0 @@
name: container-tests
on:
push:
paths:
- 'tests/**/*.py'
- 'tests/container/**'
pull_request:
paths:
- 'tests/**/*.py'
jobs:
test:
runs-on: fedora
container:
image: git.phyllo.me/devops/fedora-runner-image:latest
steps:
- uses: https://git.phyllo.me/devops/checkout@v5
with:
fetch-depth: 0
- name: Build test container
run: |
cd recipe-generator
podman build -t phyllo/test-runner ../tests/container/
- name: Run tests in container
run: |
podman run --rm -v $(pwd):/phyllomeos:ro phyllo/test-runner
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: container-test-results
path: _pytest_cache/
if-no-files-found: ignore
-51
View File
@@ -1,51 +0,0 @@
name: test-generation
on:
push:
paths:
- 'recipe-generator/**/*.py'
- 'recipe-generator/**/*.yaml'
- 'ingredients/**/*.ks'
pull_request:
paths:
- 'recipe-generator/**/*.py'
- 'recipe-generator/**/*.yaml'
jobs:
generate:
runs-on: fedora
container:
image: git.phyllo.me/devops/fedora-runner-image:latest
steps:
- uses: https://git.phyllo.me/devops/checkout@v5
with:
fetch-depth: 0
- name: Install dependencies
run: |
pip install PyYAML pykickstart
- name: Generate all variants
run: |
cd recipe-generator
python3 generate_recipe.py \
--manifest recipes_manifest.yaml \
--output-dir ../recipes/
- name: Verify 16 recipes created
run: |
count=$(ls recipes/*.cfg | wc -l)
if [ $count -ne 16 ]; then
echo "Expected 16 recipes, got $count"
exit 1
fi
echo "✓ Generated $count recipes"
- name: Upload generated recipes
uses: actions/upload-artifact@v3
with:
name: generated-recipes
path: recipes/
if-no-files-found: error
retention-days: 7
@@ -1,42 +0,0 @@
name: validate-ingredients
on:
push:
paths:
- 'ingredients/**/*.ks'
pull_request:
paths:
- 'ingredients/**/*.ks'
jobs:
validate:
runs-on: fedora
container:
image: git.phyllo.me/devops/fedora-runner-image:latest
steps:
- uses: https://git.phyllo.me/devops/checkout@v5
with:
fetch-depth: 0
- name: Install pykickstart
run: pip install pykickstart
- name: Validate all ingredients
run: |
errors=0
for ingredient in $(find ingredients -name "*.ks"); do
if python3 -c "
from pykickstart.parser import KickstartParser
from pykickstart.version import makeVersion, DEVEL
parser = KickstartParser(makeVersion(DEVEL))
parser.readKickstart(open('$ingredient').read())
" 2>/dev/null; then
echo "✓ $ingredient"
else
echo "✗ $ingredient"
errors=$((errors + 1))
fi
done
echo "Ingredient validation complete: $errors errors"
exit $errors
-50
View File
@@ -1,50 +0,0 @@
name: validate-recipes
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
validate:
runs-on: fedora
container:
image: git.phyllo.me/devops/fedora-runner-image:latest
steps:
- uses: https://git.phyllo.me/devops/checkout@v5
with:
fetch-depth: 0
- name: Install dependencies
run: |
pip install PyYAML pytest pykickstart
- name: Generate all recipes
run: |
cd recipe-generator
make generate-recipes
- name: Validate recipes (strict mode)
run: |
cd recipe-generator
python3 generate_recipe.py --validate ../recipes/*.cfg --strict
- name: Run unit tests
run: |
cd recipe-generator
make test
- name: Run integration tests
run: |
cd recipe-generator
make test-integration
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: _pytest_cache/
if-no-files-found: ignore