From 45428f1f9f485d810e3d77db89c13931eaba9029 Mon Sep 17 00:00:00 2001 From: "Dr. Jens Harbott" Date: Thu, 15 Aug 2024 12:16:50 +0200 Subject: [PATCH] Update update-constraints job and script We often see failures on requirements patches generates after a release was tagged that are due to the newly created version not being found yet in the index. These require a recheck to resolve. Add a pause of 10 minutes before creating the requirements review in an attempt to reduce the frequency of these failures. Also fix some minor issues: - The extraction of the SHORTNAME for the repo from remote.origin.url git config is broken, because zuul overrides that url to be /dev/null. Use the working directory name instead. - Current python minor versions have two digits, amend the regex we are using to match these. - Drop a workaround that was needed when Python 3.8 was new and shiny. - Switch the nodeset this job is running on from ubuntu-focal to ubuntu-noble. Change-Id: I6751ea91499bbc81c71dce6da7fbe982bbc03efe --- playbooks/proposal/propose-update-constraints.yaml | 4 ++++ .../files/release-tools/update_constraints.sh | 12 +++--------- zuul.d/jobs.yaml | 1 + 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/playbooks/proposal/propose-update-constraints.yaml b/playbooks/proposal/propose-update-constraints.yaml index c746b485a9..9642042163 100644 --- a/playbooks/proposal/propose-update-constraints.yaml +++ b/playbooks/proposal/propose-update-constraints.yaml @@ -1,5 +1,9 @@ - hosts: all tasks: + - name: Pause in order to allow pypi to catch up + ansible.builtin.pause: + minutes: 10 + prompt: Pausing for 10 minutes in order to allow pypi to catch up - name: Propose constraints update command: "{{ ansible_user_dir }}/scripts/release-tools/update_constraints.sh {{ zuul.tag }}" diff --git a/roles/copy-release-tools-scripts/files/release-tools/update_constraints.sh b/roles/copy-release-tools-scripts/files/release-tools/update_constraints.sh index 648e7abc77..1c98d96a42 100755 --- a/roles/copy-release-tools-scripts/files/release-tools/update_constraints.sh +++ b/roles/copy-release-tools-scripts/files/release-tools/update_constraints.sh @@ -71,12 +71,12 @@ function get_tag_meta { # Find the branch information from the tag metadata in the comment. BRANCH=$(get_tag_meta branch) -# Pick up the repository name from the git URL. -SHORTNAME=$(basename $(git config --local remote.origin.url)) +# Pick up the repository name from the current directory. +SHORTNAME=$(basename $(pwd)) # Extract python_version information from the package metadata. declare -a PYTHON_3_VERSIONS -PYTHON_3_VERSIONS=`sed -n -e 's/^.*Programming.Language.*:://p' < setup.cfg | grep "3..$"` +PYTHON_3_VERSIONS=`sed -n -e 's/^.*Programming.Language.*:://p' < setup.cfg | grep "3...\?$"` # Apply the PEP 503 rules to turn the dist name into a canonical form, # in case that's the version that appears in upper-constraints.txt. We @@ -113,12 +113,6 @@ else sed -e "s/^${dist_name}=.*;python_version=='$PYTHON_VERSION'/$dist_name===$VERSION;python_version=='$PYTHON_VERSION'/" --in-place upper-constraints.txt sed -e "s/^${canonical_name}=.*;python_version=='$PYTHON_VERSION'/$canonical_name===$VERSION;python_version=='$PYTHON_VERSION'/" --in-place upper-constraints.txt done - # Most projects don't declare Python 3.8 support yet, so update if the - # package declares Python 3.6 support. This follows the logic that - # generate-constraints does - if [[ $PYTHON_3_VERSIONS =~ '3.6' ]] ; then - sed -e "s/^${dist_name}=.*;python_version=='3.8'/$dist_name===$VERSION;python_version=='3.8'/" --in-place upper-constraints.txt - fi # Then only update lines that do not have specific python_versions # specified. sed -e "s/^${dist_name}=.*[0-9]$/$dist_name===$VERSION/" --in-place upper-constraints.txt diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 6600580e07..1313d90494 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -820,6 +820,7 @@ Update constraint files for requirements project with a proposed change. run: playbooks/proposal/propose-update-constraints.yaml + nodeset: ubuntu-noble protected: true dependencies: - release-openstack-python