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

Opsgenie Plugin support schedules/teams ID and Name #44381

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

EdwardDowling
Copy link
Contributor

@EdwardDowling EdwardDowling commented Jul 18, 2024

Buddy PR for #44342

In a previous PR (#43535), we identified that the Opsgenie alert payload was using the schedule ID, while the documentation refers to the schedule name in the annotations.

To support backwards compatibility, both ID and Name were added to the payload. However, the Opsgenie API requires only one of these fields, not both.

All Opsgenie IDs (schedules, teams, requests, etc.) are UUIDs. Therefore, in this PR, I propose checking if the schedule/team in the annotation is a UUID. If it is, we will include the ID in the payload; otherwise, we will include the Name.

Example:

kind: role
metadata:
  name: prod-write-access-request
spec:
  allow:
    request:
      annotations:
        teleport.dev/notify-services:
        - MySchedule
        - bb4d9938-c3c2-455d-aaab-727aa701c0d8
        teleport.dev/teams:
        - MyTeam
        - aee8a0de-c80f-4515-a232-501c0bc9d715
      roles:
      - prod-write-role

Results in following payload

{
  "message": "Access request from ...",
  "alias": "....",
  "description":"....",
  "responders": [
        {
           "type": "schedule",
           "name": "MySchedule"
        },
        {
           "type": "schedule",
           "id": "bb4d9938-c3c2-455d-aaab-727aa701c0d8"
        },
        {
           "type": "team",
           "name": "MyTeam"
        },
        {
           "type": "team",
           "id": "aee8a0de-c80f-4515-a232-501c0bc9d715"
        }
     ],
  "priority":"P2"

Signed-off-by: Edward Dowling <edward.dowling@goteleport.com>
Signed-off-by: Edward Dowling <edward.dowling@goteleport.com>
@EdwardDowling EdwardDowling marked this pull request as ready for review July 22, 2024 15:01
Copy link

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Copy link

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Copy link

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@EdwardDowling EdwardDowling added the no-changelog Indicates that a PR does not require a changelog entry label Jul 26, 2024
@EdwardDowling EdwardDowling added this pull request to the merge queue Jul 26, 2024
Merged via the queue into master with commit bc6e4c4 Jul 26, 2024
38 of 39 checks passed
@EdwardDowling EdwardDowling deleted the edwarddowling/pr-buddy-44342 branch July 26, 2024 11:14
@public-teleport-github-review-bot

@EdwardDowling See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Create PR

EdwardDowling added a commit that referenced this pull request Jul 29, 2024
* Opsgenie Plugin support schedules/teams ID and Name

Signed-off-by: Edward Dowling <edward.dowling@goteleport.com>

* Replace regex by UUID parser

Signed-off-by: Edward Dowling <edward.dowling@goteleport.com>

---------

Signed-off-by: Edward Dowling <edward.dowling@goteleport.com>
Co-authored-by: Carlos Castro <carlos.castro@jumo.world>
github-merge-queue bot pushed a commit that referenced this pull request Aug 14, 2024
* Opsgenie Plugin support schedules/teams ID and Name



* Replace regex by UUID parser



---------

Signed-off-by: Edward Dowling <edward.dowling@goteleport.com>
Co-authored-by: Carlos Castro <carlos.castro@jumo.world>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v15 backport/branch/v16 no-changelog Indicates that a PR does not require a changelog entry size/sm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants