Skip to content

Commit

Permalink
Merge pull request #67 from NilashishC/updates
Browse files Browse the repository at this point in the history
Assorted maintenance updates
  • Loading branch information
NilashishC authored Nov 9, 2023
2 parents 1f73ccd + 373401f commit ee40ea5
Show file tree
Hide file tree
Showing 64 changed files with 762 additions and 654 deletions.
5 changes: 5 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
profile: production

exclude_paths:
- changelogs/changelog.yaml
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
open-pull-requests-limit: 3
labels:
- skip-changelog
3 changes: 3 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# see https://github.com/ansible-community/devtools
_extends: ansible-community/devtools
14 changes: 14 additions & 0 deletions .github/workflows/ack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml
name: ack

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on: # yamllint disable-line rule:truthy
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]
jobs:
ack:
uses: ansible/devtools/.github/workflows/ack.yml@main
14 changes: 14 additions & 0 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Code Coverage

on: # yamllint disable-line rule:truthy
push:
pull_request:
branches: [main]
jobs:
codecoverage:
uses: ansible-network/github_actions/.github/workflows/coverage_network_devices.yml@main
with:
collection_pre_install: >-
git+https://github.com/ansible-collections/ansible.utils.git
git+https://github.com/ansible-collections/ansible.netcommon.git
26 changes: 26 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# push workflow is shared and expected to perform actions after a merge happens
# on a maintenance branch (default or release). For example updating the
# draft release-notes.
# based on great work from
# https://github.com/T-Systems-MMS/ansible-collection-icinga-director
name: push

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on: # yamllint disable-line rule:truthy
workflow_dispatch:
env:
NAMESPACE: ibm
COLLECTION_NAME: qradar
ANSIBLE_COLLECTIONS_PATHS: ./

jobs:
update_release_draft:
uses: ansible/devtools/.github/workflows/push_network.yml@main
with:
repo: ansible-collections/ibm.qradar
secrets:
BOT_PAT: ${{ secrets.BOT_PAT }}
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: release
on: # yamllint disable-line rule:truthy
release:
types: [published]
jobs:
release:
uses: ansible/devtools/.github/workflows/release_collection.yml@main
with:
environment: release
secrets:
ah_token: ${{ secrets.AH_TOKEN }}
ansible_galaxy_api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
18 changes: 13 additions & 5 deletions .github/workflows/test.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
---
name: Test collection
name: CI

concurrency:
group: ${{ github.head_ref }}
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on: # yamllint disable-line rule:truthy
pull_request:
branches: [main]
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
ansible-lint:
uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main
changelog:
uses: ansible-network/github_actions/.github/workflows/changelog.yml@main
if: github.event_name == 'pull_request'
sanity:
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
unit-galaxy:
Expand All @@ -24,18 +29,21 @@ jobs:
git+https://github.com/ansible-collections/ansible.utils.git
git+https://github.com/ansible-collections/ansible.netcommon.git
all_green:
if: ${{ always() }}
if: ${{ always() && (github.event_name != 'schedule') }}
needs:
- ansible-lint
- changelog
- sanity
- unit-galaxy
- unit-source
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
python -c "assert 'failure' not in
set([
'${{ needs.ansible-lint.result }}',
'${{ needs.changelog.result }}',
'${{ needs.sanity.result }}',
'${{ needs.unit-galaxy.result }}',
'${{ needs.unit-source.result }}'
]) == {'success'}"
])"
17 changes: 12 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# CML/virl lab cache
.virl/

# A collection directory, resulting from the use of the pytest-ansible-units plugin
collections/


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -103,9 +110,9 @@ venv.bak/
# mypy
.mypy_cache/

# mazer / ansible collections
releases/

*.tar.gz
# ide
*.code-workspace
.vscode/
.DS_Store

tests/output*
changelogs/.plugin-cache.yaml
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[settings]
known_first_party=ansible_collections.ibm.qradar
line_length=100
lines_after_imports=2
lines_between_types=1
profile=black
38 changes: 31 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
---
repos:
- repo: https://github.com/ansible-network/collection_prep
rev: 1.1.1
hooks:
- id: update-docs

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-symlinks
Expand All @@ -10,12 +15,31 @@ repos:
- id: no-commit-to-branch
args: [--branch, main]
- id: trailing-whitespace

- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
entry: env CI=1 bash -c "prettier --list-different . || ec=$? && prettier --loglevel=error --write . && exit $ec"
pass_filenames: false
args: []
additional_dependencies:
- prettier
- prettier-plugin-toml

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
name: Sort import statements using isort
args: [--filter-files]

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.10.1
hooks:
- id: black
args: [-l, "100"]
- repo: https://github.com/ansible-network/collection_prep
rev: 1.0.0
hooks:
- id: update-docs
22 changes: 22 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Stuff we don't want priettier to ever to look into
.*/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# A linked collection directory created by pytest-ansible-units

collections/

# Tracked but not manually edited

# Tracked but manually formatted

# WIP
README.md
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# IBM QRadar Ansible Collection

[![CI](https://zuul-ci.org/gated.svg)](https://dashboard.zuul.ansible.com/t/ansible/project/github.com/ansible-collections/ibm.qradar) <!--[![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/ibm.qradar)](https://codecov.io/gh/ansible-collections/ibm.qradar)-->
[![CI](https://zuul-ci.org/gated.svg)](https://dashboard.zuul.ansible.com/t/ansible/project/github.com/ansible-collections/ibm.qradar) <!--[![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/vyos)](https://codecov.io/gh/ansible-collections/ibm.qradar)-->
[![Codecov](https://codecov.io/gh/ansible-collections/ibm.qradar/branch/main/graph/badge.svg)](https://codecov.io/gh/ansible-collections/ibm.qradar)
[![CI](https://github.com/ansible-collections/ibm.qradar/actions/workflows/tests.yml/badge.svg?branch=main&event=schedule)](https://github.com/ansible-collections/ibm.qradar/actions/workflows/tests.yml)

This is the [Ansible
Collection](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html)
Expand All @@ -18,6 +20,8 @@ and provide feedback about.

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

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`).
Plugins and modules within a collection may be tested with only specific Ansible versions.
A collection may contain metadata that identifies these versions.
PEP440 is the schema used to describe the versions of Ansible.
Expand Down Expand Up @@ -72,8 +76,8 @@ qradar.example.com
ansible_network_os=ibm.qradar.qradar
ansible_user=admin
ansible_httpapi_pass=SuperSekretPassword
ansible_httpapi_use_ssl=yes
ansible_httpapi_validate_certs=yes
ansible_httpapi_use_ssl=true
ansible_httpapi_validate_certs=true
ansible_connection=httpapi
```
Expand Down
2 changes: 0 additions & 2 deletions bindep.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
gcc-c++ [doc test platform:rpm]
python3-devel [test platform:rpm]
python3 [test platform:rpm]
libssh-devel [test platform:rpm]
libssh-dev [test platform:dpkg]
Loading

0 comments on commit ee40ea5

Please sign in to comment.