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

CI: slack notification if CI SUCCESS after FAILURE #1519

Merged
merged 3 commits into from
Oct 4, 2022
Merged

CI: slack notification if CI SUCCESS after FAILURE #1519

merged 3 commits into from
Oct 4, 2022

Conversation

luigieai
Copy link
Contributor

@luigieai luigieai commented Oct 2, 2022

Before contributing, please read our contributing guidelines and code of conduct.

Overview

Add slack notification when workflow is succeeded when previously workflow have failed state, I implemented get status of last workflow that uses Github API

Submitter Checklist:

Testing

The agent includes a suite of unit and functional tests which should be used to
verify your changes don't break existing functionality. These tests will run with
Github Actions when a pull request is made. More details on running the tests locally can be found
here for our unit tests,
and here for our functional tests.
For most contributions it is strongly recommended to add additional tests which
exercise your changes.

Reviewer Checklist

  • Perform code review
  • Add performance label
  • Perform appropriate level of performance testing
  • Confirm all checks passed
  • Add version label prior to acceptance

@CLAassistant
Copy link

CLAassistant commented Oct 2, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the community To tag external issues and PRs submitted by the community label Oct 2, 2022
Copy link
Contributor

@fallwith fallwith left a comment

Choose a reason for hiding this comment

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

Hi @luigieai,

Thank you very much for your PR. Making use of the get-status-of-last-workflow GitHub Action is a great idea! I think it will solve the problem perfectly.

I have 2 requests for changes to be made:

Change 1: When I look at the Example usage section of the documentation page you linked to, it shows the following:

  • Setting the last status to a last_status object
  • Calling steps.last_status.outputs.last_status to obtain the last status value and compare it with 'failure'

When I look at your PR, I see that first item being done, but I don't see the second item being done. I think you are setting the last_status object correctly, but I don't see you checking the actual last status value to see if it is equal to 'failure'.

If you would like any help on this or to discuss it further, please let us know.

Change 2: The .yml file is now missing the trailing newline at the very end of the file. You can either set up your text editor to add newlines to the end of YAML (or all) files automatically, or you can just manually create a blank last line. Once you have done so, the little red GitHub warning sign should disappear from the diff view.

@luigieai
Copy link
Contributor Author

luigieai commented Oct 4, 2022

Hello @fallwith Thanks for the review.

I added the missing check (oops :D) and the blank last line, everthing should be fixed, can you please take a look again?

Thanks!

@luigieai luigieai requested a review from fallwith October 4, 2022 04:00
@fallwith
Copy link
Contributor

fallwith commented Oct 4, 2022

Many thanks for your contribution, @luigieai!

@fallwith fallwith merged commit e744158 into newrelic:dev Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community To tag external issues and PRs submitted by the community hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: slack notification if CI SUCCESS after FAILURE
3 participants