Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 3, 2025

Summary

Fixes phase 2 (data migration) failures when workspace roles have been deleted between migration phases. Workspace roles (KEBOOLA_WORKSPACE_*, SAPI_WORKSPACE_*) are ephemeral and dynamically created by Keboola when workspaces are provisioned. When they're deleted after phase 1 runs but before phase 2, the SHOW GRANTS TO ROLE query fails with "Role does not exist or not authorized".

This change:

  • Adds Helper::isWorkspaceRole() to identify workspace role naming patterns
  • Filters out workspace roles in getOtherRolesToMainProjectRole() before attempting to query their grants

Review & Testing Checklist for Human

  • Verify workspace role patterns are complete: The regex /^(KEBOOLA|SAPI|sapi)_WORKSPACE_/ may not cover all workspace role naming conventions used across different Keboola environments
  • Confirm skipping workspace roles doesn't break data migration: Review MigrateData.php to ensure no critical warehouse/ownership grants come exclusively from workspace roles
  • Test end-to-end: Run a migration where a workspace exists during phase 1, delete the workspace, then run phase 2 to verify it completes without errors

Notes

  • No unit tests were added for the new helper method
  • This was developed to unblock a specific migration where the user lacked privileges to create a dummy role as a workaround

Link to Devin run: https://app.devin.ai/sessions/2058b7baed6d4a2b95b2fcfea863c243
Requested by: David Pospisil (@baullmear)

…lures

Workspace roles (KEBOOLA_WORKSPACE_*, SAPI_WORKSPACE_*) are ephemeral and
dynamically created by Keboola when workspaces are provisioned. They may
be deleted between migration phases, causing 'Role does not exist' errors
when phase 2 (data migration) tries to fetch grants for roles that no
longer exist.

This change adds a helper method to identify workspace roles and filters
them out in getOtherRolesToMainProjectRole() before attempting to query
their grants.

Co-Authored-By: David Pospisil <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants