Quiet setup-uv warnings in publish job and no-op lockstep pins

Merged
MA
2mo ago
+129-24

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:

  1. Quiet setup-uv in the gated publish job: The publish workflow's approval job deliberately does not check out the repository, running setup-uv in 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 passes enable-cache: false and ignore-empty-workdir: true to silence these warnings.

  2. Log no-op lockstep pins without annotations: When cmd_pin_lockstep runs on a package with no exact-pin siblings, it logs a message but was incorrectly using notice() (which creates a GitHub annotation). This creates one "nothing to do" line per package on every release batch summary. Changed to use echo() 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 a checkout parameter; when False, adds enable-cache: false and ignore-empty-workdir: true settings
    • Added @@UV_SETUP_NO_CHECKOUT@@ placeholder to the render substitutions
    • Updated template validation to accept either placeholder after a setup-uv step
  • 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
  • commands.py:

    • Changed cmd_pin_lockstep() to use echo() instead of notice() for the no-op message
    • Changed cmd_post_release() to use echo() instead of notice() for the no-op message
  • 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() and test_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

Test Plan

All new and modified tests pass:

  • test_every_template_pins_the_uv_it_installs() validates both placeholders are recognized
  • test_render_quiets_setup_uv_where_there_is_no_checkout() verifies the cache and workdir settings are applied
  • test_render_omits_the_block_when_nothing_is_pinned() confirms the checkout-less job retains its settings
  • test_pin_lockstep_without_siblings_does_not_annotate_the_run() and test_post_release_without_a_configured_workflow_does_nothing() verify no annotations are created for no-op cases

https://claude.ai/code/session_01HDhLwzkKAooYz8x4AB2Ygk