Add IaC label and usertasks to integration stats#62518
Merged
Conversation
Tener
approved these changes
Dec 30, 2025
lib/web/integrations.go
Outdated
| ret.Integration = uiIg | ||
|
|
||
| if req.integration != nil { | ||
| if val, ok := req.integration.GetLabel(types.CreatedByIaCLabel); ok && val == "terraform" { |
Contributor
There was a problem hiding this comment.
Extract "terraform" into named constant.
lib/web/ui/integration.go
Outdated
| SubKind: ig.GetSubKind(), | ||
| } | ||
|
|
||
| if val, ok := ig.GetLabel(types.CreatedByIaCLabel); ok && val == "terraform" { |
Contributor
There was a problem hiding this comment.
Ditto regarding named constant.
api/types/constants.go
Outdated
| ADLabel = TeleportNamespace + "/ad" | ||
|
|
||
| // CreatedByIaCLabel is a resource metadata label name used to identify if resource was created by IaC tooling. | ||
| CreatedByIaCLabel = TeleportNamespace + "/iac" |
Contributor
There was a problem hiding this comment.
I think this label could be more explicit
Maybe /created-by-iac-tool?
Or maybe we could even add a /managed-by-iac-tool
This way, we could enforce only the iac tool can perform changes to the resource (unless we pass in a --force flag or equivalent in the API).
Contributor
There was a problem hiding this comment.
/iac-tool might be another option. I'd be weary of restricting operations like this, but a warning would be good.
Contributor
Author
There was a problem hiding this comment.
i went with /iac-tool
lib/web/integrations.go
Outdated
| } | ||
| ret.UserTasks = append(ret.UserTasks, ui.MakeUserTasks(userTasks)...) | ||
|
|
||
| ret.UnresolvedUserTasks += len(userTasks) |
Contributor
There was a problem hiding this comment.
nit: do a single len call after the loop
ff246cc to
6efe554
Compare
marcoandredinis
approved these changes
Jan 6, 2026
avatus
added a commit
that referenced
this pull request
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small changes combined into one. This supports #60819 and #60818 (is required by #62145)
This adds a new label to mark when a resource has been created by IaC of some form. We originally wanted to add this to the
Originlabel, butteleport/api/types/header/header.go
Lines 274 to 278 in 840b60d
Also, adds the user tasks to the
statsendpoint response, in order to support the overview page.