Skip to content

Conversation

@evanshortiss
Copy link

@evanshortiss evanshortiss commented Dec 17, 2024

What does this PR do / why we need it

Enables a new platform engineer user to login. Linked PR redhat-gpte-devopsautomation/agnosticg#5

It also creates a developers group for user1..userN, and fixes the avatar URLs to use the newer format by dicebear.

In theory we can avoid the need to hardcode these entities in the future, by using the GitLab Org plugin and structuring groups in GitLab appropriately. It will depend on this issue being resolved

How to test changes / Special notes to the reviewer

You can add this entity to the org.yaml on an existing RHDH demo cluster and create the user manually in GitLab using the following cURL command. You should be able to login to RHDH as the pe user after completing both of these steps.

curl --request POST \
    --url "$GITLAB_HOST/api/v4/users" \
    --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
    --header "Content-Type: application/x-www-form-urlencoded" \
    --data-urlencode "admin=false" \
    --data-urlencode "email=pe@demo.com" \
    --data-urlencode "public_email=pe@demo.com" \
    --data-urlencode "skip_confirmation=true" \
    --data-urlencode "username=pe" \
    --data-urlencode "password=$PE_PASSWORD" \
    --data-urlencode "name=Platform Engineer"

children: []
---
apiVersion: backstage.io/v1alpha1
kind: Group
Copy link
Author

Choose a reason for hiding this comment

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

This group makes it easier to assign RBAC permissions to all regular users1...n

apiVersion: backstage.io/v1alpha1
kind: User
metadata:
name: pe
Copy link
Author

Choose a reason for hiding this comment

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

PE user will have admin privileges from RBAC plugin

picture: https://avatars.dicebear.com/api/avataaars/breanna-davison@example.com.svg?background=%23fff
memberOf: [user{{ index + 1 }}]
picture: https://api.dicebear.com/9.x/thumbs/svg?seed={{ user_images[index % user_images | length] }}
memberOf: [user{{ index + 1 }}, developers]
Copy link
Author

Choose a reason for hiding this comment

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

Question: should we remove the userN group entirely? Was there a reason it was added? Seems a little confusing to have a user and group with the same name 1:1.

@evanshortiss evanshortiss changed the title feat: add platform engineer user entity feat: add platform engineer user entity and developer group Dec 17, 2024
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.

1 participant