Skip to content

Commit

Permalink
Release role: use feature freeze for all betas except b1, and all rel…
Browse files Browse the repository at this point in the history
…ease candidates; allow to skip prepare step (#598)

* Use feature freeze for b2..b9 and all RCs.

* Add newlines.

* Fix reference to ansible docs repo.

* Allow to skip the prepare step.

* Do not skip prepare only if the .deps file is missing.
  • Loading branch information
felixfontein authored May 13, 2024
1 parent 31f48a6 commit effb1b9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
5 changes: 5 additions & 0 deletions changelogs/fragments/598-release-role.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minor_changes:
- "Use feature freeze for all betas from ``b2`` on, and all release candidates in the release role (https://github.com/ansible-community/antsibull/pull/598)."
- "Allow the release role to skip the ``prepare`` step by setting ``antsibull_skip_prepare=true`` if the ``.deps`` file already exists (https://github.com/ansible-community/antsibull/pull/598)."
breaking_changes:
- "The release role no longer automatically skips the ``prepare`` step when the ``.deps`` file already exists. If you need this behavior, set ``antsibull_skip_prepare=true`` (https://github.com/ansible-community/antsibull/pull/598)."
3 changes: 3 additions & 0 deletions roles/build-release/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ antsibull_sdist_dir: "{{ playbook_dir | dirname }}/build"
# The build file
antsibull_build_file: "ansible-{{ antsibull_ansible_major_version }}.build"

# Skip the prepare step if a `.deps` file already exists for the release
antsibull_skip_prepare: false

# Force a rebuild by deleting an existing release tarball and python wheel, if they exist
antsibull_force_rebuild: false

Expand Down
10 changes: 10 additions & 0 deletions roles/build-release/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ argument_specs:
type: path
default: ansible-<major_version>.build

antsibull_skip_prepare:
description:
- Skip the prepare step if a C(.deps) file already exists for the release.
type: bool
default: false
version_added: 0.62.0

antsibull_force_rebuild:
description:
- Force a rebuild by deleting an existing release tarball and python wheel, if they exist.
Expand Down Expand Up @@ -108,18 +115,21 @@ argument_specs:
This file will be ignored if it doesn't exist.
type: path
default: "{{ antsibull_data_dir }}/validate-tags-ignores"

antsibull_test_bytecompile:
description:
- Whether to run a test byte-compiliation of the Python code in the ansible package
type: bool
default: true

antsibull_test_bytecompile_pythons:
description:
- Which Python interpreters to use for the test byte-compilation
type: list
elements: str
default:
- "{{ ansible_python_executable | default(ansible_playbook_python) }}"

antsibull_test_bytecompile_jobs:
description:
- How many threads to use to byte-compile the Python code in the ansible package
Expand Down
13 changes: 10 additions & 3 deletions roles/build-release/tasks/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@
(antsibull_ansible_version is regex("^\d+.\d+.\d+(a\d+|b1)$") and antsibull_data_reset)
or not _antsibull_build_file_stat.stat.exists
- name: Set up feature freeze for b2 through rc1
- name: Set up feature freeze for b2 and later betas, and release candidates
ansible.builtin.set_fact:
_feature_freeze: "--feature-frozen"
when: antsibull_ansible_version is regex("^\d+.\d+.\d+(b2|b3|rc1)$")
when: antsibull_ansible_version is regex("^\d+.\d+.\d+(b[2-9]|rc\d+)$")

- name: Check whether the ansible deps file exists
ansible.builtin.stat:
path: "{{ antsibull_data_dir }}/{{ _deps_file }}"
register: _antsibull_deps_file_stat

- name: Prepare a release with new dependencies
ansible.builtin.command: >-
Expand All @@ -57,7 +62,9 @@
until: _build.rc == 0
args:
chdir: "{{ playbook_dir | dirname }}"
creates: "{{ antsibull_data_dir }}/{{ _deps_file }}"
when: >-
not antsibull_skip_prepare
or not _antsibull_deps_file_stat.stat.exists
- name: Find ignores file
when: antsibull_tags_validate
Expand Down
2 changes: 1 addition & 1 deletion roles/build-release/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
Build tested and complete!
A changelog as well as a porting guide have probably been generated at {{ antsibull_data_dir }}.
The changelog must stay in the ansible-build-data repository and can be sent as a pull request
but the porting guide needs to be submitted to ansible/ansible:docs/docsite/rst/porting_guides.
but the porting guide needs to be submitted to ansible/ansible-documentation:docs/docsite/rst/porting_guides.

0 comments on commit effb1b9

Please sign in to comment.