Skip to content

Instantly share code, notes, and snippets.

View adietish's full-sized avatar

Andre Dietisheim adietish

  • Red Hat, Inc
  • Bern, Switzerland and Sausset les Pins, France
View GitHub Profile
@adietish
adietish / RemoveCommand#isTracked
Created August 23, 2012 09:39
EGit/JGit: how to find out if a file is tracked within a git repo
private boolean isTracked(File file, Repository repo) throws IOException {
ObjectId objectId = repo.resolve(Constants.HEAD);
RevTree tree;
if (objectId != null)
tree = new RevWalk(repo).parseTree(objectId);
else
tree = null;
TreeWalk treeWalk = new TreeWalk(repo);
treeWalk.setRecursive(true);
RepositoryId repositoryId = RepositoryId.fromUrl(<githuburl>);
PullRequestMarker headMarker = new PullRequestMarker().setLabel(<head>);
PullRequestMarker baseMarker = new PullRequestMarker().setLabel(<base>);
PullRequest pullRequestDefinition = new PullRequest().setHead(headMarker).setBase(baseMarker);
GitHubClient client = GitHubClient.createClient(IGitHubConstants.HOST_DEFAULT);
PullRequestService service = new PullRequestService(client);
PullRequest pullRequest = service.createPullRequest(repositoryId, pullRequestDefinition);
@adietish
adietish / gist:7674337
Last active December 29, 2015 12:59 — forked from fbricon/gist:7674232
private void createLink(Composite composite) {
warningArea = new Composite(composite, SWT.NONE);
warningArea.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
RowLayout layout = new RowLayout();
layout.justify = false;
warningArea.setLayout(layout)
Label warningImg = new Label(warningArea, SWT.NONE);
warningImg.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING));
{
"api_version": 1.6,
"data": {
"aliases": [
],
"app_url": "http://orion-foogoo.rhcloud.com/",
"auto_deploy": true,
"build_job_url": null,
"building_app": null,
@Test
public void should_not_overwrite_client_authentication_strategy_when_isConnected() {
// given
when(client.getAuthorizationStrategy()).thenReturn(mock(IAuthorizationStrategy.class));
when(client.getContext(anyString())).thenReturn(mock(IAuthorizationContext.class));
// when
connection.isConnected(new NullProgressMonitor());
// then
verify(client, never()).setAuthorizationStrategy(any(IAuthorizationStrategy.class));
}
/*******************************************************************************
* Copyright (c) 2016 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v 1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributor:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/

Red Hat Telemetry

Build status JetBrains plugins JetBrains plugins

This library provides Telemetry APIs specifically meant to be used by IDEA plugins developped by Red Hat.

cindervolumesource-v1.json
volumenoderesources-storage-v1beta1.json
ingressstatus-networking-v1beta1.json
poddisruptionbudgetlist-policy-v1beta1.json
endpointslist-v1.json
eviction-policy-v1beta1.json
queuingconfiguration-flowcontrol-v1alpha1.json
policyrule-rbac-v1alpha1.json
poddnsconfigoption-v1.json
podcondition-v1.json
java.lang.Throwable: commitDocument() left PSI inconsistent: not committed document DocumentImpl[file:///private/var/folders/2t/l3zqx5ks1gl2c9lkd0yxy80m0000gn/T/intellij-kubernetes/ngnix@default.yml], File[YAML file ngnix@default.yml, Language: yaml, SingleRootFileViewProvider{myVirtualFile=file:///private/var/folders/2t/l3zqx5ks1gl2c9lkd0yxy80m0000gn/T/intellij-kubernetes/ngnix@default.yml, content=com.intellij.psi.AbstractFileViewProvider$PsiFileContent@55260257}]; node.length=4267; doc.text!=file.text; file name:ngnix@default.yml; type:org.jetbrains.yaml.YAMLFileType@447f7d8e; lang:Language: yaml
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)
at com.intellij.psi.impl.DocumentCommitThread.assertAfterCommit(DocumentCommitThread.java:723)
at com.intellij.psi.impl.DocumentCommitThread.lambda$doCommit$7(DocumentCommitThread.java:712)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitToExistingPsi(PsiDocumentManagerBase.java:381)
at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$f
Access is allowed from event dispatch thread only.
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@5c1ca476
Current thread: Thread[OkHttp https://192.168.64.6:8443/...,6,Idea Thread Group] 697346817
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 100232331
at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:959)
at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:948)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.addTopComponent(FileEditorManagerImpl.java:1408)
at com.redhat.devtools.intellij.kubernetes.editor.FileEditorExtensionsKt.showNotification(FileEditorExtensions.kt:26)
at com.redhat.devtools.intellij.kubernetes.editor.notification.ReloadedNotification.show(ReloadedNotification.kt:32)