Skip to content

Commit 73e1f74

Browse files
authored
Merge pull request #2032 from digma-ai/feature/new-environment-api
Feature/new environment api
2 parents d4d270b + 010cc71 commit 73e1f74

File tree

193 files changed

+4830
-7011
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+4830
-7011
lines changed

CHANGELOG.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
# Changelog
22

3-
## [2.0.319] - 2024-04-15
4-
5-
- refresh plugins metadata before update Closes #2005 by @shalom938 in https://github.com/digma-ai/digma-intellij-plugin/pull/2054
6-
- change-custom-event-to-user-action by @shalom938 in https://github.com/digma-ai/digma-intellij-plugin/pull/2056
7-
- update-rider-dependency-to-2024.1 by @shalom938 in https://github.com/digma-ai/digma-intellij-plugin/pull/2059
8-
- check response code in docker compose downloader Closes #2066 by @shalom938 in https://github.com/digma-ai/digma-intellij-plugin/pull/2067
9-
- small fix digmathon service by @shalom938 in https://github.com/digma-ai/digma-intellij-plugin/pull/2070
10-
- Update Digma overload warning link by @kshmidt-digma in https://github.com/digma-ai/digma-intellij-plugin/pull/2064
11-
12-
## 2.0.318 - 2024-04-10
3+
## [2.0.318] - 2024-04-10
134

145
- updated dates by @doppleware in https://github.com/digma-ai/digma-intellij-plugin/pull/2055
156

@@ -26,7 +17,8 @@
2617
## 2.0.315 - 2024-04-07
2718

2819
- force update Closes #2015 by @shalom938 in https://github.com/digma-ai/digma-intellij-plugin/pull/2035
29-
- Enhance instrumentation flavor for all configuration types by @shalom938 in https://github.com/digma-ai/digma-intellij-plugin/pull/2045
20+
- Enhance instrumentation flavor for all configuration types by @shalom938
21+
in https://github.com/digma-ai/digma-intellij-plugin/pull/2045
3022

3123
## 2.0.314 - 2024-04-05
3224

analytics-provider/build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,32 @@ plugins {
66
}
77

88

9+
abstract class OkhttpAlignmentRule : ComponentMetadataRule {
10+
override fun execute(ctx: ComponentMetadataContext) {
11+
ctx.details.run {
12+
if (id.group.startsWith("com.squareup.okhttp3")) {
13+
belongsTo("com.squareup.okhttp3:okhttp-virtual-platform:${id.version}")
14+
}
15+
}
16+
}
17+
}
18+
19+
920
dependencies {
21+
22+
//make sure all okhttp dependencies are of the same version.
23+
//do not add a dependency to okhttp modules that is higher than what retrofit brings. check with dependencies task.
24+
components.all<OkhttpAlignmentRule>()
25+
1026
implementation(project(":model"))
1127
implementation(libs.retrofit.client)
1228
implementation(libs.retrofit.jackson)
1329
implementation(libs.retrofit.scalars)
1430
implementation(libs.jackson.datetime)
1531
implementation(libs.guava)
32+
implementation(libs.okhttp.logging) {
33+
isTransitive = false
34+
}
1635
}
1736

1837

analytics-provider/src/main/java/org/digma/intellij/plugin/analytics/AnalyticsProvider.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
import org.digma.intellij.plugin.model.rest.common.SpanHistogramQuery;
88
import org.digma.intellij.plugin.model.rest.debugger.DebuggerEventRequest;
99
import org.digma.intellij.plugin.model.rest.env.*;
10+
import org.digma.intellij.plugin.model.rest.environment.Env;
1011
import org.digma.intellij.plugin.model.rest.errordetails.CodeObjectErrorDetails;
1112
import org.digma.intellij.plugin.model.rest.errors.CodeObjectError;
1213
import org.digma.intellij.plugin.model.rest.event.*;
13-
import org.digma.intellij.plugin.model.rest.highlights.HighlightsPerformanceResponse;
1414
import org.digma.intellij.plugin.model.rest.insights.*;
1515
import org.digma.intellij.plugin.model.rest.livedata.*;
16+
import org.digma.intellij.plugin.model.rest.login.*;
1617
import org.digma.intellij.plugin.model.rest.lowlevel.*;
1718
import org.digma.intellij.plugin.model.rest.navigation.*;
1819
import org.digma.intellij.plugin.model.rest.notifications.*;
@@ -26,11 +27,15 @@
2627

2728
public interface AnalyticsProvider extends Closeable {
2829

29-
List<String> getEnvironments();
30+
LoginResponse login(LoginRequest loginRequest);
31+
32+
LoginResponse refreshToken(RefreshRequest loginRequest);
33+
34+
List<Env> getEnvironments();
3035

3136
void sendDebuggerEvent(DebuggerEventRequest debuggerEventRequest);
3237

33-
List<InsightInfo> getInsightsInfo(InsightsRequest insightsRequest);
38+
List<InsightTypesForJaegerResponse> getInsightsForJaeger(InsightTypesForJaegerRequest request);
3439

3540
String getInsightBySpan(String environment, String spanCodeObjectId, String insightType);
3641

@@ -100,6 +105,12 @@ public interface AnalyticsProvider extends Closeable {
100105

101106
AssetNavigationResponse getAssetNavigation(String env, String spanCodeObjectId);
102107

108+
String createEnvironments(Map<String, Object> request);
109+
110+
String register(Map<String, Object> request);
111+
112+
void deleteEnvironmentV2(String id);
113+
103114
void markInsightsAsRead(List<String> insightIds);
104115
void markAllInsightsAsRead(String environment, MarkInsightsAsReadScope scope);
105116

@@ -111,7 +122,7 @@ public interface AnalyticsProvider extends Closeable {
111122

112123
HttpResponse lowLevelCall(HttpRequest request);
113124

114-
List<HighlightsPerformanceResponse> getHighlightsPerformance(Map<String, Object> queryParams);
125+
String getHighlightsPerformance(Map<String, Object> queryParams);
115126

116127
String getHighlightsTopInsights(Map<String, Object> queryParams);
117128
}

analytics-provider/src/main/java/org/digma/intellij/plugin/analytics/AnalyticsProviderException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,8 @@ public String getMessage() {
2828
}
2929
return super.getMessage();
3030
}
31+
32+
public String getDetailedMessage() {
33+
return super.getMessage();
34+
}
3135
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.digma.intellij.plugin.analytics;
2+
3+
public class AuthenticationException extends AnalyticsProviderException {
4+
5+
public AuthenticationException(int code, String message) {
6+
super(code, message);
7+
}
8+
9+
public AuthenticationException(String message, Throwable cause) {
10+
super(message, cause);
11+
}
12+
13+
public AuthenticationException(Throwable cause) {
14+
super(cause);
15+
}
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.digma.intellij.plugin.analytics;
2+
3+
import javax.annotation.CheckForNull;
4+
5+
public interface AuthenticationProvider {
6+
7+
@CheckForNull
8+
String getHeaderName();
9+
10+
@CheckForNull
11+
String getHeaderValue();
12+
13+
14+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.digma.intellij.plugin.analytics;
2+
3+
public class HTTPConstants {
4+
5+
public static final int UNAUTHORIZED = 401;
6+
}

0 commit comments

Comments
 (0)