Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4001/3996] Feature gitlab mr auto update #4053

Merged
merged 8 commits into from
Jul 25, 2023

Conversation

umeshlumbhani247
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@nickmango nickmango left a comment

Choose a reason for hiding this comment

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

@umeshlumbhani247
Utils will have interfaces for Signature which will break the design. A better approach would be to import the signature package in utils and create a utility function that will be used in the gitlab_activity package. This will require re-work

Signed-off-by: Umesh Lumbhani <[email protected]>
Copy link
Collaborator

@nickmango nickmango left a comment

Choose a reason for hiding this comment

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

@umeshlumbhani247 kindly use existing pattern in https://github.com/communitybridge/easycla/blob/main/cla-backend-go/v2/repositories/gitlab_services.go
Leave the interfaces in the current packages (signatures and gitlab activities)
Create a file implementing these interfaces ie in the signatures package create signature_service that does the concrete implementation. When importing you can use the interface. This would be a shorter and cleaner way

Signed-off-by: Umesh Lumbhani <[email protected]>
Signed-off-by: Umesh Lumbhani <[email protected]>
@umeshlumbhani247
Copy link
Collaborator Author

@nickmango
I have update according to your comment.,
Please review it and let me know if anything.
CC: @mlehotskylf

@@ -1,15 +1,21 @@
// Copyright The Linux Foundation and each contributor to CommunityBridge.
// SPDX-License-Identifier: MIT

package signatures
package models
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maintain the models.py . You had added the models folder

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nickmango this models, i need to use in gitlab_activity, and i can't use signatures package in it due to cyclic dependency.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The cyclic issue can be resolved with interfaces @umeshlumbhani247

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have updated the code, Please review @nickmango

// Copyright The Linux Foundation and each contributor to CommunityBridge.
// SPDX-License-Identifier: MIT

package models
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maintain convention with models.py under signature package

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have updated this , moved to gitlab_activity package.


var missingCompanyAffiliation = errors.New("must confirm affiliation with their company")

func PrepareMrCommentContent(missingUsers []*GatedGitlabUser, signedUsers []*gitlab.User, signURL string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can maintain in the previous package. No need for utils package as it can get populated

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am using this method on signatures->service.go, If i keep it on previous package , It will show cyclic dependency issue, as gitlab_activity is using signature package.

Copy link
Collaborator

@nickmango nickmango left a comment

Choose a reason for hiding this comment

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

lgtm

@nickmango nickmango merged commit 2e8658e into main Jul 25, 2023
3 of 5 checks passed
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.

2 participants