Commit Graph

11 Commits

Author SHA1 Message Date
Jeremy Stanley
ef03e7fa36 Drop use of track-upstream
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
2021-07-06 16:45:22 +00:00
Clark Boylan
180cc6aeda Be more explicit about using python3 to run tools/
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
2020-06-08 16:40:44 -07:00
Ian Wienand
4f6629021e Update hacking, fix errors/warnings
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
2020-01-14 09:40:45 +11:00
Monty Taylor
1ffcd0242e Add some helpers to projectconfig_ruamellib
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
2019-04-10 13:33:52 +00:00
Andreas Jaeger
e7f77f283f Some python yaml fixes
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
2019-04-10 13:33:51 +00:00
Andreas Jaeger
996a0f5b9c Run pep8 everywhere
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
2017-10-21 16:50:07 +00:00
Andreas Jaeger
4adbecad99 Fix flake8
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>
2017-10-21 18:37:10 +02:00
Clint Adams
983626a715 Factor out yaml emitter/dumper functions from normalize_projects_yaml.py
This moves the functions used by normalize_projects_yaml.py out for the
purposes of being imported by multiple scripts.

Change-Id: I76a93124fdbe13bce34a0c5073fa66bc86806c0a
2015-09-28 19:19:13 -04:00
James E. Blair
dfe8b92214 Remove upstreams from projects.yaml
And update the normalization script to do so.

Change-Id: Ia204da5e71e53d8175bc74e957b33db367b58ab4
2015-03-06 21:25:24 +01:00
James E. Blair
59a5567dcc Wrap projects.yaml at 80 characters
And update the normalization script.

Change-Id: I4e56e1372441e5af80a3fda1302e9a569b922ad5
2015-03-06 19:51:20 +00:00
James E. Blair
bb2bba6f56 Normalize Gerrit projects.yaml
Add a script to perform the normalization.

Change-Id: I9ebc75f8a5096fe65f7a30df43e60c67bb943aa0
2015-03-06 20:50:02 +01:00