Add --dry-run flag and workflow_dispatch trigger for Launchpad script#112
Conversation
Add a global --dry-run flag that applies to all subcommands (copy-to-series, promote, wait-for-builds). When set, all read operations execute normally while write operations (copyPackage, syncSources) are replaced with log messages describing the action that would be taken, including package name, version, and source/destination. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a workflow_dispatch trigger with a dry_run boolean input (default true) to enable manual end-to-end testing of the publishing workflow. When dry_run is true: build_package and wait_for_source_builds jobs are skipped, block_release_step approval gate is skipped, and --dry-run is passed to all launchpad_copy.py invocations. The check_version job falls back to the changelog version when no release tag is present. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the outdated Releasing section with comprehensive documentation covering: automated release workflow steps, Launchpad credentials generation via create_lp_creds.py, manual dry-run testing via workflow_dispatch, and launchpad_copy.py CLI usage for all subcommands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rtibbles
left a comment
There was a problem hiding this comment.
Not your fault, but I think a change in approach would be more informative.
.github/workflows/build_debian.yml
Outdated
| types: [published] | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: |
There was a problem hiding this comment.
Looking at the implementation I am not so sure that this is what is needed.
I think instead we should switch focus slightly and instead make sure each step is robust to the workflow being rerun. So as we are testing the publish workflow with the workflow dispatch, if it fails part way through we can rerun it for the same version after making edits and have it not break because one step succeeded already.
There was a problem hiding this comment.
Agreed — replaced the dry-run approach with idempotent steps. copyPackage and syncSources now handle "already published" errors gracefully (log and skip). The workflow_dispatch trigger no longer has a dry_run input — it just runs the real workflow, and each step is safe to rerun.
…flow Replace the --dry-run flag approach with idempotent operations so the workflow can be safely rerun after partial failure. Instead of skipping write operations, copyPackage and syncSources now handle "already published" errors gracefully, logging and continuing. - Remove --dry-run flag from CLI and LaunchpadWrapper - Add error handling for "same version already published" in promote() and perform_queued_copies() - Simplify workflow_dispatch: remove dry_run input, use event_name checks - Update README to document rerunnable workflow dispatch behavior - Replace dry-run tests with idempotency tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Addressed 2/2 review items. 0 deferred. Replaced the
|
Summary
--dry-runflag toscripts/launchpad_copy.pythat applies to all subcommands (copy-to-series,promote,wait-for-builds). When set, read operations execute normally while write operations (copyPackage,syncSources) are replaced with log messages describing what would happen.workflow_dispatchtrigger tobuild_debian.ymlwith adry_runboolean input (defaulttrue). When triggered with dry-run enabled, the build/upload job and manual approval gate are skipped, and--dry-runis passed to all script invocations.README.rstwith documentation on Launchpad credentials setup, the automated release workflow, manual dry-run testing, and CLI usage.References
Reviewer guidance
scripts/launchpad_copy.py— review theperform_queued_copiesandpromotemethods for the dry-run guard logic..github/workflows/build_debian.ymluseifconditions andalways()with result checks to handle skipped jobs in the dependency chain. Verify the conditional logic forcopy_to_other_distributionsandcopy_package_from_proposed_to_ppajobs.dry_run: true— it should skip build/upload, run copy-to-series and promote with--dry-run, and skip the approval gate.check_versionjob now falls back to the changelog version forworkflow_dispatch(no release tag available).Test evidence
All 62 tests pass (4 skipped due to missing
ubuntu-distro-infoon non-Ubuntu):Dry-run specific test coverage:
TestDryRunPromote::test_dry_run_skips_copy_package— verifiescopyPackageis never calledTestDryRunPromote::test_dry_run_logs_what_would_be_promoted— verifies DRY-RUN log with package name and versionTestDryRunCopyToSeries::test_dry_run_skips_sync_sources— verifiessyncSourcesis never calledTestDryRunCopyToSeries::test_dry_run_logs_what_would_be_copied— verifies DRY-RUN log with package name and destinationTestDryRunWaitForBuilds::test_dry_run_wait_for_builds_still_works— verifies wait-for-builds works normally (already read-only)TestDryRunIntegration::test_cmd_*_sets_dry_run_on_wrapper— verifies CLI flag threads through to wrapper for all 3 subcommandsPre-commit linting passes:
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Closes #108