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

fix: Cleanup tags when component is removed #28

Merged
merged 27 commits into from
Nov 11, 2024
Merged

Conversation

jithumkunjuraman
Copy link
Contributor

@jithumkunjuraman jithumkunjuraman commented Nov 7, 2024

When we receive a deletion request for the resource, we will also try to clean the TagBindings associated, which helps clean up unused tagValues/tagkeys residing on the GCP project

Tested locally the following scenarios:

Multiple Resources created with multiple tags and deleting the resources only deletes the unused tags leaving behind the used tags(Since it is binding to other resources)

Tested change in tag key-values which creates the new ones and deletes the old ones if unused.

Creation and deletion of tags for single resources.

@jithumkunjuraman jithumkunjuraman requested a review from a team as a code owner November 7, 2024 10:03
@jithumkunjuraman jithumkunjuraman added wip Work in progress DoNotMerge Not ready to be merged labels Nov 7, 2024
Copy link

codacy-production bot commented Nov 7, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for ba2b2ca1 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (ba2b2ca) Report Missing Report Missing Report Missing
Head commit (d7cb09f) 577 108 18.72%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#28) 68 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@jithumkunjuraman jithumkunjuraman removed wip Work in progress DoNotMerge Not ready to be merged labels Nov 11, 2024
Copy link
Collaborator

@mKeRix mKeRix left a comment

Choose a reason for hiding this comment

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

Left some comments, but the overall logic looks good to me!

go.mod Outdated Show resolved Hide resolved
internal/gcp/tags.go Outdated Show resolved Hide resolved
internal/gcp/tags.go Show resolved Hide resolved
internal/gcp/tags.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@mKeRix mKeRix left a comment

Choose a reason for hiding this comment

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

LGTM, nice work! 🚀

@jithumkunjuraman jithumkunjuraman added this pull request to the merge queue Nov 11, 2024
Merged via the queue into main with commit 623751f Nov 11, 2024
5 checks passed
@jithumkunjuraman jithumkunjuraman deleted the clean-tag-gcp branch November 11, 2024 14:20
Copy link

🎉 This PR is included in version 1.1.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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