Skip to content

Conversation

@Vitor-Avila
Copy link
Contributor

This PR implements some changes to the export-ownership command:

  • Adds an --asset-type filter to the command, which allows to export ownership only for dashboard, dataset or chart. Multiple can be passed.
  • In case an asset ha an owner that's no longer in the team, it logs the exception.
  • Adds a new --exclude-old-users flag, to automatically remove these old users from the generated file. This way, a new import would clean up the configurations.

"""
Return information about resource ownership.
"""
emails = {user["id"]: user["email"] for user in self.export_users()}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this to the command layer to avoid calling it once for every asset type.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Nice!

Do we need/want to have an option to assign those assets from excluded users to the admin or some other user?

@Vitor-Avila
Copy link
Contributor Author

Do we need/want to have an option to assign those assets from excluded users to the admin or some other user?

I thought this was a great idea, but then it got me thinking that admins are already able to manage ownership without being owners, and having a single account to replace all old users could be too limited. Ideally admins would run this script to migrate ownership before offboarding a user, but I think the longer term solution is to actually accept groups in the ownership configuration.

@Vitor-Avila Vitor-Avila merged commit 03842c1 into main Nov 6, 2025
5 checks passed
@Vitor-Avila Vitor-Avila deleted the feat/handle-removed-users-export-ownership branch November 6, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants