Skip to content

Commit e87d96d

Browse files
authoredSep 4, 2024··
Merge pull request #36106 from appsmithorg/cp/20240904-1
2 parents a89811d + 78b012d commit e87d96d

File tree

6 files changed

+41
-11
lines changed

6 files changed

+41
-11
lines changed
 

‎app/server/appsmith-git/src/main/java/com/appsmith/git/files/FileUtilsCEImpl.java

+9-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.json.JSONObject;
2424
import org.springframework.context.annotation.Import;
2525
import org.springframework.stereotype.Component;
26-
import org.springframework.util.CollectionUtils;
2726
import org.springframework.util.FileSystemUtils;
2827
import org.springframework.util.StringUtils;
2928
import reactor.core.publisher.Mono;
@@ -279,12 +278,16 @@ protected Set<String> updateEntitiesInRepo(ApplicationGitReference applicationGi
279278

280279
fileOperations.scanAndDeleteDirectoryForDeletedResources(validPages, baseRepo.resolve(PAGE_DIRECTORY));
281280

282-
// Save JS Libs if there's at least one change
283-
if (modifiedResources != null
284-
&& (modifiedResources.isAllModified()
285-
|| !CollectionUtils.isEmpty(
286-
modifiedResources.getModifiedResourceMap().get(CUSTOM_JS_LIB_LIST)))) {
281+
// Earlier this condition included that modified resource not be null, and
282+
// it should either have allModified flag turned as true or CUSTOM_JS_LIB_LIST resource map is not empty
283+
// Save JS Libs if there's at least one change.
287284

285+
// What are the possible caveats of making this change?
286+
// Since each resource in the entry needs to be present in the Modified resource map to be written
287+
// There won't be any differences in writing files.
288+
// In terms of performance, we would need to access the customJSLib directory every time to
289+
// compare with the valid js libs.
290+
if (modifiedResources != null) {
288291
Path jsLibDirectory = baseRepo.resolve(JS_LIB_DIRECTORY);
289292
Set<Map.Entry<String, Object>> jsLibEntries =
290293
applicationGitReference.getJsLibraries().entrySet();

‎app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/Datasource.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class Datasource extends GitSyncedDomain {
5454
String templateName;
5555

5656
// This is only kept public for embedded datasource
57-
@JsonView({Views.Public.class, FromRequest.class})
57+
@JsonView({Views.Public.class, FromRequest.class, Git.class})
5858
DatasourceConfiguration datasourceConfiguration;
5959

6060
@Transient

‎app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/DatasourceConfiguration.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.appsmith.external.models;
22

33
import com.appsmith.external.views.FromRequest;
4+
import com.appsmith.external.views.Git;
45
import com.appsmith.external.views.Views;
56
import com.fasterxml.jackson.annotation.JsonView;
67
import lombok.AllArgsConstructor;
@@ -37,17 +38,17 @@ public class DatasourceConfiguration implements AppsmithDomain {
3738

3839
Boolean sshProxyEnabled;
3940

40-
@JsonView({Views.Public.class, FromRequest.class})
41+
@JsonView({Views.Public.class, FromRequest.class, Git.class})
4142
List<Property> properties;
4243

4344
// For REST API.
44-
@JsonView({Views.Public.class, FromRequest.class})
45+
@JsonView({Views.Public.class, FromRequest.class, Git.class})
4546
String url;
4647

47-
@JsonView({Views.Public.class, FromRequest.class})
48+
@JsonView({Views.Public.class, FromRequest.class, Git.class})
4849
List<Property> headers;
4950

50-
@JsonView({Views.Public.class, FromRequest.class})
51+
@JsonView({Views.Public.class, FromRequest.class, Git.class})
5152
List<Property> queryParameters;
5253

5354
public boolean isSshProxyEnabled() {

‎app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public class CommonConfig {
6767
@Value("${appsmith.micrometer.tracing.detail.enabled:false}")
6868
private boolean tracingDetail;
6969

70+
@Value("${appsmith.micrometer.metrics.detail.enabled:false}")
71+
private boolean metricsDetail;
72+
7073
private List<String> allowedDomains;
7174

7275
private String mongoDBVersion;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.appsmith.server.configurations;
2+
3+
import lombok.RequiredArgsConstructor;
4+
import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory;
5+
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
6+
import org.springframework.stereotype.Component;
7+
8+
import java.util.function.Function;
9+
10+
@RequiredArgsConstructor
11+
@Component
12+
public class ReactorNettyConfiguration implements WebServerFactoryCustomizer<NettyReactiveWebServerFactory> {
13+
14+
private final CommonConfig commonConfig;
15+
16+
@Override
17+
public void customize(NettyReactiveWebServerFactory factory) {
18+
if (commonConfig.isMetricsDetail()) {
19+
factory.addServerCustomizers(httpServer -> httpServer.metrics(true, Function.identity()));
20+
}
21+
}
22+
}

‎app/server/appsmith-server/src/main/resources/application.properties

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ appsmith.newrelic.micrometer.metrics.application.name=${APPSMITH_NEWRELIC_MICROM
123123
spring.application.name=${OTEL_SERVICE_NAME:appsmith-anonymous}
124124
appsmith.micrometer.metrics.enabled=${APPSMITH_MICROMETER_METRICS_ENABLED:false}
125125
appsmith.micrometer.tracing.detail.enabled=${APPSMITH_ENABLE_TRACING_DETAIL:false}
126+
appsmith.micrometer.metrics.detail.enabled=${APPSMITH_ENABLE_METRICS_DETAIL:false}
126127

127128
springdoc.api-docs.path=/v3/docs
128129
springdoc.swagger-ui.path=/v3/swagger

0 commit comments

Comments
 (0)
Please sign in to comment.