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

DR-3406: Update slack notify action: Correct branch; Move status check to action call #1588

Merged
merged 3 commits into from
Jan 12, 2024

Conversation

snf2ye
Copy link
Contributor

@snf2ye snf2ye commented Jan 9, 2024

The changes

  • Point to the correct dev branch (We use 'develop' in jade-data-repo-ui, not 'dev' like in drs-hub).
  • It appears that the reusable workflow cannot correctly assess the status of the calling workflow. So, we need to move this logic into the calling workflow.
    -> I don't love the way we're now passing the status: "needs.update_image.result == 'success'" appears to be the right move from some online research but definitely is verbose 😞. We don't have access to the "success()" and "failure()" functions when setting the arguments (at least as far as I can tell).

Testing

With change - successfully sending failure notification on job failure:
image

and success notification on job success:
image

Copy link

cypress bot commented Jan 9, 2024

Passing run #3221 ↗︎

0 25 0 0 Flakiness 0

Details:

Merge e140272 into d4081a9...
Project: jade-data-repo-ui Commit: c88584f1a1 ℹ️
Status: Passed Duration: 04:07 💡
Started: Jan 12, 2024 5:24 PM Ended: Jan 12, 2024 5:28 PM

Review all test suite changes for PR #1588 ↗︎

@snf2ye snf2ye force-pushed the sh/dr-3406-followup branch 4 times, most recently from e47ba6d to de2a420 Compare January 10, 2024 17:50
@snf2ye snf2ye changed the title DR-3406: Update slack notify action to check for the right 'develop' branch DR-3406: Update slack notify action: Correct branch; Move status check to action call Jan 10, 2024
@snf2ye snf2ye marked this pull request as ready for review January 10, 2024 19:09
@@ -102,6 +102,8 @@ jobs:
needs: [ update_image, helm_tag_bump, cherry_pick_image_to_production_gcr ]
uses: ./.github/workflows/notify-slack.yaml
secrets: inherit
if: ${{ !cancelled() }}
with:
workflow_name: Dev Image Update
notify_on_success: true
Copy link
Member

Choose a reason for hiding this comment

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

Does this parameter still make sense? In the false case wouldn't the workflow no longer be called?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are three states that we can check for here - success, failure or cancelled. (Cancelled being when the job is canceled manually by a user). So, the !cancelled() check means that it will run either on success on failure.

It's a little clunky, but it is the suggested option in the github actions docs.

If you want to run a job or step regardless of its success or failure, use the recommended alternative: if: ${{ !cancelled() }}

But, given that it's confusing, I think I'll just switch to always() and then cancelled jobs will just get the failure notification.

Copy link
Contributor

@rjohanek rjohanek left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Contributor

@samanehsan samanehsan left a comment

Choose a reason for hiding this comment

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

I had the same question as Phil, but besides that this looks good! :octocat:

@snf2ye snf2ye force-pushed the sh/dr-3406-followup branch from de2a420 to a52e5d8 Compare January 11, 2024 13:45
@snf2ye snf2ye force-pushed the sh/dr-3406-followup branch from 689c53d to e140272 Compare January 11, 2024 13:48
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@okotsopoulos okotsopoulos removed their request for review January 12, 2024 15:03
@snf2ye snf2ye merged commit 6ca8a80 into develop Jan 12, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants