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

TEAM #1177 - Adds delete step to task definition cleanup workflow #2209

Merged
merged 3 commits into from
Dec 30, 2024

Conversation

coreycarvalho
Copy link

@coreycarvalho coreycarvalho commented Dec 27, 2024

Description

#2204 implemented a GHA workflow to deregister task definitions, keeping up to the most recent 10 revisions. This PR adds a step to that workflow to delete ALL inactive task definitions in batches of 10 (maximum allowed by AWS API). The workflow step also adds jitter and exponential backoff to prevent being rate limited by the AWS API.

issue TEAM 1177

How Has This Been Tested?

https://github.com/department-of-veterans-affairs/notification-api/actions/runs/12517536138/job/34918494673#step:5:1 -- this contains the dry run of the workflow.

https://github.com/department-of-veterans-affairs/notification-api/actions/runs/12548084704/job/34986688146 -- contains most recent run of workflow

Checklist

  • I have assigned myself to this PR
  • PR has an appropriate title: #9999 - What the thing does
  • PR has a detailed description, including links to specific documentation
  • I have added the appropriate labels to the PR.
  • I did not remove any parts of the template, such as checkboxes even if they are not used
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to any documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works. Testing guidelines
  • I have ensured the latest main is merged into my branch and all checks are green prior to review
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • The ticket was moved into the DEV test column when I began testing this change

@coreycarvalho coreycarvalho marked this pull request as ready for review December 27, 2024 15:06
@coreycarvalho coreycarvalho requested a review from a team as a code owner December 27, 2024 15:06
@coreycarvalho coreycarvalho changed the title Adds delete step to task definition cleanup workflow TEAM #1177 - Adds delete step to task definition cleanup workflow Dec 27, 2024
@coreycarvalho coreycarvalho self-assigned this Dec 30, 2024
fi
done

# Random jitter of 1–3s

Choose a reason for hiding this comment

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

Weird - Why a random sleep time?

Copy link
Author

Choose a reason for hiding this comment

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

To prevent AWS API throttling errors. This is making hundreds of API calls when it runs, s we want to make sure they are spaced apart.

Copy link

@MackHalliday MackHalliday left a comment

Choose a reason for hiding this comment

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

Approved with a question

@k-macmillan k-macmillan merged commit c444dff into main Dec 30, 2024
5 checks passed
@k-macmillan k-macmillan deleted the 1177-delete-step branch December 30, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants