Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 57 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Bug Report
description: Report a bug
title: "Bug Report Title"
labels: ["type: bug", triage]
# TODO: consider adding types here instead of label
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!

- type: textarea
id: issue-summary
attributes:
label: Issue Summary
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "please detail your issue"
validations:
required: true

- type: input
id: ansible-version
attributes:
label: Ansible version
description: If relevant, provide the Ansible version.

- type: input
id: python-version
attributes:
label: Python version
description: If relevant, on which Python version(s) have you found this bug?

- type: textarea
id: step-to-reproduce
attributes:
label: Steps to reproduce
description: Please copy and paste any relevant inputs to reproduce your issue.
render: shell

- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code.
render: shell

- type: checkboxes
id: terms
attributes:
label: Contributing Guide
description: |
By submitting this issue, you agree to follow our
[contribution guide](https://github.com/arista-netdevops-community/ansible-community-collection/CONTRIBUTE.md)
options:
- label: I agree to follow this project Code of Conduct
required: true
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Feature Request
description: Ask for new feature or feature enhancement
title: "Feature request Title"
labels: ["type: enhancement", triage]
# TODO: consider adding types here instead of label
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!

- type: textarea
id: feature-summary
attributes:
label: Enhancement summary
value: "please detail your feature enhancement"
validations:
required: true

- type: textarea
id: feature-use-case
attributes:
label: Use case example
value: "please detail your use case"
validations:
required: true

- type: textarea
id: expected-solution
attributes:
label: Describe the solution you would like
description: A clear and concise description of what you want to happen.
validations:
required: true

- type: textarea
id: alternative-solution
attributes:
label: Describe alternatives you have considered
description: A clear and concise description of any alternative solutions or features you have considered.
validations:
required: false

- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
validations:
required: false

- type: checkboxes
id: terms
attributes:
label: Contributing Guide
description: |
By submitting this issue, you agree to follow our
[contribution guide](https://github.com/arista-netdevops-community/ansible-community-collection/CONTRIBUTE.md)
options:
- label: I agree to follow this project Code of Conduct
required: true
30 changes: 30 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Change Summary

<!-- Enter short PR description -->

## Related Issue(s)

Fixes #<ISSUE ID>

## Proposed changes
<!--- Describe your changes in detail -->
<!--- Describe data model implemented for new features -->

## How to test
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->

## Checklist

### User Checklist

<!-- Add your own checklist using MD syntax and by replacing N/A -->
- N/A

### Repository Checklist

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code has been rebased from `main` before I started.
- [ ] I have read the [contribution guide](https://github.com/arista-netdevops-community/ansible-community-collection/CONTRIBUTE.md).
- [ ] My change requires a change to the documentation and the documentation has been updated accordingly.
41 changes: 41 additions & 0 deletions .github/actions/rn-pr-labeler-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "rn-pr-labeler"
author: "@gmuloc"
description: "Parse a conventional commit compliant PR title and add it as a label to the PR with the prefix 'rn: '"
inputs:
auto_create_label:
description: "Boolean to indicate if the label should be auto created"
required: false
default: false
runs:
using: "composite"
steps:
- name: 'Looking up existing "rn:" label'
run: |
echo "OLD_LABEL=$(gh pr view ${{ github.event.pull_request.number }} --json labels -q .labels[].name | grep 'rn: ')" >> $GITHUB_ENV
shell: bash
- name: 'Delete existing "rn:" label if found'
run: gh pr edit ${{ github.event.pull_request.number }} --remove-label "${{ env.OLD_LABEL }}"
shell: bash
if: ${{ env.OLD_LABEL }}
- name: Set Label
# Using toJSON to support ' and " in commit messages
# https://stackoverflow.com/questions/73363167/github-actions-how-to-escape-characters-in-commit-message
run: echo "LABEL=$(echo ${{ toJSON(github.event.pull_request.title) }} | cut -d ':' -f 1 | tr -d ' ' | tr ',' '|')" >> $GITHUB_ENV
shell: bash
# an alternative to verifying if the target label already exist is to
# create the label with --force in the next step, it will keep on changing
# the color of the label though so it may not be desirable.
- name: Check if label exist
run: |
EXIST=$(gh label list -L 100 --search "rn:" --json name -q '.[] | select(.name=="rn: ${{ env.LABEL }}").name')
echo "EXIST=$EXIST" >> $GITHUB_ENV
shell: bash
- name: Create Label if auto-create and label does not exist already
run: |
gh label create "rn: ${{ env.LABEL }}"
shell: bash
if: ${{ inputs.auto_create_label && ! env.EXIST }}
- name: Labelling PR
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "rn: ${{ env.LABEL }}"
shell: bash
47 changes: 47 additions & 0 deletions .github/check-git-status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
#
# Purpose: Molecule runner for github-action
# Author: @titom73
# Date: 2020-12-16
# Version: 1.1
# License: APACHE
# --------------------------------------

echo "Script running from ${PWD}"

# Set default values
INPUT_CHECK_GIT="${INPUT_CHECK_GIT:-true}"
INPUT_CHECK_GIT_ENFORCED="${INPUT_CHECK_GIT_ENFORCED:-true}"

if [ ${INPUT_CHECK_GIT} = "true" ]; then
git config core.fileMode false
echo " * Run Git Verifier because CHECK_GIT is set to ${INPUT_CHECK_GIT}"
# if git diff-index --quiet HEAD --; then
GIT_STATUS="$(git status --porcelain)"
if [ "$?" -ne "0" ]; then
echo "'git status --porcelain' failed to run - something is wrong"
exit 1
fi
if [ -n "$GIT_STATUS" ]; then
# Some changes
echo 'Some changes'
echo '------------'
git --no-pager status --short
echo ''
echo 'Diffs are:'
echo '------------'
git --no-pager diff
if [ ${INPUT_CHECK_GIT_ENFORCED} = "true" ]; then
exit 1
else
exit 0
fi
else
# No Changes
echo ' - No change found after running Molecule'
exit 0
fi
exit 0
else
echo " * Git verifier skipped as not set to true"
fi
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
version: 2
updates:
# Maintain dependencies for Python
- package-ecosystem: "pip"
directories:
- "/"
- "/ansible_collections/arista/community/"
schedule:
interval: "weekly"
day: "monday"
pull-request-branch-name:
separator: "/"
commit-message:
prefix: "Bump(requirements): "
prefix-development: "CI(requirements):"
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
commit-message:
prefix: "CI: "
127 changes: 127 additions & 0 deletions .github/generate_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#!/usr/bin/env python
# Copyright (c) 2023-2025 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
"""
generate_release.py.

This script is used to generate the release.yml file as per
https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
"""

from pathlib import Path
from typing import Any

import yaml

SCOPES = [
"build_output_folders",
"dhcp_provisioner",
"eos_validate_state",
"plugins",
"requirements",
"containers",
]

# CI and Test are excluded from Release Notes
CATEGORIES = {
"Feat": "Features",
"Fix": "Bug Fixes",
"Cut": "Cut",
"Doc": "Documentation",
# Excluding "CI": "CI",
"Bump": "Bump",
# Excluding "Test": "Test",
"Revert": "Revert",
"Refactor": "Refactoring",
}


class SafeDumper(yaml.SafeDumper):
"""
Make yamllint happy.

https://github.com/yaml/pyyaml/issues/234#issuecomment-765894586
"""

# pylint: disable=R0901,W0613,W1113

def increase_indent(self, flow: bool = False, *_args: Any, **_kwargs: Any) -> None:
return super().increase_indent(flow=flow, indentless=False)


if __name__ == "__main__":
exclude_list = []
categories_list = []
other_scopes = SCOPES

# First add exclude labels
for scope in SCOPES:
exclude_list.append(f"rn: Test({scope})")
exclude_list.append(f"rn: CI({scope})")
exclude_list.extend(["rn: Test", "rn: CI"])

# Then add the categories
# First add Breaking Changes
breaking_label_categories = ["Feat", "Fix", "Cut", "Revert", "Refactor", "Bump"]
breaking_labels = [f"rn: {cc_type}({scope})!" for cc_type in breaking_label_categories for scope in SCOPES]
breaking_labels.extend([f"rn: {cc_type}!" for cc_type in breaking_label_categories])

categories_list.append(
{
"title": "Breaking Changes",
"labels": breaking_labels,
},
)
# Add other fixes
other_fixes_labels = [f"rn: Fix({scope})" for scope in SCOPES]
other_fixes_labels.append("rn: Fix")

categories_list.append(
{
"title": "Fixed issues",
"labels": other_fixes_labels,
},
)

# Add Documentation
doc_labels = [f"rn: Doc({scope})" for scope in SCOPES]
doc_labels.append("rn: Doc")

categories_list.append(
{
"title": "Documentation",
"labels": doc_labels,
},
)

# Add new features
other_feat_labels = [f"rn: Feat({scope})" for scope in SCOPES]
other_feat_labels.append("rn: Feat")

categories_list.append(
{
"title": "New features and enhancements",
"labels": other_feat_labels,
},
)

# Add the catch all
categories_list.append(
{
"title": "Other Changes",
"labels": ["*"],
},
)
with Path("release.yml").open("w", encoding="utf-8") as release_file:
yaml.dump(
{
"changelog": {
"exclude": {"labels": exclude_list},
"categories": categories_list,
},
},
release_file,
Dumper=SafeDumper,
sort_keys=False,
)
Loading