diff --git a/changelogs/fragments/599-prepare-preserve.yml b/changelogs/fragments/599-prepare-preserve.yml index ba1dac80..005c619f 100644 --- a/changelogs/fragments/599-prepare-preserve.yml +++ b/changelogs/fragments/599-prepare-preserve.yml @@ -2,5 +2,6 @@ minor_changes: - "Add option ``--preserve-deps`` to the ``prepare`` subcommand that allows to preserve the dependencies if a ``.deps`` file for that version already exists. The versions from that ``.deps`` file are validated against the build requirements and constraints, and the - remainder of the release preparation process remains unchanged + remainder of the release preparation process remains unchanged. The release role allows + to pass this flag when ``antsibull_preserve_deps=true`` (https://github.com/ansible-community/antsibull/pull/599)." diff --git a/roles/build-release/defaults/main.yaml b/roles/build-release/defaults/main.yaml index e465eb0d..b9b4ff5e 100644 --- a/roles/build-release/defaults/main.yaml +++ b/roles/build-release/defaults/main.yaml @@ -41,6 +41,9 @@ antsibull_ansible_venv: "{{ antsibull_sdist_dir }}/venv" # Whether or not to start from scratch with a new venv if one exists antsibull_venv_cleanup: true +# Whether to preserve existing .deps files during the prepare step +antsibull_preserve_deps: false + ##### # These variables relate to verifying that collections properly tag their diff --git a/roles/build-release/meta/argument_specs.yml b/roles/build-release/meta/argument_specs.yml index 0578dee5..dcb8096a 100644 --- a/roles/build-release/meta/argument_specs.yml +++ b/roles/build-release/meta/argument_specs.yml @@ -126,3 +126,11 @@ argument_specs: - Defaults to 0 (all available CPUs) type: int default: 0 + + antsibull_preserve_deps: + description: + - If set to V(true), will preserve existing C(.deps) files during the preparation + process and validate their contents against the build requirements and constraints. + type: bool + default: false + version_added: 0.62.0 diff --git a/roles/build-release/tasks/build.yaml b/roles/build-release/tasks/build.yaml index fa3fcf8e..0eda427e 100644 --- a/roles/build-release/tasks/build.yaml +++ b/roles/build-release/tasks/build.yaml @@ -50,6 +50,7 @@ --data-dir {{ antsibull_data_dir }} {{ _feature_freeze | default('') }} {{ '--tags-file' if antsibull_tags_validate else '' }} + {{ '--preserve-deps' if antsibull_preserve_deps else '' }} # Minimal failure tolerance to galaxy collection download errors retries: 3 delay: 5