Fail the Profile Checks When a Changed Bundle Keeps Its Version (#16923)

The app installs a bundled profile set only when its version is newer than
the installed one, and the OTA profile update is named after the version, so
a vendor bundle merged without a bump in its <Vendor>.json never reaches a
user. Nothing checked that: two recent OrcaFilamentLibrary additions and a
Qidi printer model merged with their version unchanged.

Add a version-check command to orca_profile_tool.py that diffs two revisions
(or the working tree against the commit it left main at), groups the changed
files by vendor bundle, and fails unless every changed bundle's version is
newer than before and written as four numbers. The fourth component folds
into the third as the app reads it, so 02.04.00.100 is not newer than
02.04.01.00. A bundle the base does not have, blacklist.json and the user
preset directory are not judged.

Run it as the version_bump check in the Check profiles workflow against the
branch a PR merges into, and in check_profile.sh and check_profile.ps1,
which take --base / -Base to compare with another ref and skip the check for
a --profiles tree outside a git checkout.
This commit is contained in:
HanifKoh authored and GitHub committed 2026-10-27 21:10:54 +08:00
1 parent a50b0a167b
commit be4eff43f4
9 files changed
+521 -49

No files matched your search

+28 -2
View File
@@ -65,6 +65,21 @@ jobs:
python3 ./scripts/orca_profile_tool.py check 2>&1 | tee ${{ runner.temp }}/profile_tool.log
exit ${PIPESTATUS[0]}
# The app installs a bundled profile only when its version is newer than the installed
# one, and the OTA profile update is named after it, so a changed bundle whose
# <Vendor>.json keeps its version never reaches users. HEAD is the PR's merge commit, so
# HEAD^1 is the base it merges onto.
- name: Check that changed bundles bumped their version
id: version_bump
if: ${{ github.event_name == 'pull_request' }}
continue-on-error: true
run: |
set -o pipefail
{
git fetch --no-tags --depth=2 origin "$(git rev-parse HEAD)" &&
python3 ./scripts/orca_profile_tool.py version-check --base HEAD^1 --head HEAD
} 2>&1 | tee ${{ runner.temp }}/version_bump.log
# The app migrates user filament presets made against 2.4.2 back to the printers their
# parent listed then, from resources/info/legacy_compatible_printers.json. A PR that
# renames a filament preset or narrows its compatible_printers changes what that map
@@ -263,7 +278,7 @@ jobs:
touch "$results/gcode_diff_done.txt"
- name: Prepare comment artifact
if: ${{ always() && github.event_name == 'pull_request' && (steps.profile_tool.outcome == 'failure' || steps.legacy_compat.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_slice.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
if: ${{ always() && github.event_name == 'pull_request' && (steps.profile_tool.outcome == 'failure' || steps.version_bump.outcome == 'failure' || steps.legacy_compat.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_slice.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
run: |
{
# Marker matched by check_profiles_comment.yml to delete prior comments.
@@ -280,6 +295,17 @@ jobs:
echo ""
fi
if [ "${{ steps.version_bump.outcome }}" = "failure" ]; then
echo "### Profile Version Not Bumped"
echo ""
echo '```'
head -c 30000 ${{ runner.temp }}/version_bump.log || echo "No output captured"
echo '```'
echo ""
echo 'Every changed bundle needs a newer `version` in its `resources/profiles/<Vendor>.json`, or the app never installs the change.'
echo ""
fi
if [ "${{ steps.legacy_compat.outcome }}" = "failure" ]; then
echo "### Legacy Compatible Printers Map Out of Date"
echo ""
@@ -340,7 +366,7 @@ jobs:
retention-days: 1
- name: Fail if any check failed
if: ${{ always() && (steps.profile_tool.outcome == 'failure' || steps.legacy_compat.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_slice.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
if: ${{ always() && (steps.profile_tool.outcome == 'failure' || steps.version_bump.outcome == 'failure' || steps.legacy_compat.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_slice.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
run: |
echo "One or more profile checks failed; see the step logs above."
echo 'Reproduce the whole run locally with scripts/check_profile.sh (scripts\check_profile.bat on Windows).'