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

GitLab Tasks Connector fails on repo with issues disabled #501

Closed
Paranoja opened this issue Apr 28, 2024 · 1 comment
Closed

GitLab Tasks Connector fails on repo with issues disabled #501

Paranoja opened this issue Apr 28, 2024 · 1 comment
Milestone

Comments

@Paranoja
Copy link
Contributor

GitLab Connector (introduced in #37) fails to initialize it's configuration when user account lists repository with issues disabled in repository setting.

Steps to reproduce:

  1. Given GitLab server "S" with User "U" create a new Mylyn GitLab Connector configuration "C" using User U's login/password or access token
  2. Ensure user "U" has access to at least one GitLab Repository with "Issues" feature disabled:
    • Disable "Issues" feature in existing GitLab Repository
    • Create new GitLab Repository and disable "Issues" feature
  3. In Mylyn Task Repositories view create a "New Query" for GitLab repository "C"

Expected Result

  • Query building screen is populated with values
  • It is possible to create a query

Actual Result

  • Query building screen is empty, no values are shown in "Projects" or "Groups" filters etc.
  • Error has been logged
!ENTRY org.eclipse.ui 4 0 2024-04-28 02:11:02.805
!MESSAGE Unhandled event loop exception
!STACK 0
java.util.concurrent.CompletionException: org.eclipse.mylyn.gitlab.core.GitlabException: Unexpected response from Gitlab REST server for '/api/v4/projects/45384114/milestones': Forbidden
	at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:190)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2688)
	at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2686)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2669)
	at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112)
	at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:58)
	at org.eclipse.mylyn.internal.gitlab.core.GitlabRepositoryConnector.getRepositoryConfiguration(GitlabRepositoryConnector.java:174)
	at org.eclipse.mylyn.internal.gitlab.ui.GitlabConnectorUI.getQueryWizard(GitlabConnectorUI.java:61)
	at org.eclipse.mylyn.internal.tasks.ui.actions.NewQueryAction.run(NewQueryAction.java:82)
	at org.eclipse.mylyn.internal.tasks.ui.actions.NewQueryAction.run(NewQueryAction.java:58)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:239)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:581)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:415)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5855)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1529)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5065)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4517)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1432)
Caused by: org.eclipse.mylyn.gitlab.core.GitlabException: Unexpected response from Gitlab REST server for '/api/v4/projects/45384114/milestones': Forbidden
	at org.eclipse.mylyn.internal.gitlab.core.GitlabOperation.validate(GitlabOperation.java:105)
	at org.eclipse.mylyn.internal.gitlab.core.GitlabOperation.doValidate(GitlabOperation.java:94)
	at org.eclipse.mylyn.internal.gitlab.core.GitlabOperation.processAndRelease(GitlabOperation.java:85)
	at org.eclipse.mylyn.internal.gitlab.core.GitlabJSonArrayOperation.execute(GitlabJSonArrayOperation.java:54)
	at org.eclipse.mylyn.internal.gitlab.core.GitlabJSonArrayOperation.execute(GitlabJSonArrayOperation.java:1)
	at org.eclipse.mylyn.internal.gitlab.core.GitlabOperation.run(GitlabOperation.java:53)
	at org.eclipse.mylyn.internal.gitlab.core.GitlabRestClient.getProjectMilestones(GitlabRestClient.java:1549)
	at org.eclipse.mylyn.internal.gitlab.core.GitlabRestClient.getConfiguration(GitlabRestClient.java:1317)
	at org.eclipse.mylyn.internal.gitlab.core.GitlabRepositoryConnector.lambda$2(GitlabRepositoryConnector.java:142)
	at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:183)
	... 40 more

Turns out that GitLab responds with 403 Forbidden for GET /projects/:id/milestones in such case.

Paranoja added a commit to Paranoja/org.eclipse.mylyn that referenced this issue Apr 28, 2024
ruspl-afed pushed a commit to Paranoja/org.eclipse.mylyn that referenced this issue May 3, 2024
Paranoja added a commit to Paranoja/org.eclipse.mylyn that referenced this issue May 5, 2024
Paranoja added a commit to Paranoja/org.eclipse.mylyn that referenced this issue May 5, 2024
ruspl-afed pushed a commit to Paranoja/org.eclipse.mylyn that referenced this issue May 6, 2024
Paranoja added a commit to Paranoja/org.eclipse.mylyn that referenced this issue May 6, 2024
BeckerFrank pushed a commit that referenced this issue May 6, 2024
…Milestones (#501) (#502)

* Skip milestones when repo issues disabled (#501)

* Extract duplicates
@BeckerFrank
Copy link
Contributor

@Paranoja: We close this Ticket. If not fixed please reopen this Ticket.

@BeckerFrank BeckerFrank added this to the 4.3.0 milestone May 12, 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

No branches or pull requests

2 participants