Quiet setup-uv warnings in publish job and no-op lockstep pins
Type of change
- Bug fix (non-breaking change which fixes an issue)
Changes To Core Features
- Have you added an explanation of what your changes do and why you'd like us to include them?
- Have you written new tests for your core changes, as applicable?
- Have you successfully ran tests with your changes locally?
Description
This PR addresses two sources of unnecessary noise in release workflow runs:
-
Quiet setup-uv in the gated publish job: The publish workflow's approval job deliberately does not check out the repository, running
setup-uvin an empty working directory. This causes setup-uv to warn twice per released package:- Its cache key hashing finds nothing to hash
- Its empty-workdir check warns about the empty directory
Since this job installs no dependencies (only runs
uv publish), there is nothing to cache anyway. The fix adds a second placeholder (@@UV_SETUP_NO_CHECKOUT@@) that passesenable-cache: falseandignore-empty-workdir: trueto silence these warnings. -
Log no-op lockstep pins without annotations: When
cmd_pin_lockstepruns on a package with no exact-pin siblings, it logs a message but was incorrectly usingnotice()(which creates a GitHub annotation). This creates one "nothing to do" line per package on every release batch summary. Changed to useecho()instead.
Similarly, cmd_post_release was using notice() for its no-op case; changed to echo() for consistency.
Changes
-
scaffold.py:
- Modified
_uv_setup_block()to accept acheckoutparameter; whenFalse, addsenable-cache: falseandignore-empty-workdir: truesettings - Added
@@UV_SETUP_NO_CHECKOUT@@placeholder to the render substitutions - Updated template validation to accept either placeholder after a setup-uv step
- Modified
-
publish.yml template & generated workflow:
- Changed the approval job's setup-uv step to use
@@UV_SETUP_NO_CHECKOUT@@instead of@@UV_SETUP_WITH@@ - Added explanatory comment about why the job runs without a checkout
- Changed the approval job's setup-uv step to use
-
commands.py:
- Changed
cmd_pin_lockstep()to useecho()instead ofnotice()for the no-op message - Changed
cmd_post_release()to useecho()instead ofnotice()for the no-op message
- Changed
-
tests:
- Updated
test_every_template_pins_the_uv_it_installs()to accept either placeholder - Added
test_render_quiets_setup_uv_where_there_is_no_checkout()to verify the new settings are applied - Updated
test_render_omits_the_block_when_nothing_is_pinned()to account for the checkout-less job keeping its settings block - Added
test_pin_lockstep_pins_the_sibling_to_the_exact_version()andtest_pin_lockstep_without_siblings_does_not_annotate_the_run()to verify the command behavior - Updated
test_post_release_without_a_configured_workflow_does_nothing()to verify no annotation is created
- Updated
Test Plan
All new and modified tests pass:
test_every_template_pins_the_uv_it_installs()validates both placeholders are recognizedtest_render_quiets_setup_uv_where_there_is_no_checkout()verifies the cache and workdir settings are appliedtest_render_omits_the_block_when_nothing_is_pinned()confirms the checkout-less job retains its settingstest_pin_lockstep_without_siblings_does_not_annotate_the_run()andtest_post_release_without_a_configured_workflow_does_nothing()verify no annotations are created for no-op cases