-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookie initialy baked by NetworkToCode Cookie Drift Manager Tool #583
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
562f3f3
Cookie initialy baked by NetworkToCode Cookie Drift Manager Tool
008169b
chore: Manual fixes
snaselj c7c5ed8
fix: Syntax error
snaselj 7210bd9
fix: Black
snaselj 24dc06f
chore: Move docs changes to separate pr #584
snaselj 38d4d1a
fix: Update poetry lock
snaselj 57c51dc
fix: Pylint
snaselj 976c43f
fix: PR comments
snaselj 7476c93
fix: Job invocation
snaselj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"cookiecutter": { | ||
"codeowner_github_usernames": "@itdependsnetworks @jeffkala @nkallergis", | ||
"full_name": "Network to Code, LLC", | ||
"email": "[email protected]", | ||
"github_org": "nautobot", | ||
"plugin_name": "nautobot_golden_config", | ||
"verbose_name": "Golden Config", | ||
"plugin_slug": "nautobot-golden-config", | ||
"project_slug": "nautobot-plugin-golden-config", | ||
"repo_url": "https://github.com/nautobot/nautobot-plugin-golden-config", | ||
"base_url": "golden-config", | ||
"min_nautobot_version": "1.4.0", | ||
"max_nautobot_version": "1.9999", | ||
"nautobot_version": "latest", | ||
"camel_name": "NautobotGoldenConfig", | ||
"project_short_description": "A plugin for configuration on nautobot", | ||
"version": "1.0.0", | ||
"model_class_name": "None", | ||
"open_source_license": "Apache-2.0", | ||
"docs_base_url": "https://docs.nautobot.com", | ||
"docs_app_url": "https://docs.nautobot.com/projects/golden-config/en/latest", | ||
"_drift_manager": { | ||
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git", | ||
"template_dir": "nautobot-app", | ||
"template_ref": "develop", | ||
"cookie_dir": "", | ||
"branch_prefix": "drift-manager", | ||
"pull_request_strategy": "create", | ||
"post_actions": [] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Docker related | ||
development/Dockerfile | ||
development/docker-compose*.yml | ||
development/*.env | ||
*.env | ||
environments/ | ||
|
||
# Python | ||
**/*.pyc | ||
**/*.pyo | ||
**/__pycache__/ | ||
**/.pytest_cache/ | ||
**/.venv/ | ||
|
||
|
||
# Other | ||
docs/_build | ||
FAQ.md | ||
.git/ | ||
.gitignore | ||
.github | ||
tasks.py | ||
LICENSE | ||
**/*.log | ||
**/.vscode/ | ||
invoke*.yml | ||
tasks.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
[flake8] | ||
# E501: Line length is enforced by Black, so flake8 doesn't need to check it | ||
# W503: Black disagrees with this rule, as does PEP 8; Black wins | ||
ignore = E501, W503, F811, F401, F405, E203 | ||
ignore = | ||
E501, # Line length is enforced by Black, so flake8 doesn't need to check it | ||
W503, # Black disagrees with this rule, as does PEP 8; Black wins | ||
# TODO: Review the following rules, not in the template | ||
F811, | ||
F401, | ||
F405, | ||
E203, | ||
exclude = | ||
migrations, | ||
__pycache__, | ||
manage.py, | ||
settings.py, | ||
.venv |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Default owners for all files in this repository | ||
# Default owner(s) of all files in this repository | ||
* @itdependsnetworks @jeffkala @nkallergis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## New Pull Request | ||
|
||
Have you: | ||
- [ ] Updated the README if necessary? | ||
- [ ] Updated any configuration settings? | ||
- [ ] Written a unit test? | ||
|
||
## Change Notes | ||
|
||
## Justification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
--- | ||
name: "CI" | ||
concurrency: # Cancel any existing runs of this workflow for this same PR | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
on: # yamllint disable-line rule:truthy rule:comments | ||
push: | ||
branches: | ||
|
@@ -10,6 +13,8 @@ on: # yamllint disable-line rule:truthy rule:comments | |
pull_request: ~ | ||
|
||
env: | ||
# TODO Fix to be repository name | ||
# PLUGIN_NAME: "nautobot-plugin-golden-config" | ||
PLUGIN_NAME: "nautobot-golden-config" | ||
|
||
jobs: | ||
|
@@ -19,7 +24,7 @@ jobs: | |
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
uses: "actions/checkout@v3" | ||
- name: "Setup environment" | ||
uses: "networktocode/gh-action-setup-poetry-environment@v4" | ||
- name: "Linting: black" | ||
|
@@ -30,7 +35,7 @@ jobs: | |
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
uses: "actions/checkout@v3" | ||
- name: "Setup environment" | ||
uses: "networktocode/gh-action-setup-poetry-environment@v4" | ||
- name: "Linting: bandit" | ||
|
@@ -41,7 +46,7 @@ jobs: | |
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
uses: "actions/checkout@v3" | ||
- name: "Setup environment" | ||
uses: "networktocode/gh-action-setup-poetry-environment@v4" | ||
- name: "Linting: pydocstyle" | ||
|
@@ -52,7 +57,7 @@ jobs: | |
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
uses: "actions/checkout@v3" | ||
- name: "Setup environment" | ||
uses: "networktocode/gh-action-setup-poetry-environment@v4" | ||
- name: "Linting: flake8" | ||
|
@@ -63,7 +68,7 @@ jobs: | |
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True" | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
uses: "actions/checkout@v3" | ||
- name: "Setup environment" | ||
uses: "networktocode/gh-action-setup-poetry-environment@v4" | ||
- name: "Linting: yamllint" | ||
|
@@ -86,7 +91,7 @@ jobs: | |
INVOKE_NAUTOBOT_GOLDEN_CONFIG_NAUTOBOT_VER: "${{ matrix.nautobot-version }}" | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
uses: "actions/checkout@v3" | ||
- name: "Setup environment" | ||
uses: "networktocode/gh-action-setup-poetry-environment@v4" | ||
- name: "Set up Docker Buildx" | ||
|
@@ -138,7 +143,7 @@ jobs: | |
INVOKE_NAUTOBOT_GOLDEN_CONFIG_NAUTOBOT_VER: "${{ matrix.nautobot-version }}" | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
uses: "actions/checkout@v3" | ||
- name: "Setup environment" | ||
uses: "networktocode/gh-action-setup-poetry-environment@v4" | ||
- name: "Set up Docker Buildx" | ||
|
@@ -173,7 +178,7 @@ jobs: | |
if: "startsWith(github.ref, 'refs/tags/v')" | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
uses: "actions/checkout@v3" | ||
- name: "Set up Python" | ||
uses: "actions/setup-python@v2" | ||
with: | ||
|
@@ -202,7 +207,7 @@ jobs: | |
if: "startsWith(github.ref, 'refs/tags/v')" | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
uses: "actions/checkout@v3" | ||
- name: "Set up Python" | ||
uses: "actions/setup-python@v2" | ||
with: | ||
|
@@ -226,7 +231,7 @@ jobs: | |
- "publish_pypi" | ||
runs-on: "ubuntu-20.04" | ||
env: | ||
SLACK_WEBHOOK_URL: "${{ '{{ secrets.SLACK_WEBHOOK_URL }}' }}" | ||
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}" | ||
SLACK_MESSAGE: >- | ||
*NOTIFICATION: NEW-RELEASE-PUBLISHED*\n | ||
Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n | ||
|
@@ -236,11 +241,12 @@ jobs: | |
- name: "Send a notification to Slack" | ||
# ENVs cannot be used directly in job.if. This is a workaround to check | ||
# if SLACK_WEBHOOK_URL is present. | ||
if: "${{ env.SLACK_WEBHOOK_URL != '' }}" | ||
if: "env.SLACK_WEBHOOK_URL != ''" | ||
uses: "slackapi/[email protected]" | ||
with: | ||
payload: | | ||
{ | ||
"text": "${{ env.SLACK_MESSAGE }}", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
name: "Rebake Cookie" | ||
on: # yamllint disable-line rule:truthy | ||
schedule: | ||
# Every Saturday at 5:00 am UTC | ||
- cron: "0 5 * * 6" | ||
workflow_dispatch: | ||
inputs: | ||
template-ref: | ||
description: "The branch or tag to use for the template, using the value from .cookiecutter.json when empty" | ||
default: "" | ||
jobs: | ||
rebake: | ||
runs-on: "ubuntu-22.04" | ||
permissions: | ||
actions: "write" | ||
contents: "write" | ||
packages: "read" | ||
pull-requests: "write" | ||
container: "ghcr.io/nautobot/cookiecutter-nautobot-app-drift-manager/prod:latest" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
steps: | ||
- name: "Configure" | ||
id: "config" | ||
run: | | ||
export REBAKE_ARGS='--push' | ||
if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then | ||
export REBAKE_ARGS="$REBAKE_ARGS --template-ref='${{ github.event.inputs.template-ref }}'" | ||
fi | ||
echo "rebake-args='$REBAKE_ARGS'" >> $GITHUB_OUTPUT | ||
- name: "Rebake" | ||
run: | | ||
python -m ntc_cookie_drift_manager rebake ${{ steps.config.outputs.rebake-args }} '${{ github.repositoryUrl }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we go to 2.0, this makes sense to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed