Skip to content

Commit

Permalink
Merge branch 'main' into support
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruchip16 authored Sep 23, 2024
2 parents 3132cab + 8c1d0a5 commit ff822ab
Show file tree
Hide file tree
Showing 28 changed files with 73 additions and 234 deletions.
3 changes: 0 additions & 3 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
---
profile: production

exclude_paths:
- changelogs/changelog.yaml
29 changes: 0 additions & 29 deletions .config/dictionary.txt

This file was deleted.

17 changes: 6 additions & 11 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,14 @@ extend-exclude =
# IMPORTANT: avoid using ignore option, always use extend-ignore instead
# Completely and unconditionally ignore the following errors:
extend-ignore =
# Safeguard neutering of flake8-quotes : https://github.com/zheller/flake8-quotes/issues/105
Q,
# annoy black by allowing white space before : https://github.com/psf/black/issues/315
E203,
# duplicate of pylint W0611 (unused-import)
F401,
# duplicate of pylint E0602 (undefined-variable)
F821,
# duplicate of pylint W0612 (unused-variable)
F841,
# line-length
E501,
# module level import not at top of file
E402

# Accessibility/large fonts and PEP8 unfriendly:
max-line-length = 100
max-line-length = 120

# Allow certain violations in certain files:
# Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future
Expand All @@ -62,7 +57,7 @@ per-file-ignores =
# these will need to be added to that line as well.


# S101: Allow the use of assert within the tests directory, since tests require it.
# S101: Allow the use of assert within the tests directory, since tests require it.
tests/**.py: S101

# The following were present during the initial implementation.
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
changelog:
uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main
if: github.event_name == 'pull_request'
build-import:
uses: ansible/ansible-content-actions/.github/workflows/build_import.yaml@main
ansible-lint:
uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main
sanity:
Expand All @@ -32,6 +34,7 @@ jobs:
if: ${{ always() }}
needs:
- changelog
- build-import
- sanity
- unit-galaxy
- ansible-lint
Expand All @@ -41,6 +44,7 @@ jobs:
python -c "assert 'failure' not in
set([
'${{ needs.changelog.result }}',
'${{ needs.build-import.result }}',
'${{ needs.sanity.result }}',
'${{ needs.unit-galaxy.result }}'
'${{ needs.ansible-lint.result }}'
Expand Down
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ repos:
hooks:
- id: add-trailing-comma

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
- repo: https://github.com/pycontribs/mirrors-prettier
rev: "v3.3.1"
hooks:
- id: prettier
entry: env CI=1 bash -c "prettier --list-different . || ec=$? && prettier --loglevel=error --write . && exit $ec"
Expand All @@ -43,3 +43,8 @@ repos:
rev: 23.11.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ TrendMicro DeepSecurity Collection Release Notes

.. contents:: Topics

v4.0.0
======

Release Summary
---------------

Starting from this release, the minimum `ansible-core` version this collection requires is `2.15.0`. The last known version compatible with ansible-core<2.15 is v3.0.0.

Major Changes
-------------

- Bumping `requires_ansible` to `>=2.15.0`, since previous ansible-core versions are EoL now.

v3.0.0
======
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The Ansible TrendMicro DeepSecurity collection includes a variety of Ansible con
<!--start requires_ansible-->
## Ansible version compatibility

This collection has been tested against following Ansible versions: **>=2.14.0**.
This collection has been tested against following Ansible versions: **>=2.15.0**.

For collections that support Ansible 2.9, please ensure you update your `network_os` to use the
fully qualified collection name (for example, `cisco.ios.ios`).
Expand Down
12 changes: 12 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,15 @@ releases:
fragments:
- major_300.yml
release_date: "2023-11-30"
4.0.0:
changes:
major_changes:
- Bumping `requires_ansible` to `>=2.15.0`, since previous ansible-core versions
are EoL now.
release_summary:
"Starting from this release, the minimum `ansible-core` version
this collection requires is `2.15.0`. The last known version compatible with
ansible-core<2.15 is v3.0.0."
fragments:
- ming_215.yaml
release_date: "2024-06-10"
37 changes: 0 additions & 37 deletions cspell.config.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ tags:
- deepsec
- security
- endpoint
version: "3.0.0"
version: "4.0.0"
build_ignore: []
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
requires_ansible: ">=2.14.0"
requires_ansible: ">=2.15.0"
plugin_routing:
modules:
anti_malware:
Expand Down
30 changes: 0 additions & 30 deletions mypy.ini

This file was deleted.

7 changes: 3 additions & 4 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# For ansible-tox-linters
black==23.3.0 ; python_version >= '3.7'
flake8
black==23.3.0
yamllint

# Unit test runner
pytest-ansible ; python_version >= '3.9'
git+https://github.com/ansible-community/pytest-ansible-units.git ; python_version < '3.9'
pytest-ansible
pytest-xdist
pytest-cov
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.14.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
tests/unit/mock/loader.py pylint:arguments-renamed
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.15.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
tests/unit/mock/loader.py pylint:arguments-renamed
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.16.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
tests/unit/mock/loader.py pylint:arguments-renamed
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.17.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
tests/unit/mock/loader.py pylint:arguments-renamed
File renamed without changes.
28 changes: 0 additions & 28 deletions tests/unit/compat/mock.py

This file was deleted.

41 changes: 0 additions & 41 deletions tests/unit/compat/unittest.py

This file was deleted.

12 changes: 6 additions & 6 deletions tests/unit/mock/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ def load_from_file(self, path, cache=True, unsafe=False):
return None

# TODO: the real _get_file_contents returns a bytestring, so we actually convert the
# unicode/text it's created with to utf-8
def _get_file_contents(self, path):
path = to_text(path)
if path in self._file_mapping:
return (to_bytes(self._file_mapping[path]), False)
# unicode/text it's created with to utf-8
def _get_file_contents(self, file_name):
file_name = to_text(file_name)
if file_name in self._file_mapping:
return (to_bytes(self._file_mapping[file_name]), False)
else:
raise AnsibleParserError("file not found: %s" % path)
raise AnsibleParserError("file not found: %s" % file_name)

def path_exists(self, path):
path = to_text(path)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/plugins/action/test_deepsec_anti_malwares.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
import tempfile
import unittest

from unittest.mock import MagicMock, patch

from ansible.playbook.task import Task
from ansible.template import Templar
from ansible_collections.ansible.utils.tests.unit.compat.mock import MagicMock, patch

from ansible_collections.trendmicro.deepsec.plugins.action.deepsec_anti_malwares import ActionModule

Expand Down
3 changes: 2 additions & 1 deletion tests/unit/plugins/action/test_deepsec_firewall_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
import tempfile
import unittest

from unittest.mock import MagicMock, patch

from ansible.playbook.task import Task
from ansible.template import Templar
from ansible_collections.ansible.utils.tests.unit.compat.mock import MagicMock, patch

from ansible_collections.trendmicro.deepsec.plugins.action.deepsec_firewall_rules import (
ActionModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
import tempfile
import unittest

from unittest.mock import MagicMock, patch

from ansible.playbook.task import Task
from ansible.template import Templar
from ansible_collections.ansible.utils.tests.unit.compat.mock import MagicMock, patch

from ansible_collections.trendmicro.deepsec.plugins.action.deepsec_integrity_monitoring_rules import (
ActionModule,
Expand Down
Loading

0 comments on commit ff822ab

Please sign in to comment.