From e135636ee2aa6b95f116df25e27d4436f7e4fa59 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Fri, 10 Jan 2025 11:53:53 -0800 Subject: [PATCH 1/3] update deprecated images --- test/integration/conftest.py | 2 +- .../linode_client/test_linode_client.py | 6 +++--- test/integration/models/account/test_account.py | 2 +- test/integration/models/firewall/test_firewall.py | 2 +- test/integration/models/linode/test_linode.py | 14 +++++++------- .../models/nodebalancer/test_nodebalancer.py | 2 +- test/integration/models/volume/test_volume.py | 2 +- test/unit/objects/linode_test.py | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/test/integration/conftest.py b/test/integration/conftest.py index ba4a2ee14..34aba39db 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -184,7 +184,7 @@ def create_linode_for_pass_reset(test_linode_client, e2e_test_firewall): linode_instance, password = client.linode.instance_create( "g6-nanode-1", region, - image="linode/debian10", + image="linode/debian12", label=label, firewall=e2e_test_firewall, ) diff --git a/test/integration/linode_client/test_linode_client.py b/test/integration/linode_client/test_linode_client.py index 2802c90f9..eb1b06369 100644 --- a/test/integration/linode_client/test_linode_client.py +++ b/test/integration/linode_client/test_linode_client.py @@ -19,7 +19,7 @@ def setup_client_and_linode(test_linode_client, e2e_test_firewall): linode_instance, password = client.linode.instance_create( "g6-nanode-1", region, - image="linode/debian10", + image="linode/debian12", label=label, firewall=e2e_test_firewall, ) @@ -250,7 +250,7 @@ def test_create_linode_instance_without_image(test_linode_client): def test_create_linode_instance_with_image(setup_client_and_linode): linode = setup_client_and_linode[1] - assert re.search("linode/debian10", str(linode.image)) + assert re.search("linode/debian12", str(linode.image)) def test_create_linode_with_interfaces(test_linode_client): @@ -262,7 +262,7 @@ def test_create_linode_with_interfaces(test_linode_client): "g6-nanode-1", region, label=label, - image="linode/debian10", + image="linode/debian12", interfaces=[ {"purpose": "public"}, ConfigInterface( diff --git a/test/integration/models/account/test_account.py b/test/integration/models/account/test_account.py index 8bdc8c60e..decad434f 100644 --- a/test/integration/models/account/test_account.py +++ b/test/integration/models/account/test_account.py @@ -71,7 +71,7 @@ def test_latest_get_event(test_linode_client, e2e_test_firewall): linode, password = client.linode.instance_create( "g6-nanode-1", region, - image="linode/debian10", + image="linode/debian12", label=label, firewall=e2e_test_firewall, ) diff --git a/test/integration/models/firewall/test_firewall.py b/test/integration/models/firewall/test_firewall.py index 6a9f6f079..16805f3b8 100644 --- a/test/integration/models/firewall/test_firewall.py +++ b/test/integration/models/firewall/test_firewall.py @@ -14,7 +14,7 @@ def linode_fw(test_linode_client): label = get_test_label() linode_instance, password = client.linode.instance_create( - "g6-nanode-1", region, image="linode/debian10", label=label + "g6-nanode-1", region, image="linode/debian12", label=label ) yield linode_instance diff --git a/test/integration/models/linode/test_linode.py b/test/integration/models/linode/test_linode.py index a8ba2b21e..780df254b 100644 --- a/test/integration/models/linode/test_linode.py +++ b/test/integration/models/linode/test_linode.py @@ -38,7 +38,7 @@ def linode_with_volume_firewall(test_linode_client): linode_instance, password = client.linode.instance_create( "g6-nanode-1", region, - image="linode/debian10", + image="linode/debian12", label=label + "_modlinode", ) @@ -76,7 +76,7 @@ def linode_for_network_interface_tests(test_linode_client, e2e_test_firewall): linode_instance, password = client.linode.instance_create( "g6-nanode-1", region, - image="linode/debian10", + image="linode/debian12", label=label, firewall=e2e_test_firewall, ) @@ -147,7 +147,7 @@ def create_linode_for_long_running_tests(test_linode_client, e2e_test_firewall): linode_instance, password = client.linode.instance_create( "g6-nanode-1", region, - image="linode/debian10", + image="linode/debian12", label=label + "_long_tests", firewall=e2e_test_firewall, ) @@ -214,7 +214,7 @@ def test_linode_rebuild(test_linode_client): label = get_test_label() + "_rebuild" linode, password = client.linode.instance_create( - "g6-nanode-1", region, image="linode/debian10", label=label + "g6-nanode-1", region, image="linode/debian12", label=label ) wait_for_condition(10, 100, get_status, linode, "running") @@ -222,14 +222,14 @@ def test_linode_rebuild(test_linode_client): retry_sending_request( 3, linode.rebuild, - "linode/debian10", + "linode/debian12", disk_encryption=InstanceDiskEncryptionType.disabled, ) wait_for_condition(10, 100, get_status, linode, "rebuilding") assert linode.status == "rebuilding" - assert linode.image.id == "linode/debian10" + assert linode.image.id == "linode/debian12" assert linode.disk_encryption == InstanceDiskEncryptionType.disabled @@ -272,7 +272,7 @@ def test_delete_linode(test_linode_client): linode_instance, password = client.linode.instance_create( "g6-nanode-1", region, - image="linode/debian10", + image="linode/debian12", label=label + "_linode", ) diff --git a/test/integration/models/nodebalancer/test_nodebalancer.py b/test/integration/models/nodebalancer/test_nodebalancer.py index d8a8a53b1..21f4d0322 100644 --- a/test/integration/models/nodebalancer/test_nodebalancer.py +++ b/test/integration/models/nodebalancer/test_nodebalancer.py @@ -36,7 +36,7 @@ def linode_with_private_ip(test_linode_client, e2e_test_firewall): linode_instance, password = client.linode.instance_create( "g6-nanode-1", TEST_REGION, - image="linode/debian10", + image="linode/debian12", label=label, private_ip=True, firewall=e2e_test_firewall, diff --git a/test/integration/models/volume/test_volume.py b/test/integration/models/volume/test_volume.py index 6588d92a7..56395d203 100644 --- a/test/integration/models/volume/test_volume.py +++ b/test/integration/models/volume/test_volume.py @@ -49,7 +49,7 @@ def linode_for_volume(test_linode_client, e2e_test_firewall): linode_instance, password = client.linode.instance_create( "g6-nanode-1", TEST_REGION, - image="linode/debian10", + image="linode/debian12", label=label, firewall=e2e_test_firewall, ) diff --git a/test/unit/objects/linode_test.py b/test/unit/objects/linode_test.py index 700e5d0db..bdc99ac35 100644 --- a/test/unit/objects/linode_test.py +++ b/test/unit/objects/linode_test.py @@ -413,7 +413,7 @@ def test_create_disk(self): 1234, label="test", authorized_users=["test"], - image="linode/debian10", + image="linode/debian12", ) self.assertEqual(m.call_url, "/linode/instances/123/disks") self.assertEqual( @@ -422,7 +422,7 @@ def test_create_disk(self): "size": 1234, "label": "test", "root_pass": gen_pass, - "image": "linode/debian10", + "image": "linode/debian12", "authorized_users": ["test"], "read_only": False, }, From b12c481d49bc153c44957febeae390fc4ff2bce5 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Fri, 10 Jan 2025 11:54:15 -0800 Subject: [PATCH 2/3] fix slack payload for v2.0.0 --- .github/workflows/e2e-test.yml | 82 +++++++++++----------------------- 1 file changed, 26 insertions(+), 56 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 886d0a253..51eda09bf 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -160,64 +160,34 @@ jobs: runs-on: ubuntu-latest needs: [integration-tests] if: ${{ (success() || failure()) && github.repository == 'linode/linode_api4-python' }} # Run even if integration tests fail and only on main repository - steps: - name: Notify Slack uses: slackapi/slack-github-action@v2.0.0 with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:" - } - }, - { - "type": "divider" - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Build Result:*\n${{ needs.integration-tests.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}" - }, - { - "type": "mrkdwn", - "text": "*Branch:*\n`${{ github.ref_name }}`" - } - ] - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>" - }, - { - "type": "mrkdwn", - "text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>" - } - ] - }, - { - "type": "divider" - }, - { - "type": "context", - "elements": [ - { - "type": "mrkdwn", - "text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + channel: ${{ secrets.SLACK_CHANNEL_ID }} + blocks: + - type: section + text: + type: mrkdwn + text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:" + - type: divider + - type: section + fields: + - type: mrkdwn + text: "*Build Result:*\n${{ needs.integration-tests.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}" + - type: mrkdwn + text: "*Branch:*\n`${{ github.ref_name }}`" + - type: section + fields: + - type: mrkdwn + text: "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>" + - type: mrkdwn + text: "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>" + - type: divider + - type: context + elements: + - type: mrkdwn + text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`" \ No newline at end of file From 2bda2cd6260ec248e71d2c727fa2fa31f3c99a3e Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Fri, 10 Jan 2025 11:58:13 -0800 Subject: [PATCH 3/3] fix slack payload for v2.0.0 --- .github/workflows/nightly-smoke-tests.yml | 81 +++++++--------------- .github/workflows/release-notify-slack.yml | 22 +++--- 2 files changed, 34 insertions(+), 69 deletions(-) diff --git a/.github/workflows/nightly-smoke-tests.yml b/.github/workflows/nightly-smoke-tests.yml index 9432ac416..244df9afd 100644 --- a/.github/workflows/nightly-smoke-tests.yml +++ b/.github/workflows/nightly-smoke-tests.yml @@ -47,60 +47,31 @@ jobs: if: always() && github.repository == 'linode/linode_api4-python' uses: slackapi/slack-github-action@v2.0.0 with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:" - } - }, - { - "type": "divider" - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}" - }, - { - "type": "mrkdwn", - "text": "*Branch:*\n`${{ github.ref_name }}`" - } - ] - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>" - }, - { - "type": "mrkdwn", - "text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>" - } - ] - }, - { - "type": "divider" - }, - { - "type": "context", - "elements": [ - { - "type": "mrkdwn", - "text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + channel: ${{ secrets.SLACK_CHANNEL_ID }} + blocks: + - type: section + text: + type: mrkdwn + text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:" + - type: divider + - type: section + fields: + - type: mrkdwn + text: "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}" + - type: mrkdwn + text: "*Branch:*\n`${{ github.ref_name }}`" + - type: section + fields: + - type: mrkdwn + text: "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>" + - type: mrkdwn + text: "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>" + - type: divider + - type: context + elements: + - type: mrkdwn + text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`" diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index bf941e7bf..ea1a4da68 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -13,18 +13,12 @@ jobs: id: main_message uses: slackapi/slack-github-action@v2.0.0 with: - channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*New Release Published: _linode_api4-python_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:" - } - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + channel: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} + blocks: + - type: section + text: + type: mrkdwn + text: "*New Release Published: _linode_api4-python_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:" \ No newline at end of file