always run check_preset_references

This commit is contained in:
SoftFever
2026-07-02 02:08:20 +08:00
parent 320eb1a731
commit 5157adde65
4 changed files with 8 additions and 34 deletions

View File

@@ -41,7 +41,7 @@ jobs:
curl -L -o OrcaSlicer_profile_validator https://github.com/OrcaSlicer/OrcaSlicer/releases/download/nightly-builds/OrcaSlicer_profile_validator_Linux_Ubuntu2404_nightly curl -L -o OrcaSlicer_profile_validator https://github.com/OrcaSlicer/OrcaSlicer/releases/download/nightly-builds/OrcaSlicer_profile_validator_Linux_Ubuntu2404_nightly
chmod +x ./OrcaSlicer_profile_validator chmod +x ./OrcaSlicer_profile_validator
# validate profiles # Validate all system profiles.
- name: validate system profiles - name: validate system profiles
id: validate_system id: validate_system
continue-on-error: true continue-on-error: true
@@ -57,20 +57,6 @@ jobs:
set +e set +e
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 -v BBL -f 2>&1 | tee ${{ runner.temp }}/validate_filament_subtypes.log ./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 -v BBL -f 2>&1 | tee ${{ runner.temp }}/validate_filament_subtypes.log
exit ${PIPESTATUS[0]} exit ${PIPESTATUS[0]}
# Flag inherits/compatible_printers/compatible_prints references that point at a deleted or
# renamed preset. Opt-in per vendor for now (via -r); enabled for BBL and Qidi until other
# vendors' profiles are cleaned up. Runs before the custom-preset injection below.
- name: validate preset references for BBL and Qidi profiles
id: validate_preset_references
continue-on-error: true
run: |
set +e
rc=0
for v in BBL Qidi; do
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 -v "$v" -r 2>&1 | tee -a ${{ runner.temp }}/validate_preset_references.log
[ ${PIPESTATUS[0]} -ne 0 ] && rc=1
done
exit $rc
- name: validate custom presets - name: validate custom presets
id: validate_custom id: validate_custom
@@ -90,7 +76,7 @@ jobs:
echo "${{ github.event.pull_request.number }}" > ${{ runner.temp }}/profile-check-results/pr_number.txt echo "${{ github.event.pull_request.number }}" > ${{ runner.temp }}/profile-check-results/pr_number.txt
- name: Prepare comment artifact - name: Prepare comment artifact
if: ${{ always() && github.event_name == 'pull_request' && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_preset_references.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }} if: ${{ always() && github.event_name == 'pull_request' && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
run: | run: |
{ {
# Marker matched by check_profiles_comment.yml to delete prior comments. # Marker matched by check_profiles_comment.yml to delete prior comments.
@@ -125,15 +111,6 @@ jobs:
echo "" echo ""
fi fi
if [ "${{ steps.validate_preset_references.outcome }}" = "failure" ]; then
echo "### BBL/Qidi Preset Reference Validation Failed"
echo ""
echo '```'
head -c 30000 ${{ runner.temp }}/validate_preset_references.log || echo "No output captured"
echo '```'
echo ""
fi
if [ "${{ steps.validate_custom.outcome }}" = "failure" ]; then if [ "${{ steps.validate_custom.outcome }}" = "failure" ]; then
echo "### Custom Preset Validation Failed" echo "### Custom Preset Validation Failed"
echo "" echo ""
@@ -156,7 +133,7 @@ jobs:
retention-days: 1 retention-days: 1
- name: Fail if any check failed - name: Fail if any check failed
if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_preset_references.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }} if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
run: | run: |
echo "One or more profile checks failed. See above for details." echo "One or more profile checks failed. See above for details."
exit 1 exit 1

View File

@@ -96,7 +96,6 @@ int main(int argc, char* argv[])
("vendor,v", po::value<std::string>()->default_value(""), "Vendor name. Optional, all profiles present in the folder will be validated if not specified") ("vendor,v", po::value<std::string>()->default_value(""), "Vendor name. Optional, all profiles present in the folder will be validated if not specified")
("generate_presets,g", po::value<bool>()->default_value(false), "Generate user presets for mock test") ("generate_presets,g", po::value<bool>()->default_value(false), "Generate user presets for mock test")
("check_filament_subtypes,f", po::bool_switch()->default_value(false), "Also flag printers with duplicate (ambiguous) filament subtypes. Off unless this flag is present.") ("check_filament_subtypes,f", po::bool_switch()->default_value(false), "Also flag printers with duplicate (ambiguous) filament subtypes. Off unless this flag is present.")
("check_preset_references,r", po::bool_switch()->default_value(false), "Also flag presets whose inherits/compatible_printers/compatible_prints reference a deleted or renamed preset. Off unless this flag is present.")
("log_level,l", po::value<int>()->default_value(2), "Log level. Optional, default is 2 (warning). Higher values produce more detailed logs."); ("log_level,l", po::value<int>()->default_value(2), "Log level. Optional, default is 2 (warning). Higher values produce more detailed logs.");
// clang-format on // clang-format on
@@ -121,7 +120,6 @@ int main(int argc, char* argv[])
int log_level = vm["log_level"].as<int>(); int log_level = vm["log_level"].as<int>();
bool generate_user_preset = vm["generate_presets"].as<bool>(); bool generate_user_preset = vm["generate_presets"].as<bool>();
bool check_filament_subtypes = vm["check_filament_subtypes"].as<bool>(); bool check_filament_subtypes = vm["check_filament_subtypes"].as<bool>();
bool check_preset_references = vm["check_preset_references"].as<bool>();
// check if path is valid, and return error if not // check if path is valid, and return error if not
if (!fs::exists(path) || !fs::is_directory(path)) { if (!fs::exists(path) || !fs::is_directory(path)) {
@@ -168,7 +166,7 @@ int main(int argc, char* argv[])
return 0; return 0;
} }
if (preset_bundle->has_errors(check_filament_subtypes, check_preset_references)) { if (preset_bundle->has_errors(check_filament_subtypes)) {
std::cout << "Validation failed" << std::endl; std::cout << "Validation failed" << std::endl;
return 1; return 1;
} }

View File

@@ -5528,7 +5528,7 @@ void PresetBundle::set_default_suppressed(bool default_suppressed)
printers.set_default_suppressed(default_suppressed); printers.set_default_suppressed(default_suppressed);
} }
bool PresetBundle::has_errors(bool check_duplicate_filament_subtypes, bool check_references) const bool PresetBundle::has_errors(bool check_duplicate_filament_subtypes) const
{ {
if (m_errors != 0 || printers.m_errors != 0 || filaments.m_errors != 0 || prints.m_errors != 0) if (m_errors != 0 || printers.m_errors != 0 || filaments.m_errors != 0 || prints.m_errors != 0)
return true; return true;
@@ -5551,7 +5551,7 @@ bool PresetBundle::has_errors(bool check_duplicate_filament_subtypes, bool check
if (check_duplicate_filament_subtypes && this->check_duplicate_filament_subtypes()) if (check_duplicate_filament_subtypes && this->check_duplicate_filament_subtypes())
has_errors = true; has_errors = true;
if (check_references && this->check_preset_references()) if (this->check_preset_references())
has_errors = true; has_errors = true;
return has_errors; return has_errors;

View File

@@ -485,9 +485,8 @@ public:
return { Preset::TYPE_PRINTER, Preset::TYPE_SLA_PRINT, Preset::TYPE_SLA_MATERIAL }; return { Preset::TYPE_PRINTER, Preset::TYPE_SLA_PRINT, Preset::TYPE_SLA_MATERIAL };
} }
// Orca: for validation only. The duplicate filament subtype and preset-reference checks are // Orca: for validation only.
// opt-in for now (enabled per-vendor by the profile-check CI as vendors are cleaned up). bool has_errors(bool check_duplicate_filament_subtypes = false) const;
bool has_errors(bool check_duplicate_filament_subtypes = false, bool check_preset_references = false) const;
// Orca: for validation only. Flag any system preset whose inherits / compatible_printers / // Orca: for validation only. Flag any system preset whose inherits / compatible_printers /
// compatible_prints references a deleted (unknown) or renamed (old) preset name. // compatible_prints references a deleted (unknown) or renamed (old) preset name.