Skip to content

Commit

Permalink
Reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Jun 26, 2024
1 parent 6279e70 commit 72bd6f0
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 69 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
exclude_paths:
- mkdocs.yml
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
labels:
- "skip-changelog"
- skip-changelog
69 changes: 34 additions & 35 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
---
# Format and labels used by Ansible DevTools projects
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
name-template: v$RESOLVED_VERSION
tag-template: v$RESOLVED_VERSION
# Use '-' instead of '*' for unordered list to match prettier behavior
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
categories:
- title: "Enhancements"
- title: Enhancements
labels:
- "major" # c6476b
- "minor"
- "feature" # 006b75
- "enhancement" # ededed
- "refactoring"
- title: "Bugfixes"
- major # c6476b
- minor
- feature # 006b75
- enhancement # ededed
- refactoring
- title: Bugfixes
labels:
- "bug" # fbca04
- title: Other
- "patch"
- "deprecated" # fef2c0
- bug # fbca04
- title: Other - "patch" - "deprecated" # fef2c0
exclude-labels:
- "bot:chronographer:skip"
- "skip-changelog"
- bot:chronographer:skip
- skip-changelog
replacers:
# https://github.com/release-drafter/release-drafter/issues/569#issuecomment-645942909
- search: '/(?:and )?@(pre-commit-ci|dependabot)(?:\[bot\])?,?/g'
- search: /(?:and )?@(pre-commit-ci|dependabot)(?:\[bot\])?,?/g
replace: ""
version-resolver:
# major:
# labels:
minor:
labels:
- "major"
- "minor"
- "feature"
- "enhancement"
- "refactoring"
- major
- minor
- feature
- enhancement
- refactoring
patch:
labels:
- "patch"
- "bug"
- "deprecated"
- patch
- bug
- deprecated
default: patch
exclude-contributors:
- "dependabot"
- "pre-commit-ci"
- dependabot
- pre-commit-ci
autolabeler:
- label: "skip-changelog"
- label: skip-changelog
title:
- "/pre-commit autoupdate/"
- /pre-commit autoupdate/
body:
- "/type: chore/i"
branch:
- "/^chore/i"
- label: "bug"
- /^chore/i
- label: bug
branch:
- "/^fix/i"
- /^fix/i
body:
- "/type: fix/i"
- label: "feature"
- label: feature
title:
- "/^(feat|feature)/i"
- /^(feat|feature)/i
body:
- "/type: feature/i"
- label: "deprecated"
- label: deprecated
title:
- "/^deprecat(ed|ion)/i"
- /^deprecat(ed|ion)/i
body:
- "/type: deprecat(ed|ion)/i"
template: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ack.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# ack workflow runs on any change made to a pull-request and aims to verify
# that is following our practices. Initial version is checking correct label
# presence.
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# 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.
Expand All @@ -8,8 +9,8 @@ on:
# branches to consider in the event; optional, defaults to all
branches:
- main
- "releases/**"
- "stable/**"
- releases/**
- stable/**
workflow_call: # allows reuse of this workflow from other devtools repos

jobs:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/push_network.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# 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.
Expand Down Expand Up @@ -58,9 +59,9 @@ jobs:

- name: Get previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@master"
uses: WyriHaximus/github-action-get-previous-tag@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

## this part is commented out to check push workflow
## ref - https://github.com/ansible-collections/cisco.nxos/pull/765
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: release

on:
Expand All @@ -11,16 +12,16 @@ on:
type: boolean
secrets:
pypi_password:
description: "API token for pypi.org"
description: API token for pypi.org
required: true
testpypi_password:
description: "API token for test.pypi.org"
description: API token for test.pypi.org
required: true

jobs:
pypi:
name: Publish to PyPI registry
if: "${{ inputs.pypi }}"
if: ${{ inputs.pypi }}
environment: release
runs-on: ubuntu-20.04

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_ah.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: "Build the collection"
- name: Build the collection
run: |
ansible-galaxy collection build -v --force
- name: "Publish the collection on Automation Hub"
- name: Publish the collection on Automation Hub
if: ${{ inputs.ah_publish }}
run: |
[[ "${{ secrets.ah_token != '' }}" ]] || { echo "ah_token is required to publish on automation hub" ; exit 1; }
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: "Build the collection"
- name: Build the collection
run: |
ansible-galaxy collection build -v --force
- name: "Publish the collection on Galaxy"
- name: Publish the collection on Galaxy
if: ${{ inputs.galaxy_publish }}
run: |
[[ "${{ secrets.ansible_galaxy_api_key != '' }}" ]] || { echo "ansible_galaxy_api_key is required to publish on galaxy" ; exit 1; }
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: test
on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
printf '### Failed as git reported modified and/or untracked files\n```\n%s\n```\n' "$(git status -s)" | tee -a "$GITHUB_STEP_SUMMARY"
exit 99
fi
# https://github.com/actions/toolkit/issues/193
# https://github.com/actions/toolkit/issues/193

check:
if: always()
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ repos:
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/ansible/ansible-lint
rev: v24.6.1
hooks:
- id: ansible-lint
args: [--fix]
6 changes: 6 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
extends: default
rules:
braces:
max-spaces-inside: 1
comments:
# prettier compatibility
min-spaces-from-content: 1
Expand All @@ -10,6 +13,9 @@ rules:
document-start: disable
# we need to decide if we want to impose one or not
line-length: disable
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
truthy:
# "on:" is perfectly valid key on github actions:
check-keys: false
37 changes: 21 additions & 16 deletions config/devtools.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# TODO: allow layered loading from other repos like dependabot config
# Symlink this as ~/pre.yml and use https://github.com/pycontribs/gh-pre
# This file documents repositories that are nurtured by Ansible DevTools team.
Expand All @@ -14,11 +15,14 @@ repos:
group: primary
ansible-collections/community.molecule:
section: community
ansible-community/molecule-plugins:
section: community
# ansible-community/molecule-plugins:
# section: community
ansible/ansible-backstage-plugins:
section: experimental
ansible/ansible-compat: {}
ansible/ansible-content-actions:
section: experimental
# https://github.com/marketplace/actions/ansible-content-actions
ansible/ansible-creator:
section: experimental
ansible/ansible-dev-environment:
Expand All @@ -28,9 +32,6 @@ repos:
ansible/ansible-navigator: {}
ansible/ansible-workspace-env-reference-image:
section: community
ansible/community-ansible-dev-tools-image: {}
ansible/creator-ee:
section: deprecated
ansible/mkdocs-ansible:
section: community
ansible/molecule: {}
Expand All @@ -40,19 +41,23 @@ repos:
ansible/tox-ansible:
section: experimental
ansible/vscode-ansible: {}
coactions/dynamic-matrix:
section: community
pycontribs/enrich:
section: community
pycontribs/subprocess-tee:
section: community
sections:
community: null
deprecated: null
experimental: null
primary: null
# unmaintained, obsoleted or archived:
# - ansible-community/protogen # deprecated?
# - ansible-community/role2collection
# - ansible/ansible-language-server (now part vscode-ansible)
# - ansible/ansible-lint-action (now part of ansible-lint)
# - pycontribs/selinux
# - pytest-molecule#
community:
deprecated:
experimental:
primary:
# unmaintained, obsoleted or archived:
# ansible-community/protogen
# ansible-community/role2collection
# ansible/ansible-language-server (now part vscode-ansible)
# ansible/ansible-lint-action (now part of ansible-lint)
# ansible/community-ansible-dev-tools-image (now part of ansible-dev-tools)
# ansible/creator-ee (now part of ansible-dev-tools)
# pycontribs/selinux
# pytest-molecule#
5 changes: 3 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
site_name: Ansible DevTools
site_url: https://ansible.readthedocs.io/projects/team-devtools/
repo_url: https://github.com/ansible/team-devtools
Expand Down Expand Up @@ -34,8 +35,8 @@ nav:
- Release: guides/vscode/release.md
- stats:
- Molecule Plugins: stats/molecule-plugins.md
# - ansible-language-server: '!import https://github.com/ansible/ansible-language-server?branch=main&multi_docs=False'
# - projects: "*include .cache/*/mkdocs.yml"
# - ansible-language-server: '!import https://github.com/ansible/ansible-language-server?branch=main&multi_docs=False'
# - projects: "*include .cache/*/mkdocs.yml"
plugins:
- autorefs
- material/search
Expand Down
4 changes: 3 additions & 1 deletion playbooks/deploy-bot-pat.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Deploy BOT_PAT secret
hosts: localhost
gather_facts: false
Expand All @@ -7,7 +8,8 @@
file: ../config/devtools.yml
name: devtools

- debug:
- name: Display info
ansible.builtin.debug:
msg: "{{ item }}"
loop: "{{ env_secrets | dict2items(key_name='env_name', value_name='env_secrets') }}"

Expand Down
1 change: 1 addition & 0 deletions playbooks/host_vars/localhost.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
env_secrets:
ack: # github environment name
BOT_PAT: !vault |
Expand Down
1 change: 1 addition & 0 deletions playbooks/sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Checkout and Update DevTools project source code
hosts: localhost
connection: local
Expand Down
2 changes: 2 additions & 0 deletions playbooks/tasks/gh-set-env-secrets.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
- name: Create github environment
ansible.builtin.shell: >
gh api --method PUT -H "Accept: application/vnd.github+json" repos/{{ repo }}/environments/{{ env.env_name }}
changed_when: true
loop: "{{ env_secrets | dict2items(key_name='env_name', value_name='env_secrets') }}"
loop_control:
loop_var: env
Expand Down
2 changes: 2 additions & 0 deletions playbooks/tasks/gh-set-secret.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
- name: Configure secret
ansible.builtin.shell: >
gh secret --repo {{ repo }} set --env {{ env.env_name }} {{ item.gh_secret_name }} --body {{ item.gh_secret_value }}
changed_when: true
no_log: false
loop: "{{ env.env_secrets | dict2items('gh_secret_name', 'gh_secret_value') }}"
1 change: 1 addition & 0 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2

submodules:
Expand Down

0 comments on commit 72bd6f0

Please sign in to comment.