diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..879568e --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,11 @@ +### Description of Issue + + +### Setup +(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).) + +### Steps to Reproduce Issue +(Include debug logs if possible and relevant.) + +### Versions Report +(Provided by running `salt --versions-report`. Please also mention any differences in master/minion versions.) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..136e41a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,45 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug, needs-triage +assignees: '' + +--- + +**Description** +A clear and concise description of what the bug is. + +**Setup** +(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.) + +Please be as specific as possible and give set-up details. + +- [ ] on-prem machine +- [ ] VM (Virtualbox, KVM, etc. please specify) +- [ ] VM running on a cloud service, please be explicit and add details +- [ ] container (Kubernetes, Docker, containerd, etc. please specify) +- [ ] or a combination, please be explicit +- [ ] jails if it is FreeBSD + + +**Steps to Reproduce the behavior** +(Include debug logs if possible and relevant) + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Versions Report** +
salt --versions-report +(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) + +``` +PASTE HERE +``` +
+ +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..dfec2ac --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,14 @@ +blank_issues_enabled: true +contact_links: + - name: Salt Community Slack + url: https://saltstackcommunity.slack.com/ + about: Please ask and answer questions here. + - name: Salt-Users Forum + url: https://groups.google.com/forum/#!forum/salt-users + about: Please ask and answer questions here. + - name: Salt on LiberaChat + url: https://web.libera.chat/#salt + about: Please ask and answer questions here. + - name: Security vulnerabilities + email: security@saltstack.com + about: Please report security vulnerabilities here. diff --git a/.github/ISSUE_TEMPLATE/docs.md b/.github/ISSUE_TEMPLATE/docs.md new file mode 100644 index 0000000..6a9d2fd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/docs.md @@ -0,0 +1,23 @@ +--- +name: Docs +about: Issue related to Salt Documentation +title: "[DOCS]" +labels: documentation, needs-triage +assignees: '' + +--- + +**Description** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Suggested Fix** +What did you expect to see in the documentation that is missing or needs updating? + +**Type of documentation** +This could be Salt modules or tutorital topics. + +**Location or format of documentation** +Insert page URL if applicable. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..0e0a390 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEATURE REQUEST]" +labels: feature, needs-triage +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..7d63a7c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +### What does this PR do? + +### What issues does this PR fix or reference? +Fixes: + +### Previous Behavior +Remove this section if not relevant + +### New Behavior +Remove this section if not relevant + +### Merge requirements satisfied? +**[NOTICE] Bug fixes or features added to Salt require tests.** + +- [ ] Docs +- [ ] Changelog - https://docs.saltproject.io/en/master/topics/development/changelog.html +- [ ] Tests written/updated + +### Commits signed with GPG? +Yes/No + +Please review [Salt's Contributing Guide](https://docs.saltproject.io/en/master/topics/development/contributing.html) for best practices. + +See GitHub's [page on GPG signing](https://help.github.com/articles/signing-commits-using-gpg/) for more information about signing commits with GPG. diff --git a/.pre-commit-hooks/make-autodocs.py b/.pre-commit-hooks/make-autodocs.py index 6874c35..b7a7e19 100644 --- a/.pre-commit-hooks/make-autodocs.py +++ b/.pre-commit-hooks/make-autodocs.py @@ -1,57 +1,60 @@ -import subprocess -import sys -from enum import IntEnum from pathlib import Path -repo_path = Path(subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode().strip()) -src_dir = repo_path / "src" / " saltext" / "azurerm" -doc_dir = repo_path / "docs" - -docs_by_kind = {} - - -def make_import_path(path): - return ".".join(path.with_suffix("").parts[-4:]) - - -for path in Path(__file__).parent.parent.joinpath("src/saltext/azurerm/").glob("*/*.py"): - if path.name != "__init__.py": - kind = path.parent.name - docs_by_kind.setdefault(kind, set()).add(path) - -for kind in docs_by_kind: - kind_path = doc_dir / "ref" / kind - all_rst = kind_path / "all.rst" - import_paths = [] - for path in sorted(docs_by_kind[kind]): - import_path = make_import_path(path) - import_paths.append(import_path) - rst_path = kind_path.joinpath(import_path).with_suffix(".rst") - print(rst_path) +autodocs = {} + +loader_dirs = ( + "engines", + "modules", + "returners", + "states", +) + +for ldir in loader_dirs: + autodocs[ldir] = [] + +trans = str.maketrans({"_": r"\_"}) +docs_path = Path("docs") +ref_path = docs_path / "ref" + +for path in Path("src").glob("**/*.py"): + if path.name == "__init__.py": + continue + kind = path.parent.name + if kind in loader_dirs: + import_path = ".".join(path.with_suffix("").parts[1:]) + autodocs[kind].append(import_path) + rst_path = ref_path / kind / (import_path + ".rst") + if rst_path.is_file(): + continue rst_path.parent.mkdir(parents=True, exist_ok=True) rst_path.write_text( - f""" -{import_path} -{'='*len(import_path)} + f"""{import_path.translate(trans)} +{'='*len(import_path.translate(trans))} -.. automodule:: {import_path} - :members: -""" - ) +.. currentmodule:: {'.'.join(import_path.split('.')[:-1])} - header_text = "execution" if kind.lower() == "modules" else kind.rstrip("s") + " modules" - header = f"{'_'*len(header_text)}\n{header_text.title()}\n{'_'*len(header_text)}" +.. autodata:: {import_path.split('.')[-1]}""" + ) +for ldir in autodocs: + if not autodocs[ldir]: + continue + all_rst = ref_path / ldir / "all.rst" + if all_rst.is_file(): + continue + all_rst.parent.mkdir(parents=True, exist_ok=True) all_rst.write_text( f""" -.. all-saltext.azurerm.{kind}: +.. all-saltext.azurerm.{ldir}: -{header} +{'-'*len(ldir)}-------- +{ldir.title()} Modules +{'-'*len(ldir)}-------- .. autosummary:: :toctree: -{chr(10).join(sorted(' '+p for p in import_paths))} +{chr(10).join(sorted(' '+mod for mod in autodocs[ldir]))} """ ) diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fcb4971 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +This project uses [Semantic Versioning](https://semver.org/) - MAJOR.MINOR.PATCH + +# Changelog + +Saltext.Azurerm 1.0.0 (2022-06-21) +===================================== + +Added +----- + +- Initial version of Microsoft Azure Cloud Modules Extension for Salt. This release tracks the functionality in the + core Salt code base as of version 3005. diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md new file mode 100644 index 0000000..0c01df0 --- /dev/null +++ b/CODE-OF-CONDUCT.md @@ -0,0 +1,127 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in Salt +Extension Modules for Azure Resource Manager project and our community a +harassment-free experience for everyone, regardless of age, body size, visible +or invisible disability, ethnicity, sex characteristics, gender identity and +expression, level of experience, education, socio-economic status, nationality, +personal appearance, race, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at devops@eitr.tech. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b4886fa --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,14 @@ +Thanks for your interest in contributing to the Salt Extension Modules for +Azure Resource Manager! We welcome any contribution, large or small - from +adding a new feature to fixing a single letter typo. + +This is a companion to the Salt Project and the [Salt Contributing +Guide][salt-contributing] should be considered the default for this project. +Where this project disagrees with the Salt Project, the guidelines here take +precedence. Where this project is silent, the Salt guidelines should be used. + +See the **Contributing** section in the [README][README.md] for a quickstart. + + +[README.md]: README.md +[salt-contributing]: https://docs.saltproject.io/en/master/topics/development/contributing.html diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 0000000..7467394 --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,10 @@ +Salt Extension Modules for Azure Resource Manager +Copyright 2022 EITR Technologies, LLC + +This product is licensed to you under the Apache 2.0 license (the "License"). +You may not use this product except in compliance with the Apache 2.0 License. + +This product may include a number of subcomponents with separate copyright +notices and license terms. Your use of these subcomponents is subject to the +terms and conditions of the subcomponent's license, as noted in the LICENSE +file. diff --git a/changelog/.gitignore b/changelog/.gitignore new file mode 100644 index 0000000..f935021 --- /dev/null +++ b/changelog/.gitignore @@ -0,0 +1 @@ +!.gitignore