From 0429a18741759608617aed0edba9933c6b13c1ae Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Thu, 26 May 2022 05:53:11 +0200 Subject: [PATCH 1/5] Update ci.yml --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd3e846..ce3f659 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,3 +177,39 @@ jobs: password: "${{ secrets.PYPI_API_TOKEN }}" needs: - "unittest" + slack-notify: + needs: + - "publish_gh" + - "publish_pypi" + name: "Send notification to the Slack" + runs-on: "ubuntu-20.04" + env: + SLACK_WEBHOOK_URL: "${{ secrets.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@v1.17.0" + with: + payload: | + { + "text": "${{ env.SLACK_MESSAGE }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ env.SLACK_MESSAGE }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}" + SLACK_WEBHOOK_TYPE: "INCOMING_WEBHOOK" From 082256a1aed0c332c6aa92c4d96c6a6b16af68f6 Mon Sep 17 00:00:00 2001 From: pke11y Date: Fri, 3 Jun 2022 09:15:48 +0100 Subject: [PATCH 2/5] Fix dialog order in path lookup --- nautobot_chatops_ipfabric/worker.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nautobot_chatops_ipfabric/worker.py b/nautobot_chatops_ipfabric/worker.py index 266b1f4..89124d3 100644 --- a/nautobot_chatops_ipfabric/worker.py +++ b/nautobot_chatops_ipfabric/worker.py @@ -468,7 +468,7 @@ def pathlookup( """Path simulation diagram lookup between source and target IP address.""" snapshot_id = get_user_snapshot(dispatcher) sub_cmd = "pathlookup" - supported_protocols = ["tcp", "udp", "icmp"] + protocols = [(protocol.upper(), protocol) for protocol in supported_protocols] # identical to dialog_list in end-to-end-path; consolidate dialog_list if maintaining both cmds @@ -481,12 +481,6 @@ def pathlookup( "type": "text", "label": "Destination IP", }, - { - "type": "select", - "label": "Protocol", - "choices": protocols, - "default": protocols[0], - }, { "type": "text", "label": "Source Ports", @@ -497,6 +491,12 @@ def pathlookup( "label": "Destination Ports", "default": "22", }, + { + "type": "select", + "label": "Protocol", + "choices": protocols, + "default": protocols[0], + }, ] if not all([src_ip, dst_ip, src_port, dst_port, protocol]): From 3c23d23943d998b9ae2290767cc25d4b375f3318 Mon Sep 17 00:00:00 2001 From: pke11y Date: Fri, 3 Jun 2022 09:18:01 +0100 Subject: [PATCH 3/5] restore supported protocols --- nautobot_chatops_ipfabric/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nautobot_chatops_ipfabric/worker.py b/nautobot_chatops_ipfabric/worker.py index 89124d3..b7640b0 100644 --- a/nautobot_chatops_ipfabric/worker.py +++ b/nautobot_chatops_ipfabric/worker.py @@ -468,7 +468,7 @@ def pathlookup( """Path simulation diagram lookup between source and target IP address.""" snapshot_id = get_user_snapshot(dispatcher) sub_cmd = "pathlookup" - + supported_protocols = ["tcp", "udp", "icmp"] protocols = [(protocol.upper(), protocol) for protocol in supported_protocols] # identical to dialog_list in end-to-end-path; consolidate dialog_list if maintaining both cmds From e5eec9e9f9cecd1fe77afd1af01d9e6b53fdb94b Mon Sep 17 00:00:00 2001 From: pke11y Date: Wed, 8 Jun 2022 07:04:45 +0100 Subject: [PATCH 4/5] Release v1.1.4 --- CHANGELOG.md | 12 +++++++++--- pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 981177f..22b384f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## v1.1.4 - 2022-06-08 + +## Added + +- #96 - Slack CI notification for build pipeline. +### Fixed + +- #97 - Fix for pathlookup argument selection error when using dialog box. + ## v1.1.3 - 2022-05-25 ### Fixed @@ -6,9 +15,6 @@ - #92 - Update plugin description. - #91 - Fix for null WLAN SSIDs. -### Fixed - - ## v1.1.2 - 2022-05-11 ### Added diff --git a/pyproject.toml b/pyproject.toml index 89fbf83..24263e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nautobot-chatops-ipfabric" -version = "1.1.3" +version = "1.1.4" description = "Nautobot Plugin Chatops IPFabric" authors = ["Network to Code, LLC "] From 7a15513c0557a1b92f7bfc41a10f80b2ee4377b3 Mon Sep 17 00:00:00 2001 From: pke11y Date: Wed, 8 Jun 2022 07:19:02 +0100 Subject: [PATCH 5/5] fix formating in CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22b384f..7efb824 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Added - #96 - Slack CI notification for build pipeline. + ### Fixed - #97 - Fix for pathlookup argument selection error when using dialog box.