Commit Graph

22 Commits

Author SHA1 Message Date
Sagi Shnaidman
01c2499fb6 New CI jobs configuration
Change-Id: Ib6850184faf1bc0808502c098d610a5e2f41f47e
2020-06-23 12:27:04 +03:00
Sagi Shnaidman
c9da50e7e7 Add setup.py for install with pip
Make possible installation with pip.
Change-Id: I8eec015142c4f29eadff0dac2781782b76dea308
2020-06-04 14:23:23 +00:00
Monty Taylor
a033a0804b Validate that we can upload build collection
Run galaxy-importer on the built artifact and fail if galaxy is
going to fail.

Remove license_file entry in galaxy.yml

Change-Id: I6c2ac22ccb56f52f8efcefc5891b10875ae8c0b5
2020-05-19 11:13:22 -05:00
Monty Taylor
8a928ef70d Build collection with 2.10 and ignore things more better
We need 2.10 for building collection tarballs with build_ignore.
Also, build_ignore takes globs, not leading filepaths, so add
globs to the dirs in our list so that we properly don't include
these.

Change-Id: I809e100fa80bffafda4002487590a6dcd6aea0c1
2020-05-15 07:48:36 -05:00
Monty Taylor
6271268567 Run linters in a temp dir instead of an install
We can't run linters in an install because installs expand
symlinks to regular files so the ansible-test code that detects
symlinks can't work so it looks at docs for symlink aliases
as if they were real.

Change-Id: I0a5659a1f693261a21a5b29528f950b846205f2e
2020-05-12 09:04:54 +00:00
Sagi Shnaidman
347347b46e Fix ansible sanity linter tests
Change-Id: I2d08fdc77d930378be515da697c1cf975dd8b4d2
2020-04-02 13:20:01 +02:00
Monty Taylor
cf7011a742 Cleanup functional tests
Use the openstacksdk base functional test instead of going all
the way back to devstack for our base. Also - defining a job
starting with openstacksdk in this repo is not ok - but that
probably just came from the original copy-pasta coming from the
sdk repo.

Use tox-siblings more and stop doing tox requirements of ../
things. The system is there and we can use it.

Add jobs to test against released openstacksdk and ansible, as well
as a non-voting to test against ansible devel branch.

Add openstacksdk to the test-requirements because it's super
required.

Move zuul.yaml to .zuul.yaml. This isn't a zuul jobs repo so
we should just make it a hidden file rather than a non-hidden.

Change-Id: I658bd1728629cd358bc17a7f00d282d04530d8fe
2020-03-19 12:05:57 +00:00
Monty Taylor
75cc5012e3 Update os_client_config to use openstacksdk
This never got migrated but should. os-client-config is only
on life support.

Change-Id: I2d77c9f7d147900b79a410c17cce197108c0a69b
2020-03-17 13:35:45 -05:00
Monty Taylor
97eb24ac4d Deal with collection build modifying tree
ansible-galaxy collection build modifies the contents of the tree.
Let's not go in to why this is bad, but instead just deal with it.
The issue in question is that is removes the +x bit from files in
the tree, which means you can't run a build twice in a row locally.
Shrug. Just roll with the -x and update our usage to reflect it.

Change-Id: I0f82531e99a98d656b60079fd3e94d4e3a1dbb6b
2020-03-05 15:08:32 +00:00
Monty Taylor
53affc3220 Test with and assert support for python3
Collections are new. openstacksdk as of now doesn't support python2.
We shouldn't pretend to support python2 either. If you're using
ansible new enough to use collections, you can use python3.

This release of openstacksdk only supports 3.6 and onwards, so
set that as our min.

Change-Id: I34d544ce48f25bffde8e6e0cf82cdf9a85e681c3
2020-03-03 09:28:43 -06:00
Monty Taylor
9d29e8c847 Fix H236 and remove exclusion
We haven't needed this in a VERY long time.

Change-Id: I35041c2c6ae421e7caaef3c04ffca92e2ff10e35
2020-03-01 06:22:58 -06:00
Monty Taylor
86670bcec9 Fix F401 and remove exclusion
Change-Id: Id2dbff06925ed8326e4a214aabc19d4ada5db69c
2020-02-27 13:56:48 -06:00
Monty Taylor
92d7d7caeb Fix W504 and remove exclusion
This is a topic where there are two points of view. While neither
is fundamentally better than the other in reality, what's best is
to not have any arguments about it. The tox.ini comments about 503
and 504 that were in place make the argument that:

  - 503 is intended to be disabled and 504 enabled by default
  - Donald Knuth believes 504 is the right way

Since Donald Knuth is smarter than all of us, align with 504, match
the comments in the file and turn on enforcement to keep it that way.

Change-Id: I92d4d1e82935e30ae42a0e14e641cbe36fd6e811
2020-02-27 13:56:48 -06:00
Monty Taylor
72ba76f156 Fix E128 and remove exclusion
Change-Id: I0517c0ed09d7834df763c745936793739e88ef9d
2020-02-27 13:56:48 -06:00
Monty Taylor
2527faec28 Remove F403 and F405 exclusions
Importing from * is not a thing that should be done, as it masks
errors and makes code hard to understand. There are some copy-pasta
files that violate this. Mark them with noqa for now, because we don't
actually care about them.

Change-Id: I790f88c75ea546d83e347e42df0050ad36211936
2020-02-27 13:56:48 -06:00
Monty Taylor
15f7f7fc7b Fix F841 and remove exclusion
Change-Id: I92802ced580d42781cfd875389daa232aa8a64a5
2020-02-27 13:56:48 -06:00
Monty Taylor
90e68f2e8e Run flake8 in linters
We should run flake8 when we run the other checks. This
repo is mostly python.

Change-Id: I3cbecf9ef24f784c072841656b55c4162673dcaa
2020-02-27 13:56:48 -06:00
Monty Taylor
40fe366727 Remove old artifacts when building new ones
For local dev, multiple iterations can wind up with multiple
files in the build_artifact dir. Remove them when building so
that the ls command works.

Change-Id: Id309c34679d2c0b6d9380665a381af4b52495d19
2020-02-27 13:56:27 -06:00
Monty Taylor
5936a8f691 Add a tool to build collections with pbr
OpenStack in general uses git tags to drive versioning of artifacts.
This is important because of our code review driven workflow, since
patches don't necessarily land in a predictable sequence, so flows
requiring a version number in a file to be updated at a specific
time are problematic.

By having pbr generate the correct version number then putting that
into the galaxy.yml file, we can match the behavior without too much
undue burden.

Also ignore build_artifact directory.

Change-Id: Id02fee682fb5a4b6fd6dcb0644848e6d1269e19b
2020-02-27 08:20:43 -06:00
Sagi Shnaidman
7c52b83b52 Run functional devstack job on ansible collection
Porting of job that was running on patches in Ansible.

Change-Id: Ifa5a6b40d6a0f1de9f2cbc917a55c2d0e8ac421d
2020-01-21 00:25:48 +02:00
Sagi Shnaidman
57b76835c9 Make collection tar file path version independent
Find collection TAR file by "ls".
Change-Id: Icf988005258b260b51e8de7e70b344275948b40b
2020-01-19 21:19:51 +00:00
Sagi Shnaidman
6ac08e7f0e Migrate openstack modules as a collection
Migrate accordin to Ansible guidelines [1[]] and tool
migrate.py [2]
Also fixed ALL ansible-test sanity issues

Add pep8 and linter job with runs ansible-test sanity test.

[1] https://etherpad.openstack.org/p/openstack-ansible-modules
[2] https://github.com/ansible-community/collection_migration

Change-Id: Ib2b1c8f23aacfca95304132bfe5c4cdedbea0520
2020-01-17 14:07:24 +00:00