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

create gitlab connector (#37) #197

Merged
merged 15 commits into from
Aug 3, 2023
Merged

create gitlab connector (#37) #197

merged 15 commits into from
Aug 3, 2023

Conversation

BeckerFrank
Copy link
Contributor

Here is a POC of a gitlab connector (#37) with the following features.

  • Using native gitlab REST API
  • Using a gitlab.com account with oauth (user and password)
  • Creating a repository configuration and insert projects and groups you are interested
  • Creating queries for one or more projects and groups from the configuration
  • Task editor for basic attributes including Notes
  • Updating some, but not all attributes including add a new Note
  • Creating a new task

@wimjongman @ruspl-afed @merks WDYT?

Should we continue or wait until 4.0 is done?

@ruspl-afed
Copy link
Contributor

or wait until 4.0 is done?

I'm not sure what do you mean by this @BeckerFrank

Since upcoming 4.0.0 is major release, we are free to add & remove whatever we want, and GitLab support could be a nice addition to 4.0.0.
Especially after merging of #195 with releng preparation changes.

@BeckerFrank
Copy link
Contributor Author

Now I have the a version with the following features.

  • only work with https://gitlab.com repositories
  • create queries and show issues for projects and groups
  • create new issues
  • create comments
  • add comments to discussions

@wimjongman, @ruspl-afed, @merks, @gnl42 : please can you give some feedback.
I also want to know what I need to change before I can commit this to the main branch as a preview.
After this we can plan the next steps.

@wimjongman
Copy link
Member

wimjongman commented Jul 19, 2023 via email

Copy link
Contributor

@ruspl-afed ruspl-afed left a comment

Choose a reason for hiding this comment

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

What needs to be done:

  1. license headers (add)
  2. gitlab images (replace with some standard images and ask IP team how to proceed)
  3. API (avoid declaring API on this stage)

All others may be done later

* Frank Becker - initial API and implementation
*******************************************************************************/

package org.eclipse.mylyn.gitlab.core;
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to put more work here before promoting this class to API, I suggest to move to internal package until it will be ready.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use the openapi spec (https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/openapi/openapi.yaml?plain=1) to generate the rest client code?

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 will look into this in the near future how useful the generated client can be.
We can not generate the whole client because have hat to support TaskData Structure but hopefully this is only a small change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to put more work here before promoting this class to API, I suggest to move to internal package until it will be ready.

done with next commit

@Override
public void getMultiTaskData(final TaskRepository repository, Set<String> taskIds,
final TaskDataCollector collector, IProgressMonitor monitor) throws CoreException {
monitor = Policy.monitorFor(monitor);
Copy link
Contributor

Choose a reason for hiding this comment

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

Side note, what would be needed to make IProgressMonitor autoclosable?

Copy link
Contributor

Choose a reason for hiding this comment

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

The use case is not fully clear for me. Do you mean to use in try-with-resources or something else @gnl42 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

The use case is not fully clear for me. Do you mean to use in try-with-resources or something else @gnl42 ?

Yes @ruspl-afed . So instead of:

	monitor = Policy.monitorFor(monitor);
		try {
			monitor.beginTask("Submitting_task", IProgressMonitor.UNKNOWN);
                        ...
		} finally {
			monitor.done();
		}

it would be:

		try (IProgressMonitor postMonitor = Policy.monitorFor(monitor)) {
			postMonitor.beginTask("Submitting_task", IProgressMonitor.UNKNOWN);
	                ...
		} 

Copy link
Contributor

Choose a reason for hiding this comment

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

This Policy.monitorFor(monitor) looks a bit outdated, currently we can use more modern https://github.com/eclipse-equinox/equinox/blob/master/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/SubMonitor.java that does not require finally block and have a lot of other improvements.

@merks
Copy link
Contributor

merks commented Jul 21, 2023

@BeckerFrank

Sorry, I'm torn in so many different directions I can't find time for a review. 😞

label="Mylyn Tasks Connector: Gitlab Preview for gitlab.com only"
version="4.0.0.qualifier"
provider-name="Eclipse Mylyn"
plugin="org.eclipse.mylyn.gitlab.core">
Copy link
Contributor

Choose a reason for hiding this comment

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

here the license feature should be referenced that will bring proper license content.

@ruspl-afed
Copy link
Contributor

@BeckerFrank we can merge it after resolving question with GitLab images and then improve it gradually

@BeckerFrank
Copy link
Contributor Author

@BeckerFrank we can merge it after resolving question with GitLab images and then improve it gradually

Gitlab images are fine, but what is with the comment for mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.source.feature/feature.xml?

What is here needed?. How can I include this function in an update site without this source feature project?

@BeckerFrank BeckerFrank marked this pull request as ready for review August 2, 2023 13:28
Copy link
Contributor

@ruspl-afed ruspl-afed left a comment

Choose a reason for hiding this comment

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

Please resolve conflicts and have a look how source features represented in main

@ruspl-afed ruspl-afed self-requested a review August 2, 2023 13:47
Copy link
Contributor

@ruspl-afed ruspl-afed left a comment

Choose a reason for hiding this comment

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

LGTM
I'll look at source feature later

@BeckerFrank BeckerFrank merged commit a03fd17 into main Aug 3, 2023
@ruspl-afed ruspl-afed deleted the 37_gitlab_connector branch August 6, 2023 15:02
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.

5 participants