Skip to content
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

test: update deprecated images and slack payload in workflows #495

Merged
merged 5 commits into from
Jan 13, 2025
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
82 changes: 26 additions & 56 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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 }}
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 }}`"
81 changes: 26 additions & 55 deletions .github/workflows/nightly-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,60 +47,31 @@ jobs:
if: always() && github.repository == 'linode/linode_api4-python'
uses: slackapi/[email protected]
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 }}`"

22 changes: 8 additions & 14 deletions .github/workflows/release-notify-slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ jobs:
id: main_message
uses: slackapi/[email protected]
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 }}
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:"
2 changes: 1 addition & 1 deletion test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
6 changes: 3 additions & 3 deletions test/integration/linode_client/test_linode_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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):
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/models/account/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/models/firewall/test_firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/integration/models/linode/test_linode.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def linode_with_disk_encryption(test_linode_client, request):
linode_instance, password = client.linode.instance_create(
"g6-nanode-1",
target_region,
image="linode/ubuntu23.10",
image="linode/ubuntu24.10",
label=label,
booted=False,
disk_encryption=disk_encryption,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/models/volume/test_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/objects/linode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
},
Expand Down
Loading