#change default namespace for all entities
11 messages · Page 1 of 1 (latest)
I don't think there's widespread adoption of namespacing as it seems to be the message that namespaces shouldn't be used currently -- though i'd love to see some more discussion on the topic of namespaces as it seems like a powerful feature.
The problem I’m facing is that all the imported users and groups from github are mapped to User:default/* or Group:default/*. This prevents me from using the Templates feature along with assigning collaborators when creating a repo out of a template. Because during the register phase it tries to search for a group to assign the repo. The group in GitHub is having a combined slug of myOrg/myTeamName. But backstage tries default/myTeamName which doesnt exist in GitHub and i end up having a repo created with no one having access to it because the mapping didn’t happen.
I hope I’m not too cryptic..
in the publish step i see this warning:
2023-04-06T20:38:14.588Z warn: Skipping admin access for myorg/group:default/mygroup, Not Found
you can use the GithubMultiOrgReaderProcessor to do this for org data specifically (even with a single org), it ingests org data with a configured namespace for the org https://github.com/backstage/backstage/blob/master/plugins/catalog-backend-module-github/src/processors/GithubMultiOrgReaderProcessor.ts
docs lacking but example usage here https://github.com/backstage/backstage/pull/5173
thanks @shy egret this worked, however even when the new groups where under the correct org namespace. when creating a repo out of a template and use the new group myorg/mygroup..it still showed the warn in the github:publish step saying the group is not found and it's getting skipped.
this leads to a repo created without a team assigned to it as a collaborator
mm yeah, I suspect the problem is here
https://github.com/backstage/backstage/blob/f83c0446df80dd63dff180c8b776957eeab1c9a1/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/helpers.ts#L228
entityRefToName does name.replace(/^.*[:/]/g, ''); which transforms group:myorg/mygroup into just mygroup
maybe should be more like
name.replace(/^.*:/, '').replace('^default/', '');
or similar to remove the default namespace but not others?
I am wondering if i can bypass this problem by using something like: myorg/{{( parameters.repoUrl | parseRepoUrl)['owner'] }} filter to get the team directly with the org attached to it and use it either in the collaborators field or the access field in the github:publish step?
@shy egret do you think this makes sense?