Commit graph

211 commits

Author SHA1 Message Date
Pedro Algarvio
d77f3ef36b Also check for proper versionadded versions
Refs #59077
2021-08-19 07:31:52 -04:00
Pedro Algarvio
ba177ad738 Check loader modules __virtual__ and salt/modules/*.py with pre-commit
Fixes #58537
2021-08-19 07:31:52 -04:00
Pedro Algarvio
327e4a8774 `rstcheck` is too faulty and we even disable it on branch runs. Remove it. 2021-08-06 13:09:47 -07:00
Pedro Algarvio
6abb43d2df Upgrade to black 21.7b0 2021-08-06 13:09:47 -07:00
Pedro Algarvio
4353cc5710 Fix static requirements 2021-08-03 07:57:58 -07:00
twangboy
1e970d54b0 There's no pywin32 package for Py3.10 yet 2021-07-23 13:06:52 -07:00
Pedro Algarvio
a0c612b453 Enable Py3.10 windows requirements 2021-07-23 13:06:52 -07:00
Pedro Algarvio
3d4387f76f Enable Py3.9 requirements on windows 2021-07-23 13:06:52 -07:00
Pedro Algarvio
43518dfe9c Remove --passthrough-line-from-input=^pywin32(.*)$ 2021-07-23 13:06:52 -07:00
Pedro Algarvio
1f4c68a365 Compile requirements files.
Include python 3.9 stubs, these are NON WORKING requirements files for Py3.9
2021-07-23 13:06:52 -07:00
twangboy
29b6f930bf Passthrough pywin32 2021-07-23 13:06:52 -07:00
twangboy
647c1e90d3 Allow pre-commit for Python 3.8 2021-07-23 13:06:52 -07:00
Pedro Algarvio
ade28e7f28 Add missing pre-commit hook dependencies 2021-06-28 11:50:30 -07:00
Pedro Algarvio
11c7242826 Use https://github.com/saltstack/invoke-pre-commit for invoke pre-commit steps 2021-06-28 10:25:40 -04:00
Pedro Algarvio
ec6e96a036 Upgrade to six==1.16.0 to avoid problems on CI runs
```
13:59:02  nox > Session invoke-pre-commit was successful.
13:59:02  nox > Running session invoke-pre-commit
13:59:02  nox > pip install --progress-bar=off -r requirements/static/ci/py3.7/invoke.txt
13:59:02  Collecting blessings==1.7
13:59:02    Using cached blessings-1.7-py3-none-any.whl (18 kB)
13:59:02  Collecting invoke==1.4.1
13:59:02    Using cached invoke-1.4.1-py3-none-any.whl (210 kB)
13:59:02  Collecting pyyaml==5.3.1
13:59:02    Using cached PyYAML-5.3.1.tar.gz (269 kB)
13:59:02  Collecting six==1.15.0
13:59:02    Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
13:59:02  Building wheels for collected packages: pyyaml
13:59:02    Building wheel for pyyaml (setup.py) ... - \ | / - \ | done
13:59:02    Created wheel for pyyaml: filename=PyYAML-5.3.1-cp37-cp37m-linux_x86_64.whl size=546391 sha256=e42e1d66cc32087f4d33ceb81268c86b59f1a97029b19459f91b8d6ad1430167
13:59:02    Stored in directory: /var/jenkins/.cache/pip/wheels/5e/03/1e/e1e954795d6f35dfc7b637fe2277bff021303bd9570ecea653
13:59:02  Successfully built pyyaml
13:59:02  Installing collected packages: six, pyyaml, invoke, blessings
13:59:02    Attempting uninstall: six
13:59:02      Found existing installation: six 1.16.0
13:59:02      Uninstalling six-1.16.0:
13:59:02  ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/var/jenkins/.cache/pre-commit/repomw8oee1s/py_env-python3/lib/python3.7/site-packages/__pycache__/six.cpython-37.pyc'
13:59:02
13:59:02  nox > Command pip install --progress-bar=off -r requirements/static/ci/py3.7/invoke.txt failed with exit code 1
13:59:02  nox > Session invoke-pre-commit failed.
```
2021-05-27 09:32:39 -04:00
Pedro Algarvio
c3f43a3c38 Update pip-tools-compile-impersonate to 4.1.
Now it also runs on Windows, macOS and FreeBSD.
2021-05-27 09:32:39 -04:00
Pedro Algarvio
7cb2b52f07 Upgrade pip-tools-compile hook to version 3.0 2021-05-12 08:05:34 -04:00
Pedro Algarvio
7b786f6770 pip-tools-compile now knows what FreeBSD is 2021-05-05 09:29:54 -07:00
Pedro Algarvio
eeb0c97b3f Stop compiling Py3.6 requirements for Windows 2021-05-05 06:48:41 -07:00
Pedro Algarvio
4685930906 Stop compiling Py3.5 and Py3.6 requirements for Darwin 2021-05-05 06:48:41 -07:00
Pedro Algarvio
dfd5bea279 Stop compiling Py3.5 and Py3.6 requirements for FreeBSD 2021-05-05 06:48:41 -07:00
Pedro Algarvio
a6f0810c68 Add Py3.10 requirements.
Fixes #59452
2021-05-05 06:48:41 -07:00
Pedro Algarvio
5f59dcf1b8 Update to the newer pip-tools-compile-impersonate 2021-05-05 06:48:41 -07:00
Megan Wilhite
66cf74140b
Merge Freeze into Master (#60074)
* Merge 3002.6 bugfix changes (#59822)

* Pass `CI_RUN` as an environment variable to the test run.

This allows us to know if we're running the test suite under a CI
environment or not and adapt/adjust if needed

* Migrate `unit.setup` to PyTest

* Backport ae36b15 just for test_install.py

* Only skip tests on CI runs

* Always store git sha in _version.py during installation

* Fix PEP440 compliance.

The wheel metadata version 1.2 states that the package version MUST be
PEP440 compliant.

This means that instead of `3002.2-511-g033c53eccb`, the salt version
string should look like `3002.2+511.g033c53eccb`, a post release of
`3002.2` ahead by 511 commits with the git sha `033c53eccb`

* Fix and migrate `tests/unit/test_version.py` to PyTest

* Skip test if `easy_install` is not available

* We also need to be PEP440 compliant when there's no git history

* Allow extra_filerefs as sanitized kwargs for SSH client

* Fix regression on cmd.run when passing tuples as cmd

Co-authored-by: Alexander Graul <agraul@suse.com>

* Add unit tests to ensure cmd.run accepts tuples

* Add unit test to check for extra_filerefs on SSH opts

* Add changelog file

* Fix comment for test case

* Fix unit test to avoid failing on Windows

* Skip failing test on windows

* Fix test to work on Windows

* Add all ssh kwargs to sanitize_kwargs method

* Run pre-commit

* Fix pylint

* Fix cmdmod loglevel and module_names tests

* Fix pre-commit

* Skip ssh tests if binary does not exist

* Use setup_loader for cmdmod test

* Prevent argument injection in restartcheck

* Add changelog for restartcheck fix

* docs_3002.6

* Add back tests removed in merge

Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>

* Remove glance state module in favor of glance_image

* update wording in changelog

* bump deprecation warning to Silicon.

* Updating warnutil version to Phosphorous.

* Update salt/modules/keystone.py

Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>

* Check $HOMEBREW_PREFIX when linking against libcrypto

When loading `libcrypto`, Salt checks for a Homebrew installation of `openssl`
at Homebrew's default prefix of `/usr/local`. However, on Apple Silicon Macs,
Homebrew's default installation prefix is `/opt/homebrew`. On all platforms,
the prefix is configurable.  If Salt doesn't find one of those `libcrypto`s,
it will fall back on the un-versioned `/usr/lib/libcrypto.dylib`, which will
cause the following crash:

    Application Specific Information:
    /usr/lib/libcrypto.dylib
    abort() called
    Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.

This commit checks $HOMEBREW_PREFIX instead of hard-coding `/usr/local`.

* Add test case

* Add changelog for 59808

* Add changelog entry

* Make _find_libcrypto fail on Big Sur if it can't find a library

Right now, if `_find_libcrypto` can't find any externally-managed versions of
libcrypto, it will fall back on the pre-Catalina un-versioned system libcrypto.
This does not exist on Big Sur and it would be better to raise an exception
here rather than crashing later when trying to open it.

* Update _find_libcrypto tests

This commit simplifies the unit tests for _find_libcrypto by mocking out the
host's filesystem and testing the common libcrypto installations (brew, ports,
etc.) on Big Sur. It simplifies the tests for falling back on system versions
of libcrypto on previous versions of macOS.

* Fix description of test_find_libcrypto_with_system_before_catalina

* Patch sys.platform for test_rsax931 tests

* modules/match: add missing "minion_id" in Pillar example

The documented Pillar example for `match.filter_by` lacks the `minion_id` parameter. Without it, the assignment won't work as expected.
- fix documentation
- add tests:
  - to prove the misbehavior of the documented example
  - to prove the proper behaviour when supplying `minion_id`
  - to ensure some misbehaviour observed with compound matchers doesn't occur

* Fix for issue #59773

- When instantiating the loader grab values of grains and pillars if
  they are NamedLoaderContext instances.
- The loader uses a copy of opts.
- Impliment deepcopy on NamedLoaderContext instances.

* Add changelog for #59773

* _get_initial_pillar function returns pillar

* Fix linter issues

* Clean up test

* Bump deprecation release for neutron

* Uncomment Sulfur release name

* Removing the _ext_nodes deprecation warning and alias.

* Adding changelog.

* Renaming changelog file.

* Update 59804.removed

* Initial pass at fips_mode config option

* Fix pre-commit

* Fix tests and add changelog

* update docs 3003

* update docs 3003 - newline

* Fix warts in changelog

* update releasenotes 3003

* add ubuntu-2004-amd64 m2crypto pycryptodome and tcp tests

* add distro_arch

* changing the cloud platforms file missed in 1a9b7be0e2

* Update __utils__ calls to import utils in azure

* Add changelog for 59744

* Fix azure unit tests and move to pytest

* Use contextvars from site-packages for thin

If a contextvars package exists one of the site-packages locations use
it for the generated thin tarball. This overrides python's builtin
contextvars and allows salt-ssh to work with python <=3.6 even when the
master's python is >3.6 (Fixes #59942)

* Add regression test for #59942

* Add changelog for #59942

* Update filemap to include test_py_versions

* Fix broken thin tests

* Always install the `contextvars` backport, even on Py3.7+

Without this change, salt-ssh cannot target systems with Python <= 3.6

* Use salt-factories to handle the container. Don't override default roster

* Fix thin tests on windows

* No need to use warn log level here

* Fix getsitepackages for old virtualenv versions

* Add explicit pyobjc reqs

* Add back the passthrough stuff

* Remove a line so pre-commit will run

* Bugfix release docs

* Bugfix release docs

* Removing pip-compile log files

* Fix failing test tests.unit.grains.test_core.CoreGrainsTestCase.test_xen_virtual

* Fix pre-commit for docs.txt reqs

Co-authored-by: Daniel Wozniak <dwozniak@saltstack.com>
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@wiked.org>
Co-authored-by: Hoa-Long Tam <hoalong@apple.com>
Co-authored-by: krionbsd <krion@freebsd.org>
Co-authored-by: Elias Probst <e.probst@ssc-services.de>
Co-authored-by: Daniel A. Wozniak <dwozniak@vmware.com>
Co-authored-by: Frode Gundersen <frogunder@gmail.com>
Co-authored-by: twangboy <slee@saltstack.com>
Co-authored-by: twangboy <leesh@vmware.com>
Co-authored-by: ScriptAutomate <derek@icanteven.io>
2021-04-27 11:47:47 -04:00
ScriptAutomate
ebda3b729c linux.in instead of common.in for docs deps 2021-03-19 06:30:57 -04:00
ScriptAutomate
883c939b6b Adding linux.txt pkg req files for triggers 2021-03-19 06:30:57 -04:00
ScriptAutomate
5653dc9f29 Update docs to use pkg linux reqs 2021-03-19 06:30:57 -04:00
ScriptAutomate
72fc8b7e64 Update docs deps to include linux deps 2021-03-19 06:30:57 -04:00
Pedro Algarvio
9ccea8a7a4 Fix bandit skip for the test suite 2021-03-04 09:04:47 +00:00
Pedro Algarvio
fbdd6478d1 Bandit does not read .bandit when files are passed.
See https://github.com/PyCQA/bandit/issues/332
2021-03-03 06:21:53 -05:00
Pedro Algarvio
d16ab08a4d Start checking the salt code base with bandit 2021-03-03 06:21:53 -05:00
Pedro Algarvio
b76442e8f3
Merge remote-tracking branch 'upstream/3002.4' 2021-02-25 17:31:33 +00:00
Pedro Algarvio
eefd5bd835 Only support Py3.6+ for Windows 2021-02-23 12:49:10 -05:00
Pedro Algarvio
2ae5defa38 Upgrade included ipaddress.py from Python 3.9.1 2021-02-19 08:35:12 -05:00
Pedro Algarvio
460a658515 salt-rewrite can now run on the whole test suite 2021-02-03 13:15:24 +00:00
Pedro Algarvio
dd40c41194 Only depend on the top level pyobjc requirement.
This was requested by the macOS team.

Refs https://github.com/saltstack/salt/issues/59023
2021-02-03 10:28:56 +00:00
Megan Wilhite
46cd3263f9 Validate vmware module defaults to verifying SSL 2021-01-22 14:32:16 -07:00
Pedro Algarvio
65fdf388f9 Add salt-rewrite to pre-commit hooks 2021-01-19 14:51:30 +00:00
Pedro Algarvio
6b942545af Concentrate common requirements in a single .in file 2021-01-13 11:25:46 +00:00
Pedro Algarvio
feda66c226 Bump remove-import-headers pre-commit hook to 1.1.0 2021-01-12 11:35:23 +00:00
Pedro Algarvio
ed4b34525a Fix the filemap checks 2020-12-04 07:44:52 +00:00
Pedro Algarvio
e4188e7a9f Add hook to check for badly named changelog entries 2020-10-19 16:21:55 +01:00
Pedro Algarvio
b427688048 Start checking rst files at pre-commit level with rstcheck
Additionally, fixed most of the errors reported by rstcheck.

Fixes https://github.com/saltstack/salt/issues/58668
2020-10-13 13:53:16 -07:00
Pedro Algarvio
12f7e06720 Even more complete static requirements regexes 2020-10-13 03:12:57 +01:00
Pedro Algarvio
7e7cbf3ffa
Switch to the remove-import-headers pre-commit hook 2020-10-07 10:46:20 +01:00
Pedro Algarvio
0cbc264fe1
Fix pre-commit pip-tools-compile regexes 2020-10-04 21:35:07 +01:00
Pedro Algarvio
49556caf05
Rework static requirements. Darwin and Windows packaging are now also static.
Refs https://github.com/saltstack/release-planning/issues/238
2020-09-30 09:31:49 +01:00
Pedro Algarvio
67b25add12
Add packaging static requirements 2020-09-30 09:31:49 +01:00
Pedro Algarvio
7efd60131b
Move CI static requirements to it's own subdirectory 2020-09-30 09:31:48 +01:00
Pedro Algarvio
65e12043eb Automatically remove import comments on files.
This is desired because now imports are automatically sorted and these
header comments often get misplaced.

Fixes #57979
2020-09-24 13:47:43 -07:00