Commit Graph

35 Commits

Author SHA1 Message Date
Bin Qian 5e73024922 Fix zuul failure
A recent opendev change invalid the branch as eol. This
fails the zuul job as ERROR: 404 Client Error: Not Found for url:
https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt

Closes-Bug: 2048928

Change-Id: Ief69b7b35ab32195fe78dd9a2bffa0e32831ed65
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2024-01-10 19:26:20 +00:00
Al Bailey 7b0ecddf20 Update tox.ini to work with tox 4
This change will allow this repo to pass zuul now
that this has merged:
https://review.opendev.org/c/zuul/zuul-jobs/+/866943

Tox 4 deprecated whitelist_externals.
Replace whitelist_externals with allowlist_externals

Remove the deprecated cgcs-patch(CentOS) jobs from zuul
sw-patch directory contains the Debian support.

Move from xenial to bionic for patch-alarm zuul job.

Partial-Bug: #2000399

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ia0dcf61fc4a2c7911434158dd2e8bca7a787249a
2022-12-23 16:01:02 +00:00
Al Bailey abaea457e5 Debian: Minor sw-patch cleanup
- Adding missing requirements for sw-patch
- Cleaning up redundant dependencies
- Invoke clean as part of debian build
- Rename Starlingx to StarlingX
- Display error details for failed sw-patch commands
- Fix a python3 string comparison affecting duplex
- Fix report-app-dependencies
- Remove 'six' from sw-patch since the code is py3 only
- Fix a KeyError if restart_script not found in metadata.
- Allow bandit to ignore 'input' checks on python3 since
it is considered safe

Test Plan:
  PASS: Build/Bootstrap/Unlock AIO-SX Debian
  PASS: sw-patch report-app-dependencies --app foo
  PASS: Upload/Apply/Remove/Delete a patch on AIO-DX system
       host-install was not tested on AIO-DX as that
       capability is still under active developement.

Closes-Bug: #1976535
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I94ec47e2f2087989da26ebab0e05c3b0d8f303e6
2022-07-13 17:54:33 +00:00
Luis Sampaio 864f8156d6 make_patch utility for Debian
This allows creation of debian patches (RR and INSVC) based on ostree.

Steps to create a debian patch:
1) Export env variables, e.g:
export PROJECT="stx-debian-desktop"
export STX_BUILD_HOME="/localdisk/designer/${USER}/${PROJECT}"

2) Run prepare to create a clone of the STX_BUILD_HOME ostree_repo
./make_patch.py prepare --clone-repo ostree_test

3) Make changes to the environment
- update a package
- build-pkgs -c -p <package name>
- build-image
This will create a new commit in the build ostree_repo

4) Create your patch.xml (samples provided)
- patch_recipe_rr_sample.xml
- patch_recipe_insvc_sample.xml

5) Run create to build the patch
./make_patch.py create --patch-recipe patch_recipe_rr_sample.xml \
--clone-repo ostree_test

Once the script is done the .patch file can be located at:
$STX_BUILD_HOME/localdisk/lat/std/deploy/

Story: 2009969
Task: 45542
Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
Change-Id: I902c42bc22601810fb91e45c630671af14906dcd
2022-06-14 09:48:53 -07:00
Al Bailey be09ccc584 Fork cgcs-patch package as sw-patch for Debian
The original cgcs-patch is rpm based which requires a
complete re-write to work on ostree/dpkg systems like Debian.

The code has been forked, since the older Centos env and
python2.7 are end-of-life.

Forking the code allows all new development to not
require re-testing on Centos.

The debian folder under cgcs-patch has been moved
under sw-patch

Renaming and refactoring will be done in later commits.

pylint is un-clamped in order to work on python3.9
Some minor pylint suppressions have been added.

Test Plan:
 Verify that this builds on Debian
 Verify that the ISO installs the new content on Debian without
breaking packages that import cgcs_patch.
 Verify patching service runs on Debian

Co-Authored-By: Jessica Castelino <jessica.castelino@windriver.com>
Story: 2009101
Task: 43076
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I3f1bca749404053bae63d4bcc9fb2477cf909fcd
2022-03-29 20:35:14 +00:00
albailey a72d8edca4 Adding rpm-python to bindep to fix pylint
Tox pylint target fails when it cannot 'import rpm'.
There is no pypi package that provides that, since the
centos rpm-python is meant to be installed on the host.

Adding the bindep entry for rpm-python, which the
zuul job will use to prepare the zuul worker host
to properly provide the necessary rpm.

Story: 2008943
Task: 44183
Signed-off-by: albailey <Al.Bailey@windriver.com>
Change-Id: If904bd184e5aaa458393f3154abb6f9c5f0fb967
2021-12-15 09:13:13 -06:00
Charles Short 49e39fa949 Specify the nodeset zuul jobs
The py2.7 jobs need to specify xenial
The py3.6 jobs need to specify bionic
The focal zuul nodes only have python 3.8 installed in them

Zuul targets that invoke a generic python3 interpreter such
as pep8 is not specified.

Also ignore H216 since we still use py2.7.

The copyright date was updated in order to trigger
the zuul jobs, as a no-delta type of change.

Partial-Bug: 1928978

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I81fd790dfc8a665a4e4e0ff59a013af7921b6e06
Signed-off-by: Charles Short <charles.short@windriver.com>
2021-05-28 11:24:04 -04:00
albailey 2302b0fe2e Enable py3-bandit and py3-flake8 zuul jobs
This reverts commit 4146e2a859.

Removed the calls to tox from within tox, and setup the
top level tox.ini for bandit and flake8 for the sub folders.

Change-Id: I682869c8e839f4f59cdce48cd0b97b4a4324f4a7
Story: 2004515
Task: 40232
Signed-off-by: albailey <Al.Bailey@windriver.com>
2020-06-25 21:04:54 -05:00
albailey e3be9a2776 Update flake8 to verify patch scripts
To prevent the warning about a newer version of pip
available, the following env setting was added

  PIP_DISABLE_PIP_VERSION_CHECK=1

To prevent sub-calls to tox from using the default pip
cache location, rather than whatever a user may override
using xdg env variables, the following has been added:

  passenv =
      XDG_CACHE_HOME

The python patch scripts are now validated by flake8.
All flake8 tox targets are triggered from a single zuul job.

Story: 2004515
Task: 38581
Change-Id: I105512edbd3da15480355e30c0dd14933584a47b
Signed-off-by: albailey <Al.Bailey@windriver.com>
2020-01-31 09:40:27 -06:00
Al Bailey e45a758a8a Enable tox bandit checks for python in update repo
Bandit gate jobs are used by openstack for security checks.

Adding a zuul job so that any new bandit failures
will be caught.

patch-alarm runs cleanly and does not currently suppress any
bandit checks.

cgcs-patch suppresses several bandit checks which may be
updated and enabled by future commits.

Change-Id: I01414c48266cfb3cb6df9ef400a350a570938189
Story: 2004515
Task: 37697
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
2019-12-02 10:30:41 -06:00
Scott Little b0559bc151 Subdirectories 'tsconfig ' relocated to repo 'stx-config'
Story: 2006166
Task: 35687
Depends-On: I6c62895f8dda5b8dc4ff56680c73c49f3f3d7935
Depends-On: I665dc7fabbfffc798ad57843eb74dca16e7647a3
Change-Id: I70b6d52a13836e16139a0ca3f42b9e91e06e43b6
Signed-off-by: Scott Little <scott.little@windriver.com>
Depends-On: I5618547e7e74b76d174f10897b1c747931738cd6
Signed-off-by: Scott Little <scott.little@windriver.com>
2019-09-05 13:04:59 -04:00
junboli 7ff00cc5ef Add 'find' in whitelist_externals in tox.ini
Running tox is giving a warning because the tox.ini is
using "find", but the find command is not whitelisted.

Change-Id: I38ece01f6135ebb38a94b9d835e2708a02b35805
Closes-bug: #1835386
Signed-off-by: junboli <junbo85.li@gmail.com>
2019-07-09 02:13:08 -04:00
Don Penney a5e51f98c8 Add test framework for patch alarm manager
This update sets up the initial testing framework for
the patch-alarm module, with a basic test case.

Additionally, this restructures the tox.ini files. Now
that each python module has its own tox.ini and tests,
the top-level tox.ini can recursively use those. As well,
the Zuul setup can now split the jobs for each module.

Change-Id: I79eed868c5b42e2545ccf0c11dbbbea4336b9b19
Story: 2005939
Task: 34783
Signed-off-by: Don Penney <don.penney@windriver.com>
2019-06-28 17:03:00 -04:00
Don Penney f27f1c1539 Add initial unit testing to cgcs-patch
This update sets up the framework for unit testing in
the cgcs-patch module, with some basic test cases.

Change-Id: I209076449353a23bb57e0eee397e614b7e89ad88
Story: 2005939
Task: 34756
Signed-off-by: Don Penney <don.penney@windriver.com>
2019-06-27 15:46:43 -04:00
Eric Barrett 25dee38f0b Enable Python3 Compatibility
Flake8 currently ignores the following errors:
H237: module is removed in python3
H238: old style class declaration
Enable them for python2/3 compatibility

Change-Id: I4dd66c8ab388119b4abab83fda48a89e108f7821
Story: 2004515
Task: 29303
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
2019-06-06 10:17:52 -04:00
Dean Troyer 0a0475b815 Followup opendev cleanup and test jobs
Depends-on: https://review.opendev.org/654006
Change-Id: If679cd0742cdf53b27db5f9c94b4c705c46b07ef
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-04-20 09:24:53 -05:00
Dean Troyer c72cf50c08 Update py35 jobs to py37
The upstream OpenStack default node type changed yesterday
from Ubuntu Xenial to Bionic. We have a number of jobs pegged
directly to py35 which is no longer available in Bionic.

We can either pin the py35 jobs to Xenial nodes or update them
to py36 or py37.  OpenStack is supporting both of those for the
Stein release, since StarlingX does not have any position on
Python 3 versions (yet!) I am suggesting we move straight to py37
and in the case of issues now make these jobs non-voting until
any incompatibilities are resolved.

Change-Id: I99b6fdb4fe319e51fc5bf0a2d33e67c57bfec01f
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-03-14 17:19:36 -05:00
Al Bailey b39f383007 Adding unit tests to tsconfig and clean it up a bit
Adding simple unit tests to tsconfig.
- test the behaviour when build.info is not present
- test the behaviour when platform.conf is not present
- test the behaviour when both files are found

This works in py27 and py35.
Coverage for tsconfig is 100%

Added requirements.txt and test-requirements.txt

Added a setup.cfg file so that the wheel can be
built in universal mode (python 2 and 3)

Properly set some of the setup.cfg variables.

These unit tests are wired into zuul.

Story: 2004515
Task: 29783
Change-Id: Ifb4f5403592ccc9223659bb188055ffeccc113b5
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
2019-03-04 19:16:05 +00:00
Dean Troyer 6be5a751c9 DevStack plugin updates for bionic job
This makes some cleanup changes to the DevStack plugin for the
change to master and bionic.
* Define values for precedence handling by the upstream devstack playbook
* Add STX_INST_DIR for a deterministic install location
* Update the linters job in tox.ini to correctly include the devstack plugin

Change-Id: Ida3a6c07d49510a6ec0276e83a3f966b826de26e
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-02-20 14:34:17 -06:00
Al Bailey db68a25ea7 Cleanup Tox multiple imports per line
This unsuppresses the flake8 check
 H301 more than one import per line

This has no functional change.
It just enables the check and fixes the imports

Story: 2004515
Task: 29377
Change-Id: I15e13703949c5dfe27ff6f68be5dfcf467ffbe80
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
2019-02-07 13:27:40 -06:00
Al Bailey bcc938ca12 Add additional checks to flake8 job
By setting 'hacking' as the dependency, flake8
will include hacking and other checks.
This is the same set used by other openstack
components.

This commit suppresses any of those new checks that
would fail.
 H101  Use TODO(NAME)
 H102  Apache 2.0 license header not found
 H105  Don't use author tags
 H237  module posixfile is removed in Python 3
 H238  old style class declaration
 H301  one import per line
 H306  imports not in alphabetical order
 H401  docstring should not start with a space
 H404  multi line docstring should start without a leading new line
 H405  multi line docstring summary not separated with an empty line

It also sets the max line length to be very large.

At a later time, additional commits will fix and un-suppress them.

Story: 2004515
Task: 29303
Change-Id: Id572d5c0ecab1854ca881e34b95459ef563be0f2
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
2019-02-04 09:00:45 -06:00
Bart Wensley bb89685107 Lock down flake8 version
The new flake8 version 3.6.0 introduces new warnings that cause
the check and gate jobs to fail. Locking down the flake8 version
to avoid these surprises in the future. We can later increment
the flake8 version and fix the new warnings in a controlled
manner.

Change-Id: I86c81746f8f8f2fcf5211335f8c42b0c03fcca9e
Partial-Bug: 1799721
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
2018-10-24 10:08:51 -05:00
98k d443988bb8 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I798f7f0a99da5ee8ae848049dcd08a36b495bb62
2018-10-11 01:48:21 +00:00
Abraham Arce 364d9512a9 [Doc] OpenStack API Reference Guide
Baseline changes to comply with OpenStack API documentation
from OpenStack Documentation Contributor Guide [0]:

- [1] How to document your OpenStack API service

[0] https://docs.openstack.org/doc-contrib-guide
[1] https://docs.openstack.org/doc-contrib-guide/api-guides.html

Story: 2002712
Task: 26659

Change-Id: I873f6437d661b80248c39bfce2c1aefece78cca4
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
2018-09-25 15:01:49 -07:00
Abraham Arce 57e9e71cb6 [Doc] Release Notes Management
Baseline changes to comply with Release Notes Management
based in Reno [0]:

* Use build-openstack-releasenotes job for release notes
  (We can't use the OpenStack releasenotes template as it includes
  publish jobs, stx needs its own)
* Add newnote tox environment as convenience for creating new release
  notes, re-using the releasenotes venv.
* Remove the unused 'true' tox environment.

[0] https://docs.openstack.org/reno/latest/

Story: 2003101
Task: 26658

Change-Id: I0bce008d3c26859ba7ca72aeec664ed417e22ea1
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
2018-09-25 15:01:30 -07:00
Abraham Arce 1799425d3d [Doc] Building docs following Docs Contrib Guide
Baseline changes to comply with OpenStack Documentation
Contributor Guide [0] starting with the following sections:

- Project guide setup
  - [1] sphinx-quickstart
  - [2] doc/source/ layout
- Building documentation
  - [3] tox -e docs
- Using documentation tools
  - [4] openstackdocstheme
- Use build-openstack-docs-pti job template for docs

[0] https://docs.openstack.org/doc-contrib-guide
[1] http://www.sphinx-doc.org/en/master/usage/quickstart.html
[2] https://docs.openstack.org/doc-contrib-guide/project-guides.html
[3] https://docs.openstack.org/doc-contrib-guide/docs-builds.html
[4] https://docs.openstack.org/openstackdocstheme/

Story: 2002708
Task: 26656

Story: 2002813
Task: 26657

Change-Id: Iffee1ba3ddc670fca9ae6e0d5b325f3831650e2f
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
2018-09-25 15:01:12 -07:00
Sun Austin bae8691911 Fix pep8/flake8 Error
Fix below errors
    E128 continuation line under-indented for visual indent
    E305 expected 2 blank lines after class or function definition, found 1
    E502 the backslash is redundant between brackets
    E722 do not use bare except'
    E741 ambiguous variable name 'xxxxx'
    E999 SyntaxError: invalid token

Change-Id: Ic826a70aed2cda984cbafedae154c4812bfa37b5
Story: 2003429
Task: 24624
Signed-off-by: Sun Austin <austin.sun@intel.com>
2018-09-12 08:40:21 +08:00
chenyan ad22ae3db1 Fix print issue for Python 2/3 compatible code.
Use flake8 to replace pep8 because pep8 is invalid from the log.
enable pep8/flake8 voting and suppress flake8 Errors(fix later)

Story: 2003429
Task: 24623

Change-Id: I79e9def77dc0c8ce74403d4ba846b35ae5aa487b
Signed-off-by: chenyan <yan.chen@intel.com>
Signed-off-by: Sun Austin <austin.sun@intel.com>
2018-09-06 13:14:17 +08:00
Don Penney cede41ecf8 Revert "Fix raw_input issue for Python 2/3 compatible code."
This reverts commit 2d1e3b7981.

This update causes an import failure for the sw-patch CLI command,
as the "builtins" module is not currently part of the load.

Change-Id: I9f71f001dd36ccd769b888fbf45cba105e7bcde2
Closes-bug: 1790166
2018-08-31 15:36:05 +00:00
chenyan 2d1e3b7981 Fix raw_input issue for Python 2/3 compatible code.
Story: 2003429
Task: 24619

Change-Id: I8a93c07886d27a5c0835ac38ccf3e6c8b0f80497
Signed-off-by: chenyan <yan.chen@intel.com>
2018-08-30 18:06:09 +08:00
Don Penney 2885d09ed2 Add pylint support
This update adds pylint to tox and zuul for stx-updates and resolves
most warnings and errors, with some disabled for future resolution.

Change-Id: Ic853202e4793bf89d687b50cbd740d364db85189
Story: 2003371
Task: 24832
Signed-off-by: Don Penney <don.penney@windriver.com>
2018-08-24 09:19:44 -05:00
Don Penney 1dba21cd7d Treat bashate warnings as errors in linter test
Change-Id: Idafd0fb4be0807356e96d59f57f24d0689132f4a
Story: 2003371
Task: 24755
Signed-off-by: Don Penney <don.penney@windriver.com>
2018-08-17 13:10:29 -05:00
Don Penney f39c0c79ad Clean up tox.ini file
This update cleans up the initial tox.ini file to purge unnecessary
dependencies, add the --no-run-if-empty argument to xargs commands,
and broadens the bashate check to cover all subdirectories in case
new shell scripts are added elsewhere.

Change-Id: Ib1ecfcee426a2975903f6e61d64b1a650a5d5aa1
Story: 2003371
Task: 24531
Signed-off-by: Don Penney <don.penney@windriver.com>
2018-08-09 22:29:05 -05:00
Don Penney ae0314279f Resolve bashate and pep8 warnings
This update addresses existing bashate and pep8 warnings in
cgcs-patch, patch-alarm, and tsconfig. The bulk of these updates
are style and spacing changes, such as whitespace style conventions.

Story: 2003371
Task: 24433

Change-Id: I44b26d24788907bac0730a952d70ed4bafb87d90
Signed-off-by: Don Penney <don.penney@windriver.com>
2018-08-08 19:36:58 -05:00
Dean Troyer ba33256f86 Add Zuul test foundation
Add the basics for testing, non-voting jobs until the cleanups merge

Change-Id: I2f57c37335b5625eb1d124e276fbb98d94714d4d
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-07-25 08:48:07 -05:00