Changeset - e3ebfa5942bd
[Not reviewed]
0 2 0
Branko Majic (branko) - 6 years ago 2018-07-23 12:47:43
branko@majic.rs
MAR-130: Don't output warnings when missing .txt file for .in file when performing pip requirements upgrade check.
2 files changed with 9 insertions and 3 deletions:
0 comments (0 inline, 0 general)
docs/releasenotes.rst
Show inline comments
 
@@ -27,12 +27,15 @@ New features/improvements:
 
  part of the Ansible upgrade process.
 

	
 
* ``common`` role
 

	
 
  * The ``pip`` requirements upgrade checks are now performed once per
 
    day instead of once per hour.
 
  * The ``pip`` requirements upgrade checks now do not output warning
 
    in case deployed ``.in`` file does not have a matching ``.txt``
 
    file.
 

	
 

	
 
2.0.0
 
-----
 

	
 
Upgrade to Ansible 2.3.x, minor bug fixes and updates needed for the upgrade.
roles/common/files/pip_check_requirements_upgrades.sh
Show inline comments
 
@@ -41,14 +41,17 @@ environment. This allows the checks to be run for multiple virtual environments
 
in a modular manner.
 

	
 
Each sub-directory should contain one or more .in files with corresponding .txt
 
file. Base names must match (i.e. if you have production.in, the requirements
 
file must be called production.txt).
 

	
 
Utility iterates over each .in/.txt pair, calculates new requirements based on
 
the .in file, and diffs this against existing .txt file.
 
Utility iterates over each .in/.txt pair, calculates new requirements
 
based on the .in file, and diffs this against existing .txt file. If a
 
.in file does not have a corresponding .txt file, it is ignored
 
(making it possible to use the '-r base.in' syntax for including base
 
requirements etc).
 

	
 
Utility creates copy of existing requirements file, stripping it from all
 
comments, then calculates new requirements file (storing result in temporary
 
location as well), and runs a diff between them.
 

	
 
If newer pacakges are available that would satisfiy the provided .in file, a
 
@@ -242,13 +245,13 @@ for environment in "$config_dir"/*; do
 
	    continue
 
	fi
 

	
 
	# Figure out if .txt file exists.
 
	req_txt="${req_in%.in}.txt"
 
	if [[ ! -f $req_txt ]]; then
 
	    warning "Missing .txt file for: $req_in"
 
	    [[ $quiet == 0 ]] && info "Skipping input file with missing .txt file: $req_in"
 
	    continue
 
	fi
 

	
 
	# Deploy the existing requirements file and the new one.
 
	sed -e 's/[[:blank:]]*#.*//' "$req_txt" | grep -v "^$" | sort -u > "$tmp_current" 
 
	if ! pip-compile --no-header --no-annotate --no-index --output-file "$tmp_new" --upgrade "$req_in" > /dev/null; then
0 comments (0 inline, 0 general)