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

Notify data.gov team when deploy fails #2827

Closed
1 task
jbrown-xentity opened this issue Feb 16, 2021 · 2 comments
Closed
1 task

Notify data.gov team when deploy fails #2827

jbrown-xentity opened this issue Feb 16, 2021 · 2 comments
Assignees
Labels
CI/CD Feature Notifications O&M Operations and maintenance tasks for the Data.gov platform

Comments

@jbrown-xentity
Copy link
Contributor

jbrown-xentity commented Feb 16, 2021

User Story

As a data.gov developer, I want to be notified via a github issue when a deployment for an application fails so that the whole team is notified and we can triage quickly.

Acceptance Criteria

[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]

  • GIVEN an application is setup to deploy via GitHub Actions
    WHEN the deploy fails
    THEN a GitHub issue is created in datagov-deploy
    AND links are added to be able to quickly triage

Background

A v0.1 was developed for inventory, but it was deemed too much code to copy/paste into various repo's. This needs to be it's own repo as a published GitHub Action.

Security Considerations (required)

Everything is public, no security considerations here.

Sketch

The code is already written, just need to setup the library correctly and take variable inputs (what repo do you want to create an issue on? etc). This will allow for customization later if we ever get rid of datagov-deploy... Should follow GitHub Actions Documentation

Nick also turned up this email example

@nickumia-reisys
Copy link
Contributor

I brought this back from archived because recently, we've been having a lot of deployment failures and it would help I think..

@hkdctol hkdctol moved this to 🏗 In Progress [8] in data.gov team board Oct 13, 2022
@nickumia-reisys
Copy link
Contributor

To auto add issues to the board, the following action has been tested.

The following workflow must be added to each repo that we would like to auto-add issues from,

name: add-to-project

on:
  issues:
    types: [opened, labeled]
  issue_comment:
    types: [created]

jobs:
  add-to-project:
    name: Add issue to project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/add-to-project@v0.3.0
        with:
          # You can target a repository in a different organization
          # to the issue
          project-url: '<project-url>'
          github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}

Tested with both personal GH Project and GSA Org Project

A GH Token must be created and added to the repos that run this action as well. I used a personal token, but I know there is a way to create an organization token so that it's not tied to a particular user. The token must have the following permissions:

  • project -- Full control of projects

The following three triggers have been tested and work (but we don't need to implement all of them):

  • New issue created
  • New label added to issue
  • New comment on issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Feature Notifications O&M Operations and maintenance tasks for the Data.gov platform
Projects
Archived in project
Development

No branches or pull requests

2 participants