Repository navigation
Own deployed dashboards with the engineering account, not any org admin - #94
Merged
Merged
Conversation
helenalebreton
approved these changes
Sep 9, 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.
Part of https://github.com/metr-systems/backlog/issues/4764
Note for reviewers: This is a hotfix and i am merging it right away but feel free to review and comment and if there are changes i can apply them as refactoring later, thank you
AI disclaimer : Assisted by claude
Summary
When we deploy a composed dashboard into a customer organization, every object we create there : the dashboard, and each query behind its widgets — needs an owner. Up to now the code just grabbed whichever admin happened to be first in that org's admin group.
With heimstaden, we ran into the case where this was a client account and we had to archive entities and change entities owner by code in order to unarchive them again.
With the update in this PR . The deployment looks up a dedicated per-org engineering account by a fixed email pattern, engineering+@metr.systems, and uses that account as the owner of everything it creates.
Deployment is all-or-nothing across every target org. If even one target org is missing its engineering+@metr.systems user, the entire deployment is rolled back. The run is still recorded, with the failing org and reason listed, so it's clear which org blocked it.
Code Strategy
deploy_to_target_orgnow gets its owner from a newget_deploy_user, which looks the org'sengineering+<slug>@metr.systemsuser up byorg_idandemailand raisesDeployUserErrorwhen it's absent, sodeploy_composed_dashboardrecords it as that org's failure and rolls the whole run back .QA