Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

User entity and user group user relationship #4

Merged
merged 7 commits into from
Apr 29, 2021

Conversation

kenanwarren
Copy link
Contributor

No description provided.

@kenanwarren kenanwarren force-pushed the sq-user-model-step branch 3 times, most recently from 8a2b234 to 7464ba0 Compare April 29, 2021 17:13

| Source Entity `_type` | Relationship `_class` | Target Entity `_type` |
| ---------------------- | --------------------- | --------------------- |
| `sonarqube_user_group` | **HAS** | `sonarqube_user` |
Copy link

Choose a reason for hiding this comment

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

Are there any relationships between users/groups and projects?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think there is directly I'd have to investigate a bit more. There is a permissions page (the api docs for it look incomplete though) and I'm thinking that's what we want.

Comment on lines +148 to +149
p: String(page),
ps: String(ITEMS_PER_PAGE),
Copy link

Choose a reason for hiding this comment

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

Are p and ps jut aliases for page and per_page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sonarqube uses p/ps when I wrote the test you recommended I noticed it wasn't working as I expected. 🤦‍♂️

export function createProjectEntity(project: SonarqubeProject): Entity {
return createIntegrationEntity({
entityData: {
source: project,
assign: {
_key: project.key,
_key: createProjectEntityIdentifier(project.key),
Copy link

Choose a reason for hiding this comment

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

I'm a little confused. Why did we need to add the sonarqube-project: prefix back here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The minimum characters is 10 for a key and you can be under 10 characters on the project name.

Copy link

Choose a reason for hiding this comment

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

Ah gotcha. Thanks.

I was looking for the minimum character length earlier... where did you end up finding it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I switched to toMatchGraphObjectSchema it yelled about the 10 character minimum.

Comment on lines +57 to +61
if (!userGroupEntity) {
throw new IntegrationMissingKeyError(
`Expected user group with key to exist (key=${userGroupEntityId})`,
);
}
Copy link

Choose a reason for hiding this comment

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

Now's probably a good time to mention that you'll probably see some integrations that throw if jobState.findEntity doesn't find an entity, and others that just silently continue. Keep this in mind as you work through integrations because it will be great to gain a consensus on the right approach over time.

Copy link

@ndowmon ndowmon left a comment

Choose a reason for hiding this comment

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

Awesome - thanks for the changes!

@kenanwarren kenanwarren merged commit 5b7b60c into master Apr 29, 2021
@kenanwarren kenanwarren deleted the sq-user-model-step branch April 29, 2021 18:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants