Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"_drift_manager": {
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
"template_dir": "nautobot-app",
"template_ref": "nautobot-app-v2.6.0",
"template_ref": "nautobot-app-v2.7.0",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "update-or-create",
"post_actions": [],
"draft": false,
"baked_commit_ref": "200ba6cff7edd47c51c81277542af0fa864023b4"
"baked_commit_ref": "1d837e45d6745ff3ea72db0d0e7fddad281ebe98"
}
}
}
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ labels:

### Environment
* Python version: <!-- Example: 3.11.4 -->
* Nautobot version: <!-- Example: 2.4.2 -->
* Nautobot version: <!-- Example: 2.4.20 -->
* nautobot-netbox-importer version: <!-- Example: 1.0.0 -->

<!-- What did you expect to happen? -->
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ labels:
---

### Environment
* Nautobot version: <!-- Example: 2.4.2 -->
* Nautobot version: <!-- Example: 2.4.20 -->
* nautobot-netbox-importer version: <!-- Example: 1.0.0 -->

<!--
Expand Down
117 changes: 7 additions & 110 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on: # yamllint disable-line rule:truthy rule:comments
branches:
- "main"
- "develop"
tags:
- "v*"
pull_request: ~

env:
Expand Down Expand Up @@ -106,8 +104,8 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.12"]
nautobot-version: ["2.4.9"]
python-version: ["3.11"]
nautobot-version: ["2.4.20"]
env:
INVOKE_NAUTOBOT_NETBOX_IMPORTER_PYTHON_VER: "${{ matrix.python-version }}"
INVOKE_NAUTOBOT_NETBOX_IMPORTER_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
Expand All @@ -121,8 +119,7 @@ jobs:
- name: "Constrain Nautobot version and regenerate lock file"
env:
INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL: "true"
PY_CONSTRAINT: "${{ matrix.python-version == '3.9' && '3.9.2' || matrix.python-version }}"
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ env.PY_CONSTRAINT }}"
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ matrix.python-version }}"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
Expand Down Expand Up @@ -153,9 +150,9 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.9"] # 3.12 2.4 is tested in unittest_report stage.
python-version: ["3.10"] # 3.12 2.4 is tested in unittest_report stage.
db-backend: ["postgresql"]
nautobot-version: ["2.4.9"]
nautobot-version: ["2.4.20"]
runs-on: "ubuntu-latest"
env:
INVOKE_NAUTOBOT_NETBOX_IMPORTER_PYTHON_VER: "${{ matrix.python-version }}"
Expand All @@ -170,8 +167,7 @@ jobs:
- name: "Constrain Nautobot version and regenerate lock file"
env:
INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL: "true"
PY_CONSTRAINT: "${{ matrix.python-version == '3.9' && '3.9.2' || matrix.python-version }}"
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ env.PY_CONSTRAINT }}"
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ matrix.python-version }}"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
Expand Down Expand Up @@ -222,8 +218,7 @@ jobs:
- name: "Constrain Nautobot version and regenerate lock file"
env:
INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL: "true"
PY_CONSTRAINT: "${{ matrix.python-version == '3.9' && '3.9.2' || matrix.python-version }}"
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ env.PY_CONSTRAINT }}"
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver=${{ matrix.python-version }}"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
Expand Down Expand Up @@ -288,101 +283,3 @@ jobs:
run: |
git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
poetry run towncrier check --compare-with origin/${{ github.base_ref }}
publish_gh:
needs:
- "unittest"
- "unittest_report"
name: "Publish to GitHub"
runs-on: "ubuntu-latest"
if: "startsWith(github.ref, 'refs/tags/v')"
env:
INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL: "True"
permissions:
contents: "write"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
python-version: "3.12"
poetry-install-options: "--no-root"
- name: "Set env"
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
- name: "Run Poetry Version"
run: "poetry version $RELEASE_VERSION"
- name: "Build Documentation"
run: "poetry run invoke build-and-check-docs"
- name: "Run Poetry Build"
run: "poetry build"
- name: "Upload binaries to release"
run: "gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
publish_pypi:
needs:
- "unittest"
- "unittest_report"
name: "Push Package to PyPI"
runs-on: "ubuntu-latest"
if: "startsWith(github.ref, 'refs/tags/v')"
env:
INVOKE_NAUTOBOT_NETBOX_IMPORTER_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
python-version: "3.12"
poetry-install-options: "--no-root"
- name: "Set env"
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
- name: "Run Poetry Version"
run: "poetry version $RELEASE_VERSION"
- name: "Build Documentation"
run: "poetry run invoke build-and-check-docs"
- name: "Run Poetry Build"
run: "poetry build"
- name: "Push to PyPI"
uses: "pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc" # v1.12.4
with:
user: "__token__"
password: "${{ secrets.PYPI_API_TOKEN }}"
slack-notify:
needs:
- "publish_gh"
- "publish_pypi"
runs-on: "ubuntu-latest"
env:
SLACK_WEBHOOK_URL: "${{ secrets.OSS_PYPI_SLACK_WEBHOOK_URL }}"
SLACK_MESSAGE: >-
*NOTIFICATION: NEW-RELEASE-PUBLISHED*\n
Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n
Release: <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}>\n
Published by: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}>
steps:
- 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 != ''"
uses: "slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3" # v1.27.1
with:
payload: |
{
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.SLACK_MESSAGE }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: "${{ secrets.OSS_PYPI_SLACK_WEBHOOK_URL }}"
SLACK_WEBHOOK_TYPE: "INCOMING_WEBHOOK"
103 changes: 103 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
name: "Release"
on: # yamllint disable-line rule:truthy rule:comments
release:
types: ["published"]

jobs:
build:
name: "Build package with poetry"
runs-on: "ubuntu-latest"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "2.1.3"
poetry-install-options: "--dry-run"
- name: "Run Poetry Build"
run: "poetry build"

- name: "Check that the release tag matches the version in pyproject.toml"
run: |
if [ "${{ github.ref_name }}" != "v$(poetry version -s)" ]; then exit 1; fi
- uses: "actions/upload-artifact@v4"
with:
name: "distfiles"
path: "dist/"
if-no-files-found: "error"

publish-github:
name: "Publish to GitHub"
runs-on: "ubuntu-latest"
if: "startsWith(github.ref, 'refs/tags/v')"
permissions:
contents: "write"
needs: "build"
steps:
- uses: "actions/checkout@v4"
- name: "Retrieve built package from cache"
uses: "actions/download-artifact@v4"
with:
name: "distfiles"
path: "dist/"

- name: "Upload binaries to release"
run: "gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

publish-pypi:
name: "Push Package to PyPI"
runs-on: "ubuntu-latest"
if: "startsWith(github.ref, 'refs/tags/v')"
needs: "build"
environment: "pypi"
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: "write"
steps:
- name: "Retrieve built package from cache"
uses: "actions/download-artifact@v4"
with:
name: "distfiles"
path: "dist/"

- name: "Publish package distributions to PyPI"
uses: "pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e" # v1.13.0

slack-notify:
needs:
- "publish-github"
- "publish-pypi"
runs-on: "ubuntu-latest"
env:
# Secrets cannot be directly referenced in if: conditionals. They must be set as a job env var first.
# Ref: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-secrets
SLACK_WEBHOOK_URL: "${{ secrets.OSS_PYPI_SLACK_WEBHOOK_URL }}"
SLACK_WEBHOOK_TYPE: "INCOMING_WEBHOOK"
SLACK_MESSAGE: >-
*NOTIFICATION: NEW-RELEASE-PUBLISHED*\n
Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n
Release: <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}>\n
Published by: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}>
steps:
- name: "Send a notification to Slack"
if: "${{ env.SLACK_WEBHOOK_URL != '' }}"
uses: "slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3" # v1.27.1
with:
payload: |
{
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.SLACK_MESSAGE }}"
}
}
]
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,10 @@ fabric.properties
.vscode/*
*.code-workspace

# Rando
# Random
creds.env
development/*.txt
!development/towncrier_header.txt

# Invoke overrides
invoke.yml
Expand Down
1 change: 1 addition & 0 deletions changes/+nautobot-app-v2.7.0.housekeeping
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rebaked from the cookie `nautobot-app-v2.7.0`.
4 changes: 2 additions & 2 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# -------------------------------------------------------------------------------------
# !!! USE CAUTION WHEN MODIFYING LINES BELOW

# Accepts a desired Nautobot version as build argument, default to 2.4.9
ARG NAUTOBOT_VER="2.4.9"
# Accepts a desired Nautobot version as build argument, default to 2.4.20
ARG NAUTOBOT_VER="2.4.20"

# Accepts a desired Python version as build argument, default to 3.12
ARG PYTHON_VER="3.12"
Expand Down
Loading
Loading