releng/lftools.git
18 months agoFix: Correct version label for GHA call 24/71624/1
Andrew Grimberg [Mon, 24 Apr 2023 18:14:00 +0000 (11:14 -0700)]
Fix: Correct version label for GHA call

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: Ia041c727d4787368a0eb26302a89110c047dbb9c

18 months agoFix: Correct bad actions call 84/71584/1
Andrew Grimberg [Tue, 18 Apr 2023 16:23:21 +0000 (09:23 -0700)]
Fix: Correct bad actions call

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I5e960e68368a3471d73776b330d4bb12f489d043

18 months agoMerge "Fix: Correct bad vars definition"
Andrew Grimberg [Mon, 17 Apr 2023 17:03:46 +0000 (17:03 +0000)]
Merge "Fix: Correct bad vars definition"

18 months agoFix: Correct missing steps designator 72/71572/1
Andrew Grimberg [Mon, 17 Apr 2023 16:55:34 +0000 (09:55 -0700)]
Fix: Correct missing steps designator

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I7412fafa1d91d464e367209215c6a50861f27bd4

18 months agoFix: Correct bad vars definition 65/71565/1
Andrew Grimberg [Sat, 15 Apr 2023 13:40:34 +0000 (06:40 -0700)]
Fix: Correct bad vars definition

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: Ie1a1ee5e12cdae56c5108824e3e755a536afd764

19 months agoCI: Optimize GHA verify job 49/71549/1
Andrew Grimberg [Wed, 12 Apr 2023 19:08:07 +0000 (12:08 -0700)]
CI: Optimize GHA verify job

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I6410121b35edf484a476ae0438c86fc8fbca2d28

19 months agoCI: Add release workflow for tags 46/71546/3
Andrew Grimberg [Wed, 12 Apr 2023 17:35:02 +0000 (10:35 -0700)]
CI: Add release workflow for tags

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I32708d17966a7782e65bdf66c152e4e9ac89fda2

19 months agoCI: Enable sysstat 48/71548/1
Andrew Grimberg [Wed, 12 Apr 2023 18:35:33 +0000 (11:35 -0700)]
CI: Enable sysstat

Test for lftools require that sysstat be running as sar is called

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I0e53f40a36f66a630d8d1a4469e39b811aab951b

19 months agoCI: Remove python 3.6 checks 47/71547/1
Andrew Grimberg [Wed, 12 Apr 2023 17:42:43 +0000 (10:42 -0700)]
CI: Remove python 3.6 checks

GHA default runners will not install python 3.6, remove it as an option.

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: Ia9b54001fb1d6b774796735be0b0a7dde7f70ee3

19 months agoCI: Add GitHub Actions verify 45/71545/1
Andrew Grimberg [Wed, 12 Apr 2023 17:02:16 +0000 (10:02 -0700)]
CI: Add GitHub Actions verify

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I5f37fa7d4cf278d48e4b6eae38f9f477781c36e3

19 months agoCI: Add tox publish environment 44/71544/1
Andrew Grimberg [Wed, 12 Apr 2023 16:59:57 +0000 (09:59 -0700)]
CI: Add tox publish environment

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I5a7158668f3418dbba2d09d71c0d32adbc17ddfe

19 months agoCI: Add tox build,clean environments 43/71543/1
Andrew Grimberg [Wed, 12 Apr 2023 16:58:24 +0000 (09:58 -0700)]
CI: Add tox build,clean environments

* Add the tox build and clean environments
* Add additional gitignore to deal with build artifacts

Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I26df479ac9f0a6177c345fd3a9bdd3dbb4bc9f49

19 months agoChore: Clean-up pre-commit issues 42/71542/1
Andrew Grimberg [Wed, 12 Apr 2023 16:17:04 +0000 (09:17 -0700)]
Chore: Clean-up pre-commit issues

Pre-commit issues all need to be clean before GitHub Actions can be
setup.

Issue: RELENG-4689
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I4f08a7ed8f05caaa9430b50bc83aeceb8f4fd71e

19 months agoChore: Update pre-commit hooks 41/71541/1
Andrew Grimberg [Wed, 12 Apr 2023 14:44:39 +0000 (07:44 -0700)]
Chore: Update pre-commit hooks

* github.com/pre-commit/pre-commit-hooks: updating v4.3.0 -> v4.4.0
* github.com/jorisroovers/gitlint: v0.17.0 -> v0.19.1
* github.com/ambv/black: 22.8.0 -> 23.3.0
* github.com/PyCQA/isort: 5.10.1 -> 5.12.0
* github.com/PyCQA/flake8: 3.9.2 -> 6.0.0
* github.com/pre-commit/mirrors-mypy: v0.971 -> v1.2.0

Issue: RELENG-4387
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I244f85858511ea039e35afddfd05c29b59f7523f

19 months agoChore: Use C8 build node for new project creation jobs 54/71454/1
Jessica Wagantall [Tue, 28 Mar 2023 16:58:31 +0000 (09:58 -0700)]
Chore: Use C8 build node for new project creation jobs

ONAP needs to use Centos8 build nodes in new automated project
yaml file creation.

Issue: RELENG-4659
Change-Id: I2dad2d7d26dc0690b98c5c15f42075a46b31fa97
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
19 months agoChore: rm py2.7 and add py3.8 and py3.9 support 30/71430/1
Anil Belur [Tue, 21 Mar 2023 11:24:16 +0000 (16:54 +0530)]
Chore: rm py2.7 and add py3.8 and py3.9 support

Update the PyPI setup config to remove Python 2.x support
since it is EOL and add support for Python 3.8, 3.9.

Change-Id: Ie7595bbd4a5673bdeef123a34a7d08b73a03d0c5
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
19 months agoFix: Remove shade deps from tox 24/71424/2 v0.37.3
Anil Belur [Fri, 17 Mar 2023 16:59:31 +0000 (22:29 +0530)]
Fix: Remove shade deps from tox

Shade libs are deprecated therefore no longer required
to be installed. Remove whitespaces in EOL.

Issue-ID: RELENG-4644
Change-Id: I06226186cc80d5cb6da41b35f7a9fdf8309bf32d
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
19 months agoFix: Replace shade library with openstacksdk 23/71423/6
Bengt Thuree [Fri, 17 Mar 2023 12:25:44 +0000 (23:25 +1100)]
Fix: Replace shade library with openstacksdk

The shade library has been depreciated. Replace shade library
with openstacksdk for remaining openstack commands.

Issue-ID: RELENG-4644
Ref: https://docs.openstack.org/releasenotes/shade/stein.html
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Change-Id: Ie45f6ba7862a1bd3f471d469286b042512604c54

23 months agoMerge "Fix: Replace v1 dockerhub api with v2 json files" v0.37.2
Eric Ball [Wed, 7 Dec 2022 16:12:38 +0000 (16:12 +0000)]
Merge "Fix: Replace v1 dockerhub api with v2 json files"

23 months agoFix: Replace v1 dockerhub api with v2 json files 86/70986/6
Bengt Thuree [Thu, 10 Nov 2022 05:31:57 +0000 (16:31 +1100)]
Fix: Replace v1 dockerhub api with v2 json files

Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
Change-Id: Iac2e23671bb421745099a1b4cbc56187ab39474f

23 months agoFix: Improve parameter handling in os/image cleanup 70/70970/10 v0.37.1
Matthew Watkins [Mon, 7 Nov 2022 16:55:51 +0000 (16:55 +0000)]
Fix: Improve parameter handling in os/image cleanup

Issue: RELENG-4467
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Change-Id: If91463f83c4be698415e695a83f10f416e379dac

2 years agoFix: Correct file path and url parsing 43/70743/3 v0.37.0
Eric Ball [Tue, 27 Sep 2022 21:07:17 +0000 (14:07 -0700)]
Fix: Correct file path and url parsing

These two bugs are both blocking our info-master job, so they are
being grouped together. One is an issue with using an absolute rather
than relative file path when adding a file to git. The other is
parsing the url with safe slashes, which was causing issues with
creation of repos that have slashes in the name.

Issue: RELENG-4461
Change-Id: Ia63ffc5f157bfb5285e8c6bdb2274a91a384a3f4
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
2 years agoFix: Mislabelling of function description 70/70570/2
Matthew Watkins [Tue, 30 Aug 2022 14:43:44 +0000 (15:43 +0100)]
Fix: Mislabelling of function description

Issue: RELENG-4391
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Change-Id: I65b4b14604c8b536ee5663a43b3b004f701e5660

2 years agoCI: Enable pre-commit validation via MyPy 48/70548/1
Andrew Grimberg [Fri, 26 Aug 2022 20:19:43 +0000 (13:19 -0700)]
CI: Enable pre-commit validation via MyPy

Start enforcing proper annotation defintions by way of MyPy validation

Issue: RELENG-4388
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I2776f4f578856da4478637a33711a47a4ba2ef1a

2 years agoRefactor: Cleanup MyPy errors 47/70547/1
Andrew Grimberg [Fri, 26 Aug 2022 20:15:40 +0000 (13:15 -0700)]
Refactor: Cleanup MyPy errors

While preparing to start enforcing MyPy validation by way of pre-commit
several redeclarations of click command / functions were found. After
examining the errors from MyPy these were determined to be faulty in how
they were being implemented. They were not caught before as no linter
was in place that could easily catch it.

Issue: RELENG-4388
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I35c2502cb08f5502fb30e3d14ac083c30209635c

2 years agoChore: Update pre-commit hooks 46/70546/3
Andrew Grimberg [Fri, 26 Aug 2022 18:07:40 +0000 (11:07 -0700)]
Chore: Update pre-commit hooks

* github.com/pre-commit/pre-commit-hooks: v4.0.1 -> v4.3.0
* github.com/jorisroovers/gitlint: v0.15.1 -> v0.17.0
* github.com/ambv/black: 21.8b0 -> 22.6.0
* github.com/PyCQA/isort: 5.9.3 -> 5.10.1

* Update tox pre-commit environment to be py37 for base python matching
  our global minver, this is required to get pre-commit to properly
  install under tox

Issue: RELENG-4387
Change-Id: Iffaf00c6100237141140ba5524068964c406c8cc
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
2 years agoCI: Require RELENG changes in commit messages 14/70514/1
Andrew Grimberg [Wed, 17 Aug 2022 17:38:03 +0000 (10:38 -0700)]
CI: Require RELENG changes in commit messages

To make sure that JSD issues are not being referenced since that is not
public data, we will now start enforcing a requirement that commits have
a RELENG issue associated with them.

Issue: RELENG-4375
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: Ibd30e0f0f1b0ab5393dfd84bf080ab6671936c85

2 years agoFix: Bugs in git.gerrit on nexus3 and sanity_check 05/70505/1 v0.36.2
Eric Ball [Mon, 15 Aug 2022 21:10:42 +0000 (14:10 -0700)]
Fix: Bugs in git.gerrit on nexus3 and sanity_check

Issue: RELENG-4366
Change-Id: I88f71ea3ffe746b46a5ee599db99aeee0e9bd3e8
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
2 years agoFix: Gerrit create_project check results 62/70462/1
Eric Ball [Mon, 8 Aug 2022 14:59:17 +0000 (07:59 -0700)]
Fix: Gerrit create_project check results

The create_project method is not hitting the correct URL, but will
still often receive HTML from the server and a 200 status. We need to
check the validity of the returned data, and use the status of a bad
return as the exit code so that scripts can properly react to the
error encountered.

Issue: RELENG-4355
Change-Id: Icc3a769f0fa9aba61142bef11bd81821e1fa5356
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
2 years agoMerge "Fix: Print upload size with deploy nexus stage"
Andrew Grimberg [Mon, 6 Jun 2022 21:56:14 +0000 (21:56 +0000)]
Merge "Fix: Print upload size with deploy nexus stage"

2 years agoFeat: Add get-private-keys to lftools.jenkins 86/70186/4
Anil Belur [Wed, 25 May 2022 01:35:09 +0000 (11:35 +1000)]
Feat: Add get-private-keys to lftools.jenkins

Add ``get-private-keys`` to lftools.jenkins.

The ``get-private-keys`` command retrives the private keys and passphrases
stored in the credential store. This feature will add the
command ``get-private-keys`` in order to print these values.

Issue-ID: RELENG-4245
Change-Id: Iff0cab0b14d43bea540ca513ade08a5e330836e4
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
2 years agoFix: Print upload size with deploy nexus stage 37/70037/2
Anil Belur [Sun, 7 Nov 2021 06:18:04 +0000 (16:18 +1000)]
Fix: Print upload size with deploy nexus stage

Print upload size in the logs after deploying Nexus
stage repositories. This is useful while comparing
the repository sizes.

Change-Id: Ie8cff4ae6e026177cd43c309d4f3a36bab9c7beb
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
2 years agoFix: INFO job template and sanity_check call 35/70035/2 v0.36.1
Eric Ball [Fri, 15 Apr 2022 13:07:43 +0000 (06:07 -0700)]
Fix: INFO job template and sanity_check call

The INFO job template was improperly formatted. The sanity_check call
is to a class method, and requires and positional argument for "self"
(this does not need to contain anything; it is just filler in this
case).

Change-Id: I1dcbc456bf31e907821ab4c5aee7c324dbd70722
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
2 years agoFix: Do not fail tox if gerrit.acumos.org is down 00/70000/1
Bengt Thuree [Tue, 12 Apr 2022 12:55:41 +0000 (22:55 +1000)]
Fix: Do not fail tox if gerrit.acumos.org is down

Issue-Id: RELENG-4181
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
Change-Id: I3a1228e77fd7fdc0ae723c26cff420da8f299fa3

2 years agoFix: Force delay (take 2) between docker get calls 05/69905/2
Bengt Thuree [Thu, 24 Mar 2022 08:54:50 +0000 (19:54 +1100)]
Fix: Force delay (take 2) between docker get calls

Docker has introduced a 429 error return code
if there site is called to quickly.

Retry after 60 seconds after every 429 return code,
up to 19 times. Then fail.

Issue-ID: RELENG-3711

Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
Change-Id: I51d23fa9a2da1dc7cc30afceae4f35942bb42182

2 years agoMerge "Fix: Force delay between docker get calls"
Andrew Grimberg [Wed, 23 Mar 2022 20:16:19 +0000 (20:16 +0000)]
Merge "Fix: Force delay between docker get calls"

2 years agoFix: Force delay between docker get calls 84/69884/1
Bengt Thuree [Wed, 23 Mar 2022 04:09:06 +0000 (15:09 +1100)]
Fix: Force delay between docker get calls

Docker has introduced a 429 error return code
if there site is called to quickly.

Delay 0.5 seconds after every pull, to avoid to fast requests.

Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
Issue-ID: RELENG-3711
Change-Id: Ic5ac8da65903c0445092d74168ff9fd1dc0068bd

2 years agoFeat: New method add_maven_config for JCasC config 02/69802/4 v0.36.0
Eric Ball [Fri, 4 Mar 2022 20:21:19 +0000 (12:21 -0800)]
Feat: New method add_maven_config for JCasC config

This method allows for adding settings files for new projects via
JCasC, rather than the old method of using a Groovy script to manually
add the file to Jenkins.

This also removes the __del__ function. The function was not entirely
necessary, and was causing issues with unit testing. All work is done
in /tmp, so these files will be automatically cleaned by the system.

Issue: RELENG-3893
Change-Id: I03511b9c3e1c9f9c9f79054bd6f8991cd274e8f5
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
2 years agoFeat: Move git functions to use python git lib 17/69717/9
Eric Ball [Wed, 2 Feb 2022 23:33:03 +0000 (15:33 -0800)]
Feat: Move git functions to use python git lib

Issue: RELENG-4052
Change-Id: Iafaa078b24838135dd67ec0ac53b1d83de13ae8b
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
2 years agoTest: Speed up Nexus tests 20/69720/3
Eric Ball [Tue, 22 Feb 2022 18:58:04 +0000 (10:58 -0800)]
Test: Speed up Nexus tests

By patching the sleep function, we can remove about 25 seconds of
pauses during unit testing of release_staging_repos method.

Issue: RELENG-4052
Change-Id: I8692c1183d70873348616435074b9b69193dda41
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
2 years agoFeat: Add get-secrets to lftools.jenkins 23/69623/1
Eric Ball [Thu, 3 Feb 2022 00:13:31 +0000 (16:13 -0800)]
Feat: Add get-secrets to lftools.jenkins

Get-credentials only produces username/password credentials, which
does not include "secret text" stores. This feature will add the
command "get-secrets" in order to print these as well.

Change-Id: Iac1911b486be1dc125a42b23595431c7065adfce
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
3 years agoFix: Create temp file in empty dirs for S3 log dir 93/68993/17 v0.35.11
Anil Belur [Wed, 20 Oct 2021 03:32:44 +0000 (13:32 +1000)]
Fix: Create temp file in empty dirs for S3 log dir

Since S3 buckets does not have an underlying file system to view empty
directories, an temp file has to be created when referencing the directory.
This allows empty folders to be viewed through cloudfront, without
returning a 404 error.

Create temp file in the format: "_%d%m%Y_%H%M%S", would
help with future clean or debugging.

Issue-ID: RELENG-4016
Change-Id: I0a635cd32da860deaada0ac0cc15bf1aa5fc2d4a
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
3 years agoChore: Configure Flake8 linter 91/68391/8
Thanh Ha [Sat, 31 Jul 2021 11:47:00 +0000 (07:47 -0400)]
Chore: Configure Flake8 linter

This adds Flake8 to pre-commit and removes the unused config in tox.ini.
Not sure why Flake8 was disabled but config in tox.ini suggests that
it was there at one point.

Change-Id: I93c9a6e4562f957f75f28a3842ae29eb8df67fb9
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
3 years agoRefactor: Resolve remaining flake8 violations 62/68962/1
Thanh Ha [Sat, 9 Oct 2021 14:39:41 +0000 (10:39 -0400)]
Refactor: Resolve remaining flake8 violations

- E304 blank lines found after function decorator
- E402 module level import not at top of file
- E741 ambiguous variable name 'l'
- F522 '...'.format(...) has unused named argument(s): end
- W601 .has_key() is deprecated, use 'in'

Change-Id: I2607e7bb195f6175a7b331e89870fa23e225e31c
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
3 years agoRefactor: Resolve F811 and E712 and E501 in tests 61/68961/1
Thanh Ha [Sat, 9 Oct 2021 14:33:11 +0000 (10:33 -0400)]
Refactor: Resolve F811 and E712 and E501 in tests

- E501 line too long
- E712 comparison to True should be 'if cond is True:' or 'if cond:'
- E712 comparison to False should be 'if cond is False:' or 'if not cond:'
- F811 redefinition of unused 'test_log_and_exit' from line 26

Change-Id: I896e994b26d62c7bdd85ca61ebf1b9d2df9e8b1e
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
3 years agoRefactor: Resolve Flake8 F401 and F403 and F405 43/68943/2
Thanh Ha [Tue, 5 Oct 2021 23:25:12 +0000 (19:25 -0400)]
Refactor: Resolve Flake8 F401 and F403 and F405

It's bad practice to use * imports (F405) since the methods or
variables being imported could be undefined. Explicitly importing
makes this more clear. Also F403 violation makes it difficult to
detect undefined names.

Additionally F401 violation to allow an indirect module import makes
things harder to debug. It's better to be explicit.

https://www.flake8rules.com/rules/F401.html
https://www.flake8rules.com/rules/F403.html
https://www.flake8rules.com/rules/F405.html

Change-Id: Ib938f865d3ac6456216a119c830d3b013932bf88
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
3 years agoMerge "Refactor: Resolve flake8 E722 bare except"
Andrew Grimberg [Tue, 5 Oct 2021 20:09:08 +0000 (20:09 +0000)]
Merge "Refactor: Resolve flake8 E722 bare except"

3 years agoRefactor: Resolve flake8 E722 bare except 36/68936/2
Thanh Ha [Tue, 5 Oct 2021 16:17:02 +0000 (12:17 -0400)]
Refactor: Resolve flake8 E722 bare except

It is considered bad practice to use a bare except as this kind
of except statement can have untended consequences such as disabling
ctrl+c interrupts. At the vary least we should use Exception however
a more specific one would be better. This PR uses the general Exception
to resolve the linter which we can add more specific ones later when
we can appropriately unit test the code.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I9afcff49f34326d279a63ce972d12f9aa72f18e2

3 years agoRefactor: Resolve W605 Invalid escape sequence 37/68937/2
Thanh Ha [Tue, 5 Oct 2021 16:27:09 +0000 (12:27 -0400)]
Refactor: Resolve W605 Invalid escape sequence

W605 is deprecated and will become a syntax error in Python 3.8
(https://www.flake8rules.com/rules/W605.html).

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: Ic2a51f089ef9d6fc45a3db5e96a8f5196d59f02c

3 years agoMerge "Fix: Incorrect indent skips calling deploy_s3()" v0.35.10
Bengt Thuree [Thu, 2 Sep 2021 05:25:52 +0000 (05:25 +0000)]
Merge "Fix: Incorrect indent skips calling deploy_s3()"

3 years agoFix: Incorrect indent skips calling deploy_s3() 83/68683/1
Anil Belur [Thu, 2 Sep 2021 02:55:57 +0000 (12:55 +1000)]
Fix: Incorrect indent skips calling deploy_s3()

When Unix style glob patterns are passed through the CLI option
the deploy_s3() function skips the step to push logs to the S3 bucket.

Issue-Id: RELENG-3866
Change-Id: I58d6ef8dab41213fdbc431294ddd21854adc60dc
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
3 years agoChore: Upgrade pre-commit hooks 79/68679/1
Andrew Grimberg [Wed, 1 Sep 2021 18:07:33 +0000 (11:07 -0700)]
Chore: Upgrade pre-commit hooks

* github.com/ambv/black: updating 21.7b0 -> 21.8b0

Change-Id: I4a2374c5e589c4adbfdc9e8e82cb7fc099acaa8c
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
3 years agoFix: typo in deploy.py 97/68597/1 v0.35.9
pmikus [Mon, 23 Aug 2021 10:37:58 +0000 (10:37 +0000)]
Fix: typo in deploy.py

Typo error in xml mimetype deploy to S3 storage. Thais patch remove the
extra sign to correctly map mimetype to content-type.

Signed-off-by: pmikus <peter.mikus@protonmail.ch>
Change-Id: Ia88ac75f483b31312ae72cc104021ab9efda6455

3 years agoMerge "Fix: Refactor image clean" v0.35.8
Andrew Grimberg [Mon, 16 Aug 2021 22:19:38 +0000 (22:19 +0000)]
Merge "Fix: Refactor image clean"

3 years agoFix: Refactor image clean 31/68531/3
Anil Belur [Fri, 13 Aug 2021 13:20:08 +0000 (23:20 +1000)]
Fix: Refactor image clean

Refactor image cleanup code to handle attribute types and
multi-clouds config correctly.

Error:
AttributeError: 'Connection' object has no attribute 'cloud_config'

Issue-ID: RELENG-3869
Change-Id: If6dd04507f6eb94786f6589299ce31f62a009b84
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
3 years agoMerge "Refactor: Fix flake8 F841"
Eric Ball [Sat, 14 Aug 2021 00:54:06 +0000 (00:54 +0000)]
Merge "Refactor: Fix flake8 F841"

3 years agoRefactor: Fix flake8 F841 28/68528/2
Thanh Ha [Fri, 13 Aug 2021 01:17:36 +0000 (21:17 -0400)]
Refactor: Fix flake8 F841

Resolves "F841 local variable ____ is assigned to but never used".

Change-Id: I4ab246dd96c96f2fdf33bae1d7d6b2d2c6fe6190
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
3 years agoFix: Move text/html mimetype check to after None 29/68529/2 v0.35.7
Eric Ball [Fri, 13 Aug 2021 01:40:17 +0000 (18:40 -0700)]
Fix: Move text/html mimetype check to after None

When checking mimetype during _upload_to_s3, the newly-added
text/html type was checking before it is checked for None, which is a
potential TypeError.

By moving it after the variable is checked for None, the feature is
safe without requiring any further modifications.

Change-Id: Ia945893adb8973608cb9527b4ea811a5610d6aba
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
3 years agoFix: Add text/html mimetype to handle s3 logs 08/68508/1 v0.35.6
pmikus [Tue, 10 Aug 2021 11:31:16 +0000 (11:31 +0000)]
Fix: Add text/html mimetype to handle s3 logs

Currently html files in S3 bucket are not rendered properly
via Cloudfront as they are sent with text/plain content-type.
This patch is setting up content-tyepe for html for text/html.

Signed-off-by: pmikus <peter.mikus@protonmail.ch>
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Change-Id: Id8a26f77446890320b212522236b68552d73c425

3 years agoMerge "Test: Improve unit test for nexus"
Andrew Grimberg [Tue, 3 Aug 2021 14:49:36 +0000 (14:49 +0000)]
Merge "Test: Improve unit test for nexus"

3 years agoTest: Improve unit test for nexus 02/68402/2
Eric Ball [Fri, 30 Jul 2021 22:45:05 +0000 (15:45 -0700)]
Test: Improve unit test for nexus

When waiting for a repo to complete releasing, a more realistic
"activity" return is to have the "release" status in place, but
without the "stopped" property (which is not added until the repo is
finished releasing). This improved unit test would have caught the
bug addressed by commit e083184d.

Change-Id: I0827cdaad07a8fb94d0f266dc8e53fd69c4aab2d
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
3 years agoMerge "Refactor: Fix F401 module imported but unused"
Andrew Grimberg [Sat, 31 Jul 2021 14:19:10 +0000 (14:19 +0000)]
Merge "Refactor: Fix F401 module imported but unused"

3 years agoMerge "Chore: Remove botocore from requirements.txt"
Andrew Grimberg [Sat, 31 Jul 2021 14:18:04 +0000 (14:18 +0000)]
Merge "Chore: Remove botocore from requirements.txt"

3 years agoMerge "Refactor: Fix E713 form should be "not in""
Andrew Grimberg [Sat, 31 Jul 2021 14:17:48 +0000 (14:17 +0000)]
Merge "Refactor: Fix E713 form should be "not in""

3 years agoRefactor: Fix F401 module imported but unused 92/68392/1
Thanh Ha [Sat, 31 Jul 2021 12:01:18 +0000 (08:01 -0400)]
Refactor: Fix F401 module imported but unused

A module has been imported but is not used anywhere in the file.
The module should either be used or the import should be removed.

Ref: https://www.flake8rules.com/rules/F401.html
Change-Id: I3e73260628bdbeccab2a7dd78215aa83a2ee71ff
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
3 years agoChore: Remove botocore from requirements.txt 90/68390/1
Thanh Ha [Sat, 31 Jul 2021 11:44:23 +0000 (07:44 -0400)]
Chore: Remove botocore from requirements.txt

This is a transitive dependency of boto3, no need to explicitly
require it unless we are trying to pin the version.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I0ce2d72082707a969d8b4841957f6dd761c7c6a0

3 years agoRefactor: Fix E713 form should be "not in" 89/68389/1
Thanh Ha [Sat, 31 Jul 2021 03:53:40 +0000 (23:53 -0400)]
Refactor: Fix E713 form should be "not in"

Tests for membership should use the form x not in the_list
rather than not x in the_list. The former example is simply
more readable.

Ref: https://www.flake8rules.com/rules/E713.html
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I3ab1811c2a6b7e6135397e694b4ec4a1ab980c93

3 years agoRefactor: Fix Flake8 E711 87/68387/2
Thanh Ha [Fri, 30 Jul 2021 22:36:22 +0000 (18:36 -0400)]
Refactor: Fix Flake8 E711

Comparisons to the singleton objects, like True, False, and None,
should be done with identity, not equality. Use “is” or “is not”

Ref: https://www.flake8rules.com/rules/E711.html
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I33e80228341b93bdeb6cae1b587b8b19275c589d

3 years agoChore: Enable black for lftools 86/68386/1
Thanh Ha [Fri, 30 Jul 2021 22:31:07 +0000 (18:31 -0400)]
Chore: Enable black for lftools

Not sure why lftools was excluded but it effectively disabled black
in all of lftools defeating the purpose of having it in pre-commit
in the first place.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I60b3832cb180574e114b2dca78c0376a14c6d66e

3 years agoChore: Add isort to Python linters 81/68381/2
Thanh Ha [Fri, 30 Jul 2021 18:26:47 +0000 (14:26 -0400)]
Chore: Add isort to Python linters

ISort is an automatic import sorter for Python. More details at
the ISort GitHub page (https://github.com/PyCQA/isort).

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I2eaff523fab0966ea7196037669a1c603c68cd3e

3 years agoFix: Add check for "stopped" before reading text 52/68352/5 v0.35.5
Eric Ball [Wed, 28 Jul 2021 13:33:12 +0000 (06:33 -0700)]
Fix: Add check for "stopped" before reading text

nexus.release_staging_repo has an error condition if the staging repo
is not released when checked, as a non-existent "stopped" field will
return a NoneType, causing an error when .text is read. We avoid this
by checking for the existence of the "stopped" field before attempting
to read the text.

Issue: RELENG-3813
Change-Id: I0fae854a3ee52118806f70ea8b6faacc5fda430b
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
3 years agoFix: Don't exit on error while collecting data for _sys-info.log 15/68315/2 v0.35.4
Dave Wallace [Thu, 22 Jul 2021 18:54:11 +0000 (14:54 -0400)]
Fix: Don't exit on error while collecting data for _sys-info.log

Change-Id: Ic3ed23b727b4663f01e52205641b23505518d3b9
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
3 years agoFix: Nexus release logic and naming, add unit test 06/68306/4 v0.35.3
Eric Ball [Wed, 21 Jul 2021 23:13:45 +0000 (16:13 -0700)]
Fix: Nexus release logic and naming, add unit test

nexus.release_staging_repos was failing with an error due to an
undeclared variable. Several other issues were identified and fixed
(see release note for details), and a unit test has been added to
help prevent similar issues in the future.

Issue: RELENG-3804
Change-Id: I8b7e4adf4561541acffa1dc81dbeba35d7783e51
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
3 years agoChore: Unpin requirements 95/68295/2 v0.35.2
Eric Ball [Wed, 14 Jul 2021 21:21:39 +0000 (14:21 -0700)]
Chore: Unpin requirements

Having all requirements pinned was causing problems with dependency
resolution in pip. This worked fairly well in older versions, but
newer versions of pip are more strict in how they handle dependencies
of multiple packages. This was causing v0.31.1, the last version with
unpinned requirements, to be installed in cases where lftools was
installed alongside packages with conflicting requirements.

Issue: RELENG-3792
Change-Id: Ie8fb0dac45da5d3fba803ef66e216341516bc3ab
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
3 years agoMerge "Refactor: Update setup.cfg due to deprecations"
Eric Ball [Fri, 9 Jul 2021 23:39:13 +0000 (23:39 +0000)]
Merge "Refactor: Update setup.cfg due to deprecations"

3 years agoRefactor: Update setup.cfg due to deprecations 75/68175/1
Andrew Grimberg [Tue, 29 Jun 2021 20:53:08 +0000 (13:53 -0700)]
Refactor: Update setup.cfg due to deprecations

While working on a few other updates it was noticed that tox was giving
deprecations warnings related to values in setup.cfg. This therefore
updates the keys with the new non-deprecated values.

Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I04c526c5799a6a5da1ea6aae8a56ab4fc07d7465

3 years agoCI: Properly run gitlint in CI 62/68162/3
Andrew Grimberg [Mon, 28 Jun 2021 17:32:58 +0000 (10:32 -0700)]
CI: Properly run gitlint in CI

When running pre-commit in a CI system the COMMIT_EDITMSG does not
(normally) get created as that is an artifact of editing the commit
message. If the file doesn't exist then gitlint will skip which makes it
possible for pre-commit checks that should fail, to pass.

Since we want tox to run in a consistent manner both locally and in CI
we need to play around a little with how we are checking the commit
message.

Change-Id: I25c1815ea3195e47a67b529a06497ad3594b2c84
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
3 years agoCI: Configure gitlint for Conventional Commits 61/68161/3
Andrew Grimberg [Mon, 28 Jun 2021 17:30:05 +0000 (10:30 -0700)]
CI: Configure gitlint for Conventional Commits

Turn on Conventional Commit message subject validation. This will affect
CI specifically, but developers can avoid having CI fail by assuring
that they have installed pre-commit and that they have also run

pre-commit install --hook-type commit-msg

The above is needed because pre-commit does not install commit-msg hooks
by default

Change-Id: Ifa301f8f6b8fa5c5838934b8ffcfa47e746cd95d
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
3 years agoChore: Upgrade pre-commit hooks 60/68160/2
Andrew Grimberg [Mon, 28 Jun 2021 17:28:24 +0000 (10:28 -0700)]
Chore: Upgrade pre-commit hooks

This change also includes style updates enforced by black that have to
come in _with_ the upgrade.

Change-Id: I68eebed11c5aca19d530104ae1164c42371d4851
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
3 years agoRefactor: Migrate shade library to openstacksdk 29/67729/4
Chandra Dasari [Fri, 14 May 2021 13:54:55 +0000 (09:54 -0400)]
Refactor: Migrate shade library to openstacksdk

Replacing shade library with openstacksdk for openstack image commands.

Signed-off-by: Chandra Dasari <cdasari@contractor.linuxfoundation.org>
Change-Id: I23f901de37d502674edc617784ad3095dbc38288
Issue: RELENG-3392

3 years agoMerge "Modified printouts when releasing staging repo."
Andrew Grimberg [Mon, 12 Apr 2021 16:11:39 +0000 (16:11 +0000)]
Merge "Modified printouts when releasing staging repo."

3 years agoCheck dco_signoffs files for missing DCO hashes 31/66831/4
Eric Ball [Thu, 18 Feb 2021 23:48:42 +0000 (15:48 -0800)]
Check dco_signoffs files for missing DCO hashes

When checking for missing DCOs, any hashes found to be documented in
the dco_signoffs (or a user-specified alternative) directory will no
longer be included in the missing list.

Some formatting improvements have also been made to the relevant
files, particularly removing unnecessary #noqa and #nosec directives,
which were not affecting pylint scores.

Issue: RELENG-3396
Change-Id: I7cdac03fb406c6ce862b997c01fb0fab7cfecd76
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
3 years agoModified printouts when releasing staging repo. 96/66796/1
Bengt Thuree [Wed, 17 Feb 2021 05:30:22 +0000 (16:30 +1100)]
Modified printouts when releasing staging repo.

Modified printouts to be more human friendly.
Still waiting every 20 seconds.
Checking result every 40 seconds.

Issue-Id: RELENG-3398

Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
Change-Id: I7abc4b8fe612d14939ed0dd0c2d70f9a4ecf1774

3 years agoReplace print statements with log 91/66391/1
Anil Belur [Tue, 5 Jan 2021 04:37:55 +0000 (14:37 +1000)]
Replace print statements with log

Issue: RELENG-3244
Change-Id: I389658ee3e85f34a87d5799f58db07d1b1236f1d
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
4 years agoMerge "Add user regexp for version tag validation"
Andrew Grimberg [Tue, 27 Oct 2020 18:46:55 +0000 (18:46 +0000)]
Merge "Add user regexp for version tag validation"

4 years agoCheck ownerid and visibility on image cleanup 91/65791/5 v0.35.1
Anil Belur [Sat, 17 Oct 2020 03:16:50 +0000 (13:16 +1000)]
Check ownerid and visibility on image cleanup

Recently update on the cloud provider caused the builder-cron-openstack
job to break, which exposed a bug in our cleanup scripts.

Check the visibility and ownerid of the image before attempting to
remove and image.

Issue: RELENG-3239
Change-Id: I38098c45fe73e872f3ca96960f704f168d9c4596
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
4 years agoAdd create saml group to gerrit api 98/65698/11 v0.35.0
Aric Gardner [Tue, 6 Oct 2020 19:13:23 +0000 (15:13 -0400)]
Add create saml group to gerrit api

Project creation now needs an additional step
we must create a saml group.

Project creation now automatically
reformats your ldap group into a saml group

Also add error handling for unauthorized
when trying to see if a project exists

Issue-Id: RELENG-3231
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I72d8949331ecc66d320be5a1960f769ebfb2d962

4 years agoAdd user regexp for version tag validation 22/65222/6
Bengt Thuree [Fri, 28 Aug 2020 07:05:06 +0000 (17:05 +1000)]
Add user regexp for version tag validation

This patch adds the possibility to change the Version Schema.
This is done by the --version_regexp <regexp> parameter.
If this parameter is not used, then the default #.#.#
("^\d+.\d+.\d+$") regexp will be used.

The <regexp> could be an regexp expression or a filename pointing
to a file containing an regexp.

Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
Change-Id: I0099977f74c0da6bb87795111a48771fb3be4cd6

4 years agoAdd --repofile to releasedockerhub 15/63615/12
Bengt Thuree [Tue, 7 Apr 2020 01:39:46 +0000 (11:39 +1000)]
Add --repofile to  releasedockerhub

Enables providing a file with the repo names.

   -f, --repofile  Repo Name is a file name,
                   which contains one repo per row

ISSUE: RELENG-2553
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
Change-Id: I74a6eb5b95e1fef7d70d1e500c6df706b2eab8c9

4 years agoPreform check that disk-format maches 55/64955/5
Aric Gardner [Thu, 6 Aug 2020 20:18:10 +0000 (16:18 -0400)]
Preform check that disk-format maches

check that the disk format of the image to be uploaded
matches the disk-format specified by the user.
(default raw)

Issue-ID: RELENG-3149
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: Ia989e53d2f4fc8ca541f68e17ea8d2663dd7bff4

4 years agoChange ci-managed filter default to false 54/64954/1
Aric Gardner [Thu, 6 Aug 2020 19:44:00 +0000 (15:44 -0400)]
Change ci-managed filter default to false

ODL does not tag images as ci-mangaged and its confusing
for the user to have nothing returned.

Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: Ib6e4fb15b0f211efde4b41ecb3d78327c1a8b4d9

4 years agoFix: openstack image upload defaults to qcow2 92/64792/3 v0.34.2
Aric Gardner [Tue, 28 Jul 2020 18:01:49 +0000 (14:01 -0400)]
Fix: openstack image upload defaults to qcow2

Openstack cmd and upload should default to raw not qcow.
builds were timing out. Internally ceph is converting from
qcow2 to raw. Which can cause the time outs.

Issue-ID: RELENG-3102
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I78b2fe7bcc6e6f631013cf1d58455cf17cbea291

4 years agoPin osc-lib to 2.2.0 to allow sharing images 03/64703/3
Anil Belur [Mon, 27 Jul 2020 01:37:17 +0000 (11:37 +1000)]
Pin osc-lib to 2.2.0 to allow sharing images

Using lftools openstack image share returns an error
"You are not authorized to find project with the name".
The issue is with osc_lib bug [1] resolved in osc_lib==2.2.0

[1] https://bugs.launchpad.net/ubuntu/+source/python-openstackclient/+bug/1864203
[2] https://opendev.org/openstack/osc-lib/commit/1ff3720daefd98a77557e5692fd7052b5930ae6c

Issue: RELENG-3099
Change-Id: I5e70443007d1ed6074802e502edb149008fcdced
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
4 years agoRemove pinned distlib requirement 37/64537/3 v0.34.1
Eric Ball [Thu, 16 Jul 2020 00:47:52 +0000 (17:47 -0700)]
Remove pinned distlib requirement

Distlib is a common requirement for other libraries, and having it
pinned is causing failures in builds. It is not explicitly used in
lftools, so it does not need to be pinned.

Issue: RELENG-3071
Change-Id: I6a6a33585b1666b93656a43f16fb1db7e7b4f584
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
4 years agoRemove dependency on pre-commit 73/64273/2 v0.34.0
Thanh Ha [Sun, 14 Jun 2020 19:12:24 +0000 (15:12 -0400)]
Remove dependency on pre-commit

lftools has 0 dependencies on pre-commit and thus should not be
listed as one of its requirements. lftools simply uses pre-commit
as a linter which the dependency is already covered by the tox.ini
deps configuration.

Commit 54d1936f introduces what seems like an exceptionally large
list of dependencies which should be re-evaluated if lftools really
depends on any of those packages directly as some of those deps
are likely not really deps of lftools. This patch simply takes care
of pre-commit as I don't currently have time for a full audit.

Change-Id: I18acffc492ba6905e639cdb452dee0c2f5f2fcbb
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
4 years agoUpdate pre-commit hooks 2020-06 19/64219/2
Thanh Ha [Sat, 6 Jun 2020 13:52:04 +0000 (09:52 -0400)]
Update pre-commit hooks 2020-06

It's been awhile since we updated pre-commit hook versions so let's
catch up with the world.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I19d99ad86e8f60478af8daae2acfe19911b254ca

4 years agoSetup gitlint 18/64218/2
Thanh Ha [Sat, 6 Jun 2020 13:50:47 +0000 (09:50 -0400)]
Setup gitlint

Run gitlint to lint commit messages in the lftools repo.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I3daf64a3a234e191d035c583d6e752fa060accae

4 years agoPrint git-diff when pre-commit fails 17/64217/2
Thanh Ha [Sat, 6 Jun 2020 13:48:59 +0000 (09:48 -0400)]
Print git-diff when pre-commit fails

When pre-commit fails and automatically fixes issues for us in Jenkins
we are not able to see what pre-commit automatically fixed. Adding
--show-diff-on-failure makes pre-commit perform a git-diff immediately
after failing to ensure more useful output is printed to inform the
contributor what changes are needed to pass the check.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: Icd6484c8c4157d38885b1de460517d9b656a06d7

4 years agoUse black version 19.10b0 29/64229/1
Thanh Ha [Sat, 6 Jun 2020 14:13:38 +0000 (10:13 -0400)]
Use black version 19.10b0

The stable branch for some reason is failing to fetch in Jenkins build
now so let's switch to a tagged release.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I57c829e1cd831ae62cb5be1ca4414f144309005b

4 years agoFix string limit issue in _request_put_file 19/64119/1 v0.33.1
Eric Ball [Thu, 28 May 2020 15:22:42 +0000 (08:22 -0700)]
Fix string limit issue in _request_put_file

Requests can't handle a put call for very large data objects. However, it
can accept the data as a file-like object instead, and the size issue will
not show up. Documented here: https://github.com/psf/requests/issues/2717.

Issue: IT-19717
Change-Id: I826d3fa2eebbd3ba0389a0d7042701b4389e406d
Signed-off-by: Eric Ball <eball@linuxfoundation.org>