From 97eef40894e2376f65a62c6db43731cc55e6387a Mon Sep 17 00:00:00 2001 From: TiTom73 Date: Sat, 8 May 2021 15:01:15 +0200 Subject: [PATCH] ci(actions): Update Labeler action (#356) * ci(actions): Update Labeler action * Refresh GH data --- .devcontainer/Dockerfile | 56 ++--------- .devcontainer/devcontainer.json | 117 ++++++++++++++++------ .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 19 +++- .github/labeler.yml | 24 ++++- 6 files changed, 129 insertions(+), 91 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c88e3dd0a..d4c121e63 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,52 +1,8 @@ -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- +ARG VARIANT="3.6" +FROM avdteam/base:${VARIANT} -FROM python:3 +WORKDIR /workspace +VOLUME ["/workspace"] -# Avoid warnings by switching to noninteractive -ENV DEBIAN_FRONTEND=noninteractive - -# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser" -# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs -# will be updated to match your local UID/GID (when using the dockerFile property). -# See https://aka.ms/vscode-remote/containers/non-root-user for details. -ARG USERNAME=vscode -ARG USER_UID=1000 -ARG USER_GID=$USER_UID - -# Uncomment the following COPY line and the corresponding lines in the `RUN` command if you wish to -# include your requirements in the image itself. It is suggested that you only do this if your -# requirements rarely (if ever) change. -# COPY requirements.txt /tmp/pip-tmp/ - -# Configure apt and install packages -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ - # - # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed - && apt-get -y install git iproute2 procps lsb-release \ - # - # Install pylint - && pip --disable-pip-version-check --no-cache-dir install pylint \ - # - # Update Python environment based on requirements.txt - # && pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ - # && rm -rf /tmp/pip-tmp \ - # - # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. - && groupadd --gid $USER_GID $USERNAME \ - && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ - # [Optional] Add sudo support for the non-root user - && apt-get install -y sudo \ - && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ - && chmod 0440 /etc/sudoers.d/$USERNAME \ - # - # Clean up - && apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* - -# Switch back to dialog for any ad-hoc use of apt-get -ENV DEBIAN_FRONTEND=dialog +USER avd +RUN rm -f /home/avd/.gitconfig diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dff919383..a400bd859 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,34 +1,87 @@ -// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at -// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/python-3 { - "name": "Ansible CVP development", - "context": "..", - "dockerFile": "Dockerfile", - - // Use 'settings' to set *default* container specific settings.json values on container create. - // You can edit these settings after create using File > Preferences > Settings > Remote. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash", - "python.pythonPath": "/usr/local/bin/python", - "python.linting.enabled": true, - "python.linting.pylintEnabled": true, - "python.linting.pylintPath": "/usr/local/bin/pylint" - }, - - // Use 'appPort' to create a container with published ports. If the port isn't working, be sure - // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost. - // "appPort": [], - - // Uncomment the next line to run commands after the container is created. - "postCreateCommand": "pip install -r requirements.txt && pip install -r requirements.dev.txt", - - // Uncomment the next line to have VS Code connect as an existing non-root user in the container. - // On Linux, by default, the container user's UID/GID will be updated to match your local user. See - // https://aka.ms/vscode-remote/containers/non-root for details on adding a non-root user if none exist. - // "remoteUser": "vscode", - - // Add the IDs of extensions you want installed when the container is created in the array below. - "extensions": [ - "ms-python.python" - ] + "name": "AVD Development", + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick Python version of AVD runner: 3.6, 3.7, 3.8 + "args": { "VARIANT": "3.6" }, + }, + "remoteUser": "avd", + "updateRemoteUserUID": true, + "workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspace,type=bind,consistency=delegated", + "workspaceFolder": "/workspace", + "extensions": [ + "christian-kohler.path-intellisense", + "codezombiech.gitignore", + "DavidAnson.vscode-markdownlint", + "donjayamanne.python-extension-pack", + "eamodio.gitlens", + "felipe-mendes.slack-theme", + "haaaad.ansible", + "jack89ita.copy-filename", + "jdinhlife.gruvbox", + "jebbs.markdown-extended", + "magicstack.MagicPython", + "mhutchie.git-graph", + "ms-python.python", + "ms-toolsai.jupyter", + "njpwerner.autodocstring", + "PKief.material-icon-theme", + "redhat.vscode-yaml", + "samuelcolvin.jinjahtml", + "timonwong.ansible-autocomplete", + "tuxtina.json2yaml", + "wholroyd.jinja", + "yzhang.markdown-all-in-one", + "coenraads.bracket-pair-colorizer-2", + "github.vscode-pull-request-github", + "ms-python.vscode-pylance" + ], + "settings": { + "python.pythonPath": "/usr/local/bin/python", + "python.analysis.extraPaths": [ + "/workspace/" + ], + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, + "editor.rulers": [ + 80, + 120 + ], + "editor.formatOnPaste": true, + "files.trimTrailingWhitespace": true, + "python.linting.pycodestyleEnabled": false, + "python.linting.pycodestyleArgs": [ + "--max-line-length=120", + "--ignore=E501,722" + ], + "python.linting.flake8Enabled": true, + "python.linting.flake8Args": [ + "--max-line-length=120", + "--ignore=E722,E501", + "--verbose", + "--exclude=*.pyc *.git", + "--format=pylint" + ], + "python.linting.pylintArgs": [ + "--max-line-length=120", + "--disable=E501,W0142,W0403,W0613,W0232,R0903,R0913,C0103,R0914,C0304,F0401,W0402,E1101,W0614,C0111,C0301" + ], + "autoDocstring.startOnNewLine": true, + "telemetry.enableCrashReporter": false, + "telemetry.enableTelemetry": false, + "gitlens.views.repositories.location": "scm", + "gitlens.views.fileHistory.location": "explorer", + "gitlens.views.lineHistory.location": "explorer", + "gitlens.views.search.location": "scm", + "gitlens.views.compare.location": "scm", + "gitlens.views.repositories.files.layout": "tree", + "editor.renderWhitespace": "all", + "files.autoSave": "onFocusChange", + "autoDocstring.includeName": true, + "autoDocstring.docstringFormat": "numpy", + "autoDocstring.includeExtendedSummary": true, + "path-intellisense.autoSlashAfterDirectory": true, + "editor.find.autoFindInSelection": "multiline", + "githubIssues.issueBranchTitle": "issues/${issueNumber}" + } } diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 518a29a33..dae565460 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Issue template about: Report an issue title: "" -labels: Triage +labels: 'status: Triage' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 95d2e05fc..87f817a1b 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: 'Feature Request - ' -labels: 'Triage' +labels: 'status: Triage' assignees: '' --- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b15c873dc..e187253a1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,6 @@ - +## Change Summary + + ## Types of changes @@ -11,20 +13,27 @@ - [ ] Other (please describe): ## Related Issue(s) - + +Fixes # + +## Component(s) name + +`arista.cvp.` ## Proposed changes + ## How to test - ## Checklist: +- [ ] My code has been rebased from devel before I start +- [ ] I have read the [**CONTRIBUTING**](https://www.avd.sh/docs/contributing/) document. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. -- [ ] I have read the [**CONTRIBUTING**](https://github.com/aristanetworks/ansible-cvp/blob/master/contributing.md#branches) document. -- [ ] All new and existing tests passed (`make linting` and `make sanity-lint`). +- [ ] I have updated [molecule CI](https://github.com/aristanetworks/ansible-avd/tree/devel/ansible_collections/arista/avd/molecule) testing accordingly +- [ ] All new and existing tests passed ([`pre-commit`](https://www.avd.sh/docs/installation/development/#python-virtual-environment), `make linting` and `make sanity-lint`). diff --git a/.github/labeler.yml b/.github/labeler.yml index 9b64c9e6a..1792bc405 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,22 +1,42 @@ "module: cv_configlet": - ansible_collections/arista/cvp/plugins/modules/cv_configlet.py +"module: cv_configlet_v3": + - ansible_collections/arista/cvp/plugins/modules/cv_configlet_v3.py + - ansible_collections/arista/cvp/plugins/module_utils/configlet_tools.py + "module: cv_container": - ansible_collections/arista/cvp/plugins/modules/cv_container.py +"module: cv_container_v3": + - ansible_collections/arista/cvp/plugins/modules/cv_container_v3.py + - ansible_collections/arista/cvp/plugins/module_utils/container_tools.py + "module: cv_device": - ansible_collections/arista/cvp/plugins/modules/cv_device.py +"module: cv_device_v3": + - ansible_collections/arista/cvp/plugins/modules/cv_device_v3.py + - ansible_collections/arista/cvp/plugins/module_utils/device_tools.py + "module: cv_facts": - ansible_collections/arista/cvp/plugins/modules/cv_facts.py "module: cv_task": - ansible_collections/arista/cvp/plugins/modules/cv_task.py +"module: cv_task_v3": + - ansible_collections/arista/cvp/plugins/modules/cv_task_v3.py + - ansible_collections/arista/cvp/plugins/module_utils/task_tools.py + "module_utils: cv_client": - ansible_collections/arista/cvp/plugins/module_utils/* - ansible_collections/arista/cvp/plugins/module_utils/**/* +"data-model changes": + - ansible_collections/arista/cvp/plugins/module_utils/schema_v1.py + - ansible_collections/arista/cvp/plugins/module_utils/schema_v3.py + "role: ztp_configuration": - ansible_collections/arista/cvp/roles/dhcp_configuration/* - ansible_collections/arista/cvp/roles/dhcp_configuration/**/* @@ -40,6 +60,6 @@ - development/Makefile "type: dependencies": - - development/requirements-dev.txt - - development/requirements.txt + - ansible_collections/arista/cvp/requirements-dev.txt + - ansible_collections/arista/cvp/requirements.txt - ansible_collections/arista/cvp/docs/requirements.txt