diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/CODE_OF_CONDUCT.md | 3 | ||||
-rw-r--r-- | .github/CONTRIBUTING.rst | 79 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE.md | 32 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/bug_report.md | 65 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/config.yml | 16 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/documentation_report.md | 24 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/feature_request.md | 24 | ||||
-rw-r--r-- | .github/SECURITY.rst | 17 | ||||
-rw-r--r-- | .github/dependabot.yml | 22 | ||||
-rw-r--r-- | .github/release-drafter.yml | 21 | ||||
-rw-r--r-- | .github/workflows/tox.yml | 296 |
11 files changed, 599 insertions, 0 deletions
diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..0164155 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Community Code of Conduct + +Please see the official [Ansible Community Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html). diff --git a/.github/CONTRIBUTING.rst b/.github/CONTRIBUTING.rst new file mode 100644 index 0000000..1319470 --- /dev/null +++ b/.github/CONTRIBUTING.rst @@ -0,0 +1,79 @@ +Contributing to Ansible-lint +============================ + +To contribute to ansible-lint, please use pull requests on a branch +of your own fork. + +After `creating your fork on GitHub`_, you can do: + +.. code-block:: shell-session + + $ git clone git@github.com:yourname/ansible-lint + $ cd ansible-lint + $ git checkout -b your-branch-name + # DO SOME CODING HERE + $ git add your new files + $ git commit -v + $ git push origin your-branch-name + +You will then be able to create a pull request from your commit. + +All fixes to core functionality (i.e. anything except docs or examples) +should be accompanied by tests that fail prior to your change and +succeed afterwards. + +Feel free to raise issues in the repo if you feel unable to +contribute a code fix. + +.. _creating your fork on GitHub: + https://guides.github.com/activities/forking/ + +Standards +--------- + +ansible-lint is flake8 compliant with ``max-line-length`` set to 100 +(see `.flake8`_). + +ansible-lint works only with `supported Ansible versions`_ at the +time it was released. + +Automated tests will be run against all PRs for flake8 compliance +and Ansible compatibility — to check before pushing commits, just +use `tox`_. + +.. _.flake8: https://github.com/ansible/ansible-lint/blob/master/.flake8 +.. _supported Ansible versions: + https://docs.ansible.com/ansible/devel/reference_appendices + /release_and_maintenance.html#release-status +.. _tox: https://tox.readthedocs.io + +.. DO-NOT-REMOVE-deps-snippet-PLACEHOLDER + +Talk to us +---------- + +Discussion around ansible-lint happens in ``#ansible-galaxy`` IRC +channel on Freenode and the `Ansible Development List`_. + +For the full list of Ansible IRC and Mailing list, please see the +`Ansible Communication`_ page. +Release announcements will be made to the `Ansible Announce`_ list. + +Possible security bugs should be reported via email +to security@ansible.com. + +.. _Ansible Announce: + https://groups.google.com/forum/#!forum/ansible-announce +.. _Ansible Development List: + https://groups.google.com/forum/#!forum/ansible-devel +.. _Ansible Communication: + https://docs.ansible.com/ansible/latest/community/communication.html + +Code of Conduct +--------------- + +As with all Ansible projects, we have a `Code of Conduct`_. + +.. _Code of Conduct: + https://docs.ansible.com/ansible/latest/community + /code_of_conduct.html diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..e07e744 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,32 @@ +# Issue Type +- Bug report +- Feature request + +# Ansible and Ansible Lint details + +``` +ansible --version +ansible-lint --version +``` + +- ansible installation method: one of source, pip, OS package +- ansible-lint installation method: one of source, pip, OS package + +# Desired Behaviour + +Please give some details of the feature being requested +or what should happen if providing a bug report + +Possible security bugs should be reported via email to `security@ansible.com` + +# Actual Behaviour (Bug report only) + +Please give some details of what is actually happening. +Include a [minimum complete verifiable example] with: +- playbook +- output of running ansible-lint +- if you're getting a stack trace, output of + `ansible-playbook --syntax-check playbook` + + +[minimum complete verifiable example]: http://stackoverflow.com/help/mcve diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..3a96005 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,65 @@ +--- +name: 🐛 Bug report +about: Create a bug report. Please test against the master branch before submitting it. +labels: priority/medium, status/new, type/bug +--- +<!--- Verify first that your issue is not already reported on GitHub --> +<!--- Also test if the latest release and master branch are affected too --> + +##### Summary +<!--- Explain the problem briefly below --> + + +##### Issue Type + +- Bug Report + +##### Ansible and Ansible Lint details +<!--- Paste verbatim output between tripple backticks --> +```console (paste below) +ansible --version + +ansible-lint --version + +``` + +- ansible installation method: one of source, pip, OS package +- ansible-lint installation method: one of source, pip, OS package + +##### OS / ENVIRONMENT +<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. --> + + +##### STEPS TO REPRODUCE +<!--- Describe exactly how to reproduce the problem, using a minimal test-case --> + +<!--- Paste example playbooks or commands between tripple backticks below --> +```console (paste below) + +``` + +<!--- HINT: You can paste gist.github.com links for larger files --> + +##### Desired Behaviour +<!--- Describe what you expected to happen when running the steps above --> + +Possible security bugs should be reported via email to `security@ansible.com` + +##### Actual Behaviour +<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) --> + +Please give some details of what is actually happening. +Include a [minimum complete verifiable example] with: +- playbook +- output of running ansible-lint +- if you're getting a stack trace, output of + `ansible-playbook --syntax-check playbook` + + +<!--- Paste verbatim command output between tripple backticks --> +```paste below + +``` + + +[minimum complete verifiable example]: http://stackoverflow.com/help/mcve diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3f5190f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,16 @@ +# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser +blank_issues_enabled: false # default is true +contact_links: +- name: 🔐 Security bug report 🔥 + url: https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html + about: | + Please learn how to report security vulnerabilities here. + + For all security related bugs, email security@ansible.com + instead of using this issue tracker and you will receive + a prompt response. + + For more information, see https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html +- name: 📝 Ansible Code of Conduct + url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html + about: ❤ Be nice to other members of the community. ☮ Behave. diff --git a/.github/ISSUE_TEMPLATE/documentation_report.md b/.github/ISSUE_TEMPLATE/documentation_report.md new file mode 100644 index 0000000..1d1cfc1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation_report.md @@ -0,0 +1,24 @@ +--- +name: 📝 Documentation Report +about: Ask us about docs +labels: priority/medium, status/new, documentation +--- +<!--- Verify first that your improvement is not already reported on GitHub --> +<!--- Also test if the latest release and master branch are affected too --> + +##### SUMMARY +<!--- Explain the problem briefly below, add suggestions to wording or structure --> + +<!--- HINT: Did you know the documentation has an "Edit on GitHub" link on every page ? --> + +##### ISSUE TYPE + +- Documentation Report + +##### OS / ENVIRONMENT +<!--- Provide all relevant information below, e.g. OS version, browser, etc. --> + +##### ADDITIONAL INFORMATION +<!--- Describe how this improves the documentation, e.g. before/after situation or screenshots --> + +<!--- HINT: You can paste gist.github.com links for larger files --> diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..b02df01 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,24 @@ +--- +name: ✨ Feature request +about: Suggest an idea for this project +labels: priority/medium, status/new, type/enchancement +--- +<!--- Verify first that your feature was not already discussed on GitHub --> + +##### Summary +<!--- Describe the new feature/improvement briefly below --> + + +##### Issue Type + +- Feature Idea + +##### Additional Information +<!--- Describe how the feature would be used, why it is needed and what it would solve --> + +<!--- Paste example playbooks or commands between quotes below --> +```console + +``` + +<!--- HINT: You can also paste gist.github.com links for larger files --> diff --git a/.github/SECURITY.rst b/.github/SECURITY.rst new file mode 100644 index 0000000..b9190d8 --- /dev/null +++ b/.github/SECURITY.rst @@ -0,0 +1,17 @@ +Security Policy +--------------- + +Supported Versions +================== + +Ansible applies security fixes according to the 3-versions-back support +policy. Please find more information in `our docs +<https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html#release-status>`_. + +Reporting a Vulnerability +========================= + +We encourage responsible disclosure practices for security +vulnerabilities. Please read our `policies for reporting bugs +<https://docs.ansible.com/ansible/devel/community/reporting_bugs_and_features.html#reporting-a-bug>`_ +if you want to report a security issue that might affect Ansible. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..892b0dd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: +- package-ecosystem: pip + directory: /docs + schedule: + day: sunday + interval: weekly + labels: + - dependabot-deps-updates + - skip-changelog + versioning-strategy: lockfile-only + open-pull-requests-limit: 3 +- package-ecosystem: pip + directory: / + schedule: + day: sunday + interval: weekly + labels: + - dependabot-deps-updates + - skip-changelog + versioning-strategy: lockfile-only + open-pull-requests-limit: 3 diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..f457c5d --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,21 @@ +# Format and labels used aim to match those used by Ansible project +categories: + - title: 'Major Changes' + labels: + - 'major' # c6476b + - title: 'Minor Changes' + labels: + - 'feature' # 006b75 + - 'enhancement' # ededed + - title: 'Bugfixes' + labels: + - 'bug' # fbca04 + - title: 'Deprecations' + labels: + - 'deprecated' # fef2c0 +exclude-labels: + - 'skip-changelog' +template: | + ## Changes + + $CHANGES diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 0000000..3966ef1 --- /dev/null +++ b/.github/workflows/tox.yml @@ -0,0 +1,296 @@ +name: gh + +on: + create: # is used for publishing to PyPI and TestPyPI + tags: # any tag regardless of its name, no branches + push: # only publishes pushes to the main branch to TestPyPI + branches: # any branch but not tag + - >- + ** + tags-ignore: + - >- + ** + pull_request: + schedule: + - cron: 1 0 * * * # Run daily at 0:01 UTC + # Run every Friday at 18:02 UTC + # https://crontab.guru/#2_18_*_*_5 + # - cron: 2 18 * * 5 + +jobs: + linters: + name: >- + ${{ matrix.env.TOXENV }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: + - 3.8 + os: + - ubuntu-latest + env: + - TOXENV: lint + - TOXENV: docs + - TOXENV: build-dists,metadata-validation + env: + TOX_PARALLEL_NO_SPINNER: 1 + + steps: + - uses: actions/checkout@master + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: set PY_SHA256 + run: echo "::set-env name=PY_SHA256::$(python -VV | sha256sum | cut -d' ' -f1)" + - name: Pre-commit cache + uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: ${{ runner.os }}-pre-commit-${{ env.PY_SHA256 }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('tox.ini') }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('pytest.ini') }} + - name: Pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ env.PY_SHA256 }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('tox.ini') }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('pytest.ini') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install tox + run: | + python -m pip install --upgrade tox + - name: Log installed dists + run: >- + python -m pip freeze --all + - name: >- + Initialize tox envs + run: >- + python -m + tox + --parallel auto + --parallel-live + --notest + --skip-missing-interpreters false + -vv + env: ${{ matrix.env }} + - name: Test with tox + run: | + python -m tox --parallel auto --parallel-live + env: ${{ matrix.env }} + - name: Archive logs + uses: actions/upload-artifact@v2 + with: + name: logs.zip + path: .tox/**/log/ + + unit: + name: >- + py${{ matrix.python-version }}@${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + # fail-fast: false + # max-parallel: 5 + # The matrix testing goal is to cover the *most likely* environments + # which are expected to be used by users in production. Avoid adding a + # combination unless there are good reasons to test it, like having + # proof that we failed to catch a bug by not running it. Using + # distribution should be prefferred instead of custom builds. + matrix: + python-version: + # keep list sorted as it determines UI order too + - 3.6 + - 3.7 + - 3.8 + # NOTE: Installing ansible under 3.10-dev is currently not + # NOTE: possible because compiling cffi explodes. + os: + # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners + - ubuntu-latest # 18.04 + # - windows-latest + # - windows-2016 + include: + - os: ubuntu-20.04 + python-version: 3.9-dev + - os: macOS-latest + python-version: 3.6 + - os: macOS-latest + python-version: 3.8 + + env: + TOX_PARALLEL_NO_SPINNER: 1 + + steps: + - uses: actions/checkout@master + - name: Get history and tags for SCM versioning to work + run: | + git fetch --prune --unshallow + git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Set up stock Python ${{ matrix.python-version }} from GitHub + if: >- + !endsWith(matrix.python-version, '-dev') + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} from deadsnakes + if: >- + endsWith(matrix.python-version, '-dev') + uses: deadsnakes/action@v1.0.0 + with: + python-version: ${{ matrix.python-version }} + - name: >- + Log the currently selected Python + version info (${{ matrix.python-version }}) + run: | + python --version --version + which python + - name: Pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ env.PY_SHA256 }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('tox.ini') }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('pytest.ini') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install tox + run: | + python -m pip install --upgrade tox + - name: Log installed dists + run: >- + python -m pip freeze --all + - name: >- + Initialize tox envs + run: >- + python -m + tox + --parallel auto + --parallel-live + --notest + --skip-missing-interpreters false + -vv + env: + TOXENV: ansible28,ansible29,ansible210,ansibledevel + - name: "Test with tox: ansible28" + run: | + python -m tox + env: + TOXENV: ansible28 + # sequential run improves browsing experience (almost no speed impact) + - name: "Test with tox: ansible29" + run: | + python -m tox + env: + TOXENV: ansible29 + - name: "Test with tox: ansible210" + run: | + python -m tox + env: + TOXENV: ansible210 + - name: "Test with tox: ansibledevel" + run: | + python -m tox + env: + TOXENV: ansibledevel + - name: Archive logs + uses: actions/upload-artifact@v2 + with: + name: logs.zip + path: .tox/**/log/ + # https://github.com/actions/upload-artifact/issues/123 + continue-on-error: true + - name: Report junit failures + uses: shyim/junit-report-annotations-action@3d2e5374f2b13e70f6f3209a21adfdbc42c466ae + with: + path: .tox/junit.*.xml + if: always() + + publish: + name: Publish to PyPI registry + needs: + - linters + - unit + runs-on: ubuntu-latest + + env: + PY_COLORS: 1 + TOXENV: build-dists,metadata-validation + TOX_PARALLEL_NO_SPINNER: 1 + + steps: + - name: Switch to using Python 3.8 by default + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install tox + run: >- + python -m + pip install + --user + tox + - name: Check out src from Git + uses: actions/checkout@v2 + with: + # Get shallow Git history (default) for tag creation events + # but have a complete clone for any other workflows. + # Both options fetch tags but since we're going to remove + # one from HEAD in non-create-tag workflows, we need full + # history for them. + fetch-depth: >- + ${{ + ( + github.event_name == 'create' && + github.event.ref_type == 'tag' + ) && + 1 || 0 + }} + - name: Drop Git tags from HEAD for non-tag-create events + if: >- + github.event_name != 'create' || + github.event.ref_type != 'tag' + run: >- + git tag --points-at HEAD + | + xargs git tag --delete + - name: Instruct setuptools-scm not to add a local version part + if: >- + github.event_name == 'push' && + github.ref == format( + 'refs/heads/{0}', github.event.repository.default_branch + ) + run: | + echo 'local_scheme = "no-local-version"' >> pyproject.toml + git update-index --assume-unchanged pyproject.toml + - name: Pre-populate tox env + run: >- + python -m + tox + --parallel auto + --parallel-live + --notest + --skip-missing-interpreters false + -vvvv + - name: Build dists + run: python -m tox -p auto --parallel-live -vvvv + - name: Publish to test.pypi.org + if: >- + ( + github.event_name == 'push' && + github.ref == format( + 'refs/heads/{0}', github.event.repository.default_branch + ) + ) || + ( + github.event_name == 'create' && + github.event.ref_type == 'tag' + ) + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.testpypi_password }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish to pypi.org + if: >- # "create" workflows run separately from "push" & "pull_request" + github.event_name == 'create' && + github.event.ref_type == 'tag' + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} |