Loading
Scope Direct Transfer transformers and GroupLoader lookups to the import organization
What does this MR do and why?
During a Direct Transfer import, we looked up the destination namespace by full path across the whole instance. If another organization had a group at the same path, we could resolve into its namespace by mistake.
This scopes those lookups to the import's own organization, so a same-path group in another org can't be picked up.
The three lookups, all in lib/bulk_imports/: the group transformer, the project transformer, and the GroupLoader. We scope on bulk_import.organization (not entity.organization, which the loader clears mid-import).
How to validate locally
- Create two orgs, each with a subgroup at the same trailing path (
a/colliding,b/colliding). - Run a Direct Transfer into org A's subgroup.
- Confirm it resolves org A's namespace, never org B's.
Notes for reviewer
- Collision specs nest the path under different parents, since two orgs can't share a top-level path.
user_namespace_destination?is scoped too, to matchdestination. Shout if you'd expect it unscoped.- No fallback here: an out-of-org path returns
nil(top-level creation), unlike the resolver in !238181 (closed).
MR acceptance checklist
This MR meets the definition of done.
References
Follows !238181 (closed), which fixed the same leak at the CreateService resolver. Part of #595673 (closed).
Edited by Rez