Skip to content

Commit

Permalink
fix: TW-83919 S3 Integrity verification: If the "verifyIntegrityAfter…
Browse files Browse the repository at this point in the history
…Upload" option isn't listed in kotlin DSL file, TC UI considers it as "not enabled"

Merge-request: TC-MR-7291
Merged-by: Andrei Efimov <Andrei.Efimov@jetbrains.com>
  • Loading branch information
wayfarer-rus authored and Space Team committed Oct 13, 2023
1 parent 2382482 commit 2c75924
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public Map<String, String> getDefaultParameters() {
Map<String, String> result = new HashMap<>(AWSCommonParams.getDefaults(myServerSettings.getServerUUID()));
result.put(AWSCommonParams.REGION_NAME_PARAM, AWSRegions.DEFAULT_REGION);
result.put(S3Constants.S3_USE_PRE_SIGNED_URL_FOR_UPLOAD, Boolean.toString(true));
result.put(S3Constants.S3_VERIFY_INTEGRITY_AFTER_UPLOAD, Boolean.toString(true));
result.put(AWSCommonParams.ENVIRONMENT_NAME_PARAM, "Custom");
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import jetbrains.buildServer.artifacts.s3.S3Constants;
import jetbrains.buildServer.artifacts.s3.S3Util;
import jetbrains.buildServer.artifacts.s3.cloudfront.CloudFrontConstants;
import jetbrains.buildServer.clouds.amazon.connector.featureDevelopment.ChosenAwsConnPropertiesProcessor;
Expand Down Expand Up @@ -43,10 +42,6 @@ public Collection<InvalidProperty> process(Map<String, String> params) {
}
}

if (StringUtil.isEmptyOrSpaces(params.get(S3Constants.S3_VERIFY_INTEGRITY_AFTER_UPLOAD))) {
params.put(S3Constants.S3_VERIFY_INTEGRITY_AFTER_UPLOAD, "false");
}

return invalids;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public String getEditStorageParametersPath() {
public Map<String, String> getDefaultParameters() {
Map<String, String> result = new HashMap<>();
result.put(S3Constants.S3_USE_PRE_SIGNED_URL_FOR_UPLOAD, Boolean.toString(true));
result.put(S3Constants.S3_VERIFY_INTEGRITY_AFTER_UPLOAD, Boolean.toString(true));
result.put(AWSCommonParams.EXTERNAL_ID_PARAM, "TeamCity-server-" + myServerSettings.getServerUUID());
// Ensures backwards compatibility with old S3 configurations and fixes TW-81457
result.put(AWSCommonParams.SERVICE_ENDPOINT_PARAM, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
usePresignUrlsForUpload: "<bs:forJs>${propertiesBean.properties[params.usePresignUrlsForUpload]}</bs:forJs>" === "true",
forceVirtualHostAddressing: "<bs:forJs>${propertiesBean.properties[params.forceVirtualHostAddressing]}</bs:forJs>" === "true",
verifyIntegrityAfterUpload: "<bs:forJs>${propertiesBean.properties[params.verifyIntegrityAfterUpload]}</bs:forJs>" === "true",
verifyIntegrityAfterUpload: "<bs:forJs>${propertiesBean.properties[params.verifyIntegrityAfterUpload]}</bs:forJs>" !== "false",
transferAccelerationOn: "<bs:forJs>${Boolean.parseBoolean(transferAccelerationOn)}</bs:forJs>" === "true",
enableAccelerateMode: "<bs:forJs>${propertiesBean.properties[params.enableAccelerateMode]}</bs:forJs>" === "true",
multipartUploadThreshold: "<bs:forJs>${propertiesBean.properties[params.multipartUploadThreshold]}</bs:forJs>",
Expand Down

0 comments on commit 2c75924

Please sign in to comment.