Skip to content

Commit

Permalink
Merge pull request #36106 from appsmithorg/cp/20240904-1
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhi-nair committed Sep 4, 2024
2 parents a89811d + 78b012d commit e87d96d
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.json.JSONObject;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.FileSystemUtils;
import org.springframework.util.StringUtils;
import reactor.core.publisher.Mono;
Expand Down Expand Up @@ -279,12 +278,16 @@ protected Set<String> updateEntitiesInRepo(ApplicationGitReference applicationGi

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

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

// What are the possible caveats of making this change?
// Since each resource in the entry needs to be present in the Modified resource map to be written
// There won't be any differences in writing files.
// In terms of performance, we would need to access the customJSLib directory every time to
// compare with the valid js libs.
if (modifiedResources != null) {
Path jsLibDirectory = baseRepo.resolve(JS_LIB_DIRECTORY);
Set<Map.Entry<String, Object>> jsLibEntries =
applicationGitReference.getJsLibraries().entrySet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Datasource extends GitSyncedDomain {
String templateName;

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

@Transient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.appsmith.external.models;

import com.appsmith.external.views.FromRequest;
import com.appsmith.external.views.Git;
import com.appsmith.external.views.Views;
import com.fasterxml.jackson.annotation.JsonView;
import lombok.AllArgsConstructor;
Expand Down Expand Up @@ -37,17 +38,17 @@ public class DatasourceConfiguration implements AppsmithDomain {

Boolean sshProxyEnabled;

@JsonView({Views.Public.class, FromRequest.class})
@JsonView({Views.Public.class, FromRequest.class, Git.class})
List<Property> properties;

// For REST API.
@JsonView({Views.Public.class, FromRequest.class})
@JsonView({Views.Public.class, FromRequest.class, Git.class})
String url;

@JsonView({Views.Public.class, FromRequest.class})
@JsonView({Views.Public.class, FromRequest.class, Git.class})
List<Property> headers;

@JsonView({Views.Public.class, FromRequest.class})
@JsonView({Views.Public.class, FromRequest.class, Git.class})
List<Property> queryParameters;

public boolean isSshProxyEnabled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public class CommonConfig {
@Value("${appsmith.micrometer.tracing.detail.enabled:false}")
private boolean tracingDetail;

@Value("${appsmith.micrometer.metrics.detail.enabled:false}")
private boolean metricsDetail;

private List<String> allowedDomains;

private String mongoDBVersion;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.appsmith.server.configurations;

import lombok.RequiredArgsConstructor;
import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;

import java.util.function.Function;

@RequiredArgsConstructor
@Component
public class ReactorNettyConfiguration implements WebServerFactoryCustomizer<NettyReactiveWebServerFactory> {

private final CommonConfig commonConfig;

@Override
public void customize(NettyReactiveWebServerFactory factory) {
if (commonConfig.isMetricsDetail()) {
factory.addServerCustomizers(httpServer -> httpServer.metrics(true, Function.identity()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ appsmith.newrelic.micrometer.metrics.application.name=${APPSMITH_NEWRELIC_MICROM
spring.application.name=${OTEL_SERVICE_NAME:appsmith-anonymous}
appsmith.micrometer.metrics.enabled=${APPSMITH_MICROMETER_METRICS_ENABLED:false}
appsmith.micrometer.tracing.detail.enabled=${APPSMITH_ENABLE_TRACING_DETAIL:false}
appsmith.micrometer.metrics.detail.enabled=${APPSMITH_ENABLE_METRICS_DETAIL:false}

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

0 comments on commit e87d96d

Please sign in to comment.