When upgrading from Gerrit 2.13 to 3.2 we stopped relying on a local
fork of its source and have been building from (more recently
completely unmolested) upstream source. This fork was the only place
we were relying on jeepyb's track-upstream feature, so we can stop
looking for it in our checks and normalization as well.
Remove the check_gerrit_projects_changed scripts as well, as they
only existed to run things where track-upstream was enabled.
Change-Id: I597c1a577c53e2db61413d9ec531378667691d2a
We have python scripts in the tools/ dir the vast majority of which we
run regularly with python3 via our python3 default basepython in tox.
However, most of these use a `python` shebang line which can be
confusing as to whether or not these scripts run under python3 or not.
To make this more clear set them to python3. I've confirmed the scripts
running under tox are happy with these changes. For the ones that don't
run under tox I've done a quick review and they look happy too.
Change-Id: I983d23c33f7780e5708aa728c829c3262fc99ea0
This version of hacking doesn't understand f-strings as usable in
Python 3. Update to the latest and fix current issues, which are all
just formatting fixes.
Change-Id: I0a7d6f93f07477b6dd29ab143130dd9064c250be
So that it's easier to use in our scripts, add some helper sugar.
First, add functions load and dump so that the library can be used
similarly to yaml without the need to construct an object first.
Then, remove the strip parameter and detect whether we're dumping
a list or not. That way people won't forget to pass or not pass
strip.
Change-Id: I204af8a89c37f36f0480de3a2e669b65354eb73c
libyaml now needs to Loader keyword to not throw a warning, use
safe_load instead everywhere.
sort_keys isn't supported for reasons surpassing understanding, so
switch to ruamel.yaml for the places where we write contents back
out.
Our ruamel.yaml wrapper strips extra leading space, which is needed
when the root object is a list. When the root object is NOT a list,
it's not needed. Add a flag to the constructor to toggle the
behavior.
For gerrit/projects.yaml this leads to a different wrapping of
description fields, which is included here.
Let ruamel.yaml handle comments
Since we've switched to ruamel.yaml, we don't need to strip
comments. Stop stripping them. Intra-list comments aren't
supported, so just remove them.
Please don't ask me why we can't have a space before openstack-merlin.
Change-Id: I72776774eabd4e397ee5e8bdd58b3632be8fd3a1
Since the Zuul v2 files are removed, we can lint pep8 with less changes
everywhere. Enable pep8 linting everywhere and fix remaining problems.
Depends-On: Id67d0149b645bd23e460cef65719541f76f0967b
Change-Id: I0ac0709b05912d00d02a51d732b1cf12eaf888a5
fix a "bug" in that the flake8 configuration in tox.ini was exclusively
selecting H231 as the only error it would report, so it was missing the
errors in the python modules (such as submit_log_processor_jobs). Due to
this being the case for a long time (since 2004) limit the more thorough
linting to the roles/ and playbooks/ directories where we'll be adding
ansible plugins/modules/etc. Also, lint in jenkins/script and nodepool.
Fix problems found.
We can lint everything with pep8 once the zuul v2 scripts are removed,
not worth patching them right now.
Change-Id: I479f010643cf3b67c183d763510f07a33400d38b
Co-Authored-By: Jesse Keating <omgjlk@us.ibm.com>
This moves the functions used by normalize_projects_yaml.py out for the
purposes of being imported by multiple scripts.
Change-Id: I76a93124fdbe13bce34a0c5073fa66bc86806c0a