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

Add gitlab support #193

Merged
merged 36 commits into from
Sep 16, 2020
Merged

Add gitlab support #193

merged 36 commits into from
Sep 16, 2020

Conversation

vavilen84
Copy link
Contributor

@tstromberg Hi! This draft PR is just to sync with you - if I am on the right way.

Main idea of this PR is to separate 'github' via new 'models' layer.

I created new packages:

  • models (I plan to use these entities instead of github types)
  • constants (just refactoring)
  • interfaces (just refactoring)
  • provider (this package shouild contain provider specific logic.
    by design, I plan to support both providers simultaneously, which will be determined by the host github.com/gitlab.com)
  • utils (just refactoring)

Please correct me if you see the implementation differently or you have any wishes. Thanks!

P.S. code doesnt work for now - this PR is just to sync with you.

@vavilen84
Copy link
Contributor Author

Great news! Application started with empty models data:
Selection_326
now I need to set github types data to application types in pkg/provider/github.go . After this need to test.

@vavilen84
Copy link
Contributor Author

Triage-party alive again!
Selection_328
Next step - implement gitlab API.

@vavilen84
Copy link
Contributor Author

Gitlab works! But for now only if we use "closed-milestone-issues" rule:
Selection_329

Current implementation needs debuging.

@vavilen84
Copy link
Contributor Author

@tstromberg PR is ready for review. Gitlab works!:

Selection_330

But, during integration I had concerns:

  1. I have not found gitlab analogue for github method Issues.ListIssueTimeline https://github.com/google/triage-party/blob/master/pkg/hubbub/timeline.go#L52. It seems that gitlab don`t provide events by issue number, but i could be wrong. For now this method implementation for gitlab returns empty result.

  2. Gitlab 'Notes' API https://docs.gitlab.com/ee/api/notes.html returns 404 but should not:

Selection_332

  1. I filled application models from gitlab models relying on my intuition and the time that I devoted to this project is not enough to know all its subtleties. I think need person who can test this implementation.

@vavilen84 vavilen84 marked this pull request as ready for review July 27, 2020 19:32
Copy link
Collaborator

@tstromberg tstromberg left a comment

Choose a reason for hiding this comment

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

This is quite the tour de force. I've only given it a cursory review so far, but have some minor comments. Overall idea is solid.

I noticed that the models contain a lot of methods we do not make use of - would it be possible to cull the dead code before merging this? For example: issue.GetNodeID, issue.GetLocked.

@vavilen84 vavilen84 force-pushed the add_gitlab_support branch from 0365fbe to 84ea7bf Compare July 28, 2020 17:37
@vavilen84 vavilen84 requested a review from tstromberg July 29, 2020 08:01
@tstromberg
Copy link
Collaborator

Thank you for your patience. Looks good!

@vavilen84
Copy link
Contributor Author

@tstromberg Hey, I see the master have new changes and there are conflicts here. Does it make sense for me to solve these conflicts? Do you have the intention to merge this PR to master?

@tstromberg
Copy link
Collaborator

tstromberg commented Sep 1, 2020

Hey @vavilen84 - sorry for not updating this PR!

I did some pre-merge testing last week and discovered that it seemed to break GitHub support:

go build cmd/server/main.go && ./main --github-token-file ~/.github-private-token --config config/examples/minikube.yaml 
I0901 07:55:38.189273   13713 disk.go:152] default disk path: pcache/minikube.yaml.pc
I0901 07:55:38.189375   13713 disk.go:50] Initializing with pcache/minikube.yaml.pc ...
I0901 07:55:38.189855   13713 disk.go:52] recreating cache due to load error: decode failed: gob: name not registered for interface: "*persist.Thing"
I0901 07:55:38.189879   13713 disk.go:105] *** Saving 0 items to disk cache at pcache/minikube.yaml.pc
I0901 07:55:38.191838   13713 provider.go:58] loaded 41 byte github/gitlab token from /Users/tstromberg/.github-private-token
I0901 07:55:38.191870   13713 provider.go:60] loaded 0 byte github/gitlab token from GITLAB_TOKEN
F0901 07:55:38.191876   13713 provider.go:65] github/gitlab token impossibly small: ""

Do you mind addressing this issue? I can then merge this PR.

@vavilen84
Copy link
Contributor Author

@tstromberg Unwanted provider initiating is fixed - please, review.

@tstromberg
Copy link
Collaborator

This looks better. Thank you! Please resolve the merge conflicts and we are good to merge.

@vavilen84
Copy link
Contributor Author

@tstromberg Conflicts were resolved. Please, review.

@vavilen84 vavilen84 requested a review from tstromberg September 3, 2020 11:14
@tstromberg tstromberg merged commit fe96794 into google:master Sep 16, 2020
@tstromberg
Copy link
Collaborator

Thank you!

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