Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Update pre-commit versions #695

Merged
merged 32 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3ede737
CI: updating min python version to 3.11
sugetha24 Jun 3, 2024
05acbaa
added pre-commit yaml file
sugetha24 Jun 3, 2024
2b3d7c2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 3, 2024
440acca
added pylint ignore
sugetha24 Jun 3, 2024
3f48736
make CI pass again
sugetha24 Jun 3, 2024
2827074
adding ignore for ansible-test sanity
sugetha24 Jun 3, 2024
91bea2e
make CI happy again!
sugetha24 Jun 3, 2024
d684fe3
hardcoding ansible-lint to keep CI happy
sugetha24 Jun 3, 2024
7e7dc14
downgraded python version in matrix
sugetha24 Jun 3, 2024
a8c80e7
pinning ansible-lint
sugetha24 Jun 3, 2024
962af47
CI happy: removed comments
sugetha24 Jun 3, 2024
c5a746d
CI happy: downgrade to 3.9
sugetha24 Jun 4, 2024
26b58d7
downgrading pylint version to 3.1.1
sugetha24 Jun 27, 2024
4d58e12
fixing pylint errors
sugetha24 Jun 27, 2024
4cd583e
upgrade python version to 3.10 in ansible-lint
sugetha24 Jun 28, 2024
32c9f59
partial ansible-lint commit
sugetha24 Jul 1, 2024
d1918e2
partial2: ansible-lint fix
sugetha24 Jul 1, 2024
3d5bbb4
partial2: ansible-lint fix
sugetha24 Jul 2, 2024
989288e
partial3: ansible-lint fix
sugetha24 Jul 3, 2024
fd80642
partial4: ansible-lint fix
sugetha24 Jul 3, 2024
fcdf6de
partial5: ansible-lint fix
sugetha24 Jul 3, 2024
48e3d76
moved yammlint inside the collection
sugetha24 Jul 5, 2024
8d39262
changed yamllint rules
sugetha24 Jul 5, 2024
ca511e7
Run python unit tests only
sugetha24 Jul 5, 2024
2b00105
excluding molecule/ and examples/
sugetha24 Jul 5, 2024
4f7de60
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 5, 2024
e95d81d
fixed roles/configlet_sync
sugetha24 Jul 5, 2024
ce7535f
fix dhcp role
sugetha24 Jul 5, 2024
f036425
ansible-lint fix
sugetha24 Jul 7, 2024
72041a7
Reverting to generic info in inventory
sugetha24 Jul 9, 2024
a61a21b
fixing typos
sugetha24 Jul 9, 2024
0615e2a
created new targets for running pytest
sugetha24 Jul 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/pull-request-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,26 @@ jobs:
run: |
cd ansible_collections/arista/cvp/
ansible-test sanity -v --requirements --docker --python ${{ matrix.python_version }}

ansible_lint:
name: Run ansible-lint test case
runs-on: ubuntu-latest
needs: [ file-changes ]
steps:
- name: 'Set environment variables'
run: |
echo "PY_COLORS=1" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: |
3.10
- name: 'Install Python & Ansible requirements'
run: |
pip install -r ansible_collections/arista/cvp/requirements.txt -r ansible_collections/arista/cvp/requirements-dev.txt --upgrade
ansible-galaxy collection install -r ansible_collections/arista/cvp/collections.yml
- name: 'Run ansible-test integration test cases'
run: |
cd ansible_collections/arista/cvp/
ansible-lint --force-color --strict -v
2 changes: 1 addition & 1 deletion .github/yamllintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rules:
level: warning
indent-sequences: consistent
line-length:
max: 140
max: 350
level: warning
allow-non-breakable-inline-mappings: true
truthy: disable
18 changes: 5 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- name: Check and insert license on Python files
id: insert-license
Expand Down Expand Up @@ -62,7 +62,7 @@ repos:
- '<!--| ~| -->'

- repo: https://github.com/pycqa/pylint
rev: "v2.16.1"
rev: "v3.1.1"
hooks:
- id: pylint # Use pylintrc file in repository
name: Check for Linting errors on Python files
Expand All @@ -73,7 +73,7 @@ repos:
- -d duplicate-code

- repo: https://github.com/adrienverge/yamllint.git
rev: 'v1.23.0'
rev: 'v1.35.1'
hooks:
- id: yamllint
name: Check for Linting error on YAML files
Expand All @@ -83,16 +83,8 @@ repos:
types: [file, yaml]
args: [-c=.github/yamllintrc]

- repo: https://github.com/ansible/ansible-lint.git
rev: v4.2.0
hooks:
- id: ansible-lint
name: Check for ansible-lint errors
files: \.(yaml|yml)$
exclude: ansible_collections/arista/cvp/docs

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.1
rev: v0.41.0
hooks:
- id: markdownlint
args:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
14 changes: 14 additions & 0 deletions ansible_collections/arista/cvp/.ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
profile: production

skip_list:
- name[template] # Remove warnings on task names where Jinja template is not at the end
- run-once[task] # Remove warnings on using run_once with other strategies
- meta-no-info # Ansible-lint does not honor meta-schema with standalone: false
- var-naming[no-role-prefix]
- var-naming[pattern]
# kinds:
# - yaml: "**/molecule/**/inventory/host_vars/roles.yml"
exclude_paths:
- molecule/
- examples/
33 changes: 33 additions & 0 deletions ansible_collections/arista/cvp/.yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# Based on ansible-lint config
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/build-md/doc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Arista Networks, Inc.
# Copyright (c) 2023-2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{#
Copyright (c) 2023 Arista Networks, Inc.
Copyright (c) 2023-2024 Arista Networks, Inc.
Use of this source code is governed by the Apache License 2.0
that can be found in the LICENSE file.
#}
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/contributing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/faq/containers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/faq/errors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/how-to/debug.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_device.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_facts.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_facts_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_image_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_tag_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_task.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/modules/cv_task_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/release-notes/v1.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/release-notes/v2.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/release-notes/v3.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/schema/cv_device_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/docs/schema/cv_tag_v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2023 Arista Networks, Inc.
~ Copyright (c) 2023-2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
parent: Leaf Upgrades

tasks:
- name: "Create a change control on {{inventory_hostname}}"
- name: "Create a change control on {{ inventory_hostname }}"
arista.cvp.cv_change_control_v3:
state: set
change: "{{ change }}"
register: cv_change_control_test

- name: "Approve and Execute a change control on {{inventory_hostname}} using change_id field"
- name: "Approve and Execute a change control using change_id field on {{ inventory_hostname }}"
arista.cvp.cv_change_control_v3:
state: approve_and_execute
change_id: ["{{ cv_change_control_test.data.id }}"]
Loading
Loading