Skip to content

Commit

Permalink
New amends to slack-message-broker (#6632)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana authored Nov 4, 2024
1 parent 0d962de commit fa93753
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions .github/workflows/slack-message-broker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- name: Prepare Slack Message
uses: actions/github-script@main
id: prepare-slack-message

with:
script: |
console.log(${{ toJson(github.event) }});
Expand Down Expand Up @@ -67,10 +68,33 @@ jobs:
}
}
const isWorkflowRunEvent = "${{ github.event_name }}" == "workflow_run";
const isCheckRunEvent = "${{ github.event_name }}" == "check_run";
function isDraftPullRequest() {
const workflowRunPrIsNull = "${{ github.event.workflow_run.pull_requests == null }}" === "true";
const isDraftPrWorkflowRun = "${{ github.event.workflow_run.pull_requests[0][0].draft }}" === "true";
const checkRunPrIsNull = "${{ github.event.check_run.check_suite.pull_requests == null }}" === "true";
const isDraftPrCheckRun = "${{ github.event.check_run.check_suite.pull_requests[0].draft }}" === "true";
console.log(`isWorkflowRunEvent: ${isWorkflowRunEvent}`);
console.log(`isCheckRunEvent: ${isCheckRunEvent}`);
console.log(`workflowRunPrIsNull: ${workflowRunPrIsNull}`);
console.log(`checkRunPrIsNull: ${checkRunPrIsNull}`);
console.log(`isDraftPrWorkflowRun: ${isDraftPrWorkflowRun}`);
console.log(`isDraftPrCheckRun: ${isDraftPrCheckRun}`);
return isDraftPrWorkflowRun || isDraftPrCheckRun;
}
const slackMembers = getSlackMembersToBeNotified();
const isDraftPR = isDraftPullRequest();
let message = "";
let shouldSendMessage = false;
let slackMembers = getSlackMembersToBeNotified();
let message;
let shouldSendMessage;
function handleWorkflowRunEvent() {
Expand Down Expand Up @@ -113,36 +137,15 @@ jobs:
}


if ("${{ github.event_name }}" == "workflow_run") {
if (!isDraftPR && isWorkflowRunEvent) {
handleWorkflowRunEvent();
} else if ("${{ github.event_name }}" == "check_run") {
} else if (!isDraftPR && isCheckRunEvent) {
handleCheckRunEvent();
} else {
message = `Unknown event: ${{ github.event_name }}`;
message = `Unknown event or draft PR: ${{ github.event_name }}`;
shouldSendMessage = true;
}


function printDraftPrDebugInfo() {
const eventName = "${{ github.event_name }}";
const workflowRunPrIsNull = "${{ github.event.workflow_run.pull_requests == null }}";
const checkRunPrIsNull = "${{ github.event.check_run.check_suite.pull_requests == null }}";
const pullRequestZeroWorkflowRun = "${{ github.event.workflow_run.pull_requests[0] }}";
const pullRequestZeroCheckRun = "${{ github.event.check_run.check_suite.pull_requests[0] }}";
const isDraftPrWorkflowRun = "${{ github.event.workflow_run.pull_requests[0].draft }}";
const isDraftPrCheckRun = "${{ github.event.check_run.check_suite.pull_requests[0].draft }}";

console.log(`eventName: ${eventName}`);
console.log(`workflowRunPrIsNull: ${workflowRunPrIsNull}`);
console.log(`checkRunPrIsNull: ${checkRunPrIsNull}`);
console.log(`pullRequestZeroWorkflowRun: ${pullRequestZeroWorkflowRun}`);
console.log(`pullRequestZeroCheckRun: ${pullRequestZeroCheckRun}`);
console.log(`isDraftPrWorkflowRun: ${isDraftPrWorkflowRun}`);
console.log(`isDraftPrCheckRun: ${isDraftPrCheckRun}`);
}

printDraftPrDebugInfo();

console.log(`message: ${message}`);
console.log(`shouldSendMessage: ${shouldSendMessage}`);

Expand Down

1 comment on commit fa93753

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Plutus Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: fa93753 Previous: 0d962de Ratio
validation-auction_1-4 325.4 μs 241.9 μs 1.35
validation-multisig-sm-9 562.7 μs 391.4 μs 1.44
validation-multisig-sm-10 795.1 μs 550.9 μs 1.44
validation-ping-pong-1 464.6 μs 324.1 μs 1.43
validation-ping-pong-2 465.8 μs 325.2 μs 1.43
validation-ping-pong_2-1 286.7 μs 199.8 μs 1.43
validation-prism-1 243 μs 169.7 μs 1.43
validation-prism-2 586.6 μs 412.1 μs 1.42
validation-prism-3 415.2 μs 369.7 μs 1.12
validation-pubkey-1 202.6 μs 186.2 μs 1.09
validation-stablecoin_1-1 1284 μs 899.8 μs 1.43
validation-stablecoin_1-2 280.9 μs 197.1 μs 1.43
validation-stablecoin_1-3 1289 μs 1083 μs 1.19
validation-stablecoin_1-5 1426 μs 1341 μs 1.06
validation-stablecoin_1-6 368.5 μs 259.5 μs 1.42
validation-stablecoin_2-1 1282 μs 940.6 μs 1.36
validation-uniswap-1 585.8 μs 507.2 μs 1.15
validation-decode-auction_1-4 274.4 μs 196.4 μs 1.40
validation-decode-auction_2-1 276.3 μs 258 μs 1.07
validation-decode-auction_2-2 775 μs 594.2 μs 1.30
validation-decode-escrow-redeem_1-2 433.2 μs 314.4 μs 1.38
validation-decode-future-increase-margin-1 325.8 μs 238.4 μs 1.37
validation-decode-future-increase-margin-2 449.8 μs 315.8 μs 1.42
validation-decode-future-increase-margin-3 446.8 μs 317.3 μs 1.41
validation-decode-future-increase-margin-4 964.6 μs 687.9 μs 1.40
validation-decode-future-increase-margin-5 983.4 μs 684.4 μs 1.44
validation-decode-future-pay-out-1 329.5 μs 246.4 μs 1.34
validation-decode-pubkey-1 231.7 μs 192.4 μs 1.20
validation-decode-stablecoin_1-1 1222 μs 858.4 μs 1.42
validation-decode-stablecoin_1-2 172.1 μs 161.9 μs 1.06
validation-decode-uniswap-5 1045 μs 726 μs 1.44
validation-decode-uniswap-6 254 μs 197.7 μs 1.28
validation-decode-vesting-1 454.5 μs 316.1 μs 1.44
nofib-knights/6x6 66980 μs 56930 μs 1.18
nofib-knights/8x8 117700 μs 82520 μs 1.43
nofib-primetest/05digits 14910 μs 10360 μs 1.44
nofib-primetest/10digits 29040 μs 20230 μs 1.44
nofib-primetest/30digits 90180 μs 62910 μs 1.43
nofib-primetest/50digits 149200 μs 104200 μs 1.43
nofib-queens4x4/bt 7676 μs 5402 μs 1.42
nofib-queens4x4/bm 9723 μs 6850 μs 1.42
nofib-queens4x4/bjbt1 9298 μs 6558 μs 1.42
nofib-queens4x4/bjbt2 8715 μs 6138 μs 1.42
nofib-queens4x4/fc 19690 μs 13840 μs 1.42
nofib-queens5x5/bt 104300 μs 73550 μs 1.42
nofib-queens5x5/bm 109500 μs 77300 μs 1.42
nofib-queens5x5/bjbt1 122300 μs 86170 μs 1.42
nofib-queens5x5/bjbt2 118400 μs 83460 μs 1.42
nofib-queens5x5/fc 250600 μs 176500 μs 1.42
marlowe-semantics/0000020002010200020101020201000100010001020101020201010000020102 444.8 μs 315.8 μs 1.41
marlowe-role-payout/07658a6c898ad6d624c37df1e49e909c2e9349ba7f4c0a6be5f166fe239bfcae 226.5 μs 206 μs 1.10
marlowe-role-payout/0bdca1cb8fa7e38e09062557b82490714052e84e2054e913092cd84ac071b961 272.1 μs 192.7 μs 1.41

This comment was automatically generated by workflow using github-action-benchmark.

CC: @IntersectMBO/plutus-core

Please sign in to comment.