Fix release workflow skipping publish when using custom builds

Merged
MA
2mo ago
+145-12

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Description

Fixes a critical bug in the release workflow where using a [[tool.reflex-release.custom-build]] entry would cause the publish step to silently skip without uploading packages, while still reporting success.

Root cause: When a custom build is configured, exactly one of the built-in build job and the custom-build job runs for any given package — the other is always skipped. GitHub's implicit success() status function (applied when no explicit if condition is set) evaluates over the entire transitive dependency closure rather than just direct dependencies. This caused the skipped build path to propagate through the collect job (which absorbs both paths) and reach the publish job, silently skipping it despite having packages to publish.

Solution:

  1. publish.yml: Added explicit if condition to the publish job that checks needs.collect.result == 'success' and !cancelled() alongside the existing skipped check. This prevents the implicit success() from propagating through skipped dependencies.

  2. publish.yml: Added explicit if condition to the tag-and-release job checking needs.publish.result == 'success' and !cancelled(). Using !failure() would be insufficient since a skipped publish is neither failed nor cancelled.

  3. release_from_changelog.yml: Enhanced the report step's validation logic to distinguish between legitimately skipped legs (when detect found no packages for them) and improperly skipped legs (when detect found packages but the leg didn't run). The script now:

    • Passes ANY and ANY_LAST outputs from the detect job to indicate whether each leg had work
    • Uses a check_leg() function that only accepts 'skipped' when there was no work to do
    • Reports an error if a leg was skipped despite having packages to publish
  4. test_scaffold.py: Added comprehensive test coverage:

    • test_the_gate_survives_the_build_path_that_is_always_skipped: Verifies the publish job has proper status checks
    • test_the_tag_is_pushed_only_after_a_successful_upload: Verifies tag-and-release uses success() not failure()
    • test_the_report_is_red_when_a_leg_with_work_did_not_publish: Parametrized test validating all combinations of leg states and work indicators

Testing

  • Added 3 new test functions with comprehensive parametrized coverage (8 test cases for the report validation)
  • Tests verify both the workflow YAML structure and the shell script logic
  • All tests pass with the fix in place

Checklist

  • Tests added for the bug fix
  • Changes follow the code style guidelines
  • No breaking changes introduced

https://claude.ai/code/session_011bhWhmMrSDwsuUK41vXQ4T