Skip to content

Commit 60deaf5

Browse files
committed
HARMONY-1780: Behavior change if a user explicitly passes extend=false and concatenate=true, batchee and stitchee will be skipped and only l2ss-py and concise will run.
1 parent 11c641a commit 60deaf5

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

services/harmony/app/middleware/extend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function setExtendDimensionsDefault(req: HarmonyRequest): void {
1818
// concatenation is requested for a service that supports extend, we also specify extend
1919
if (
2020
(operation?.extendDimensions?.length === 1 && operation.extendDimensions[0] === 'true') ||
21-
(operation.shouldConcatenate && !(operation?.extendDimensions?.length > 0))
21+
(operation.shouldConcatenate && !(operation?.extendDimensions?.length > 0) && req.query?.extend !== 'false')
2222
) {
2323
operation.extendDimensions = defaultExtendDimensions;
2424
}

services/harmony/app/models/services/base-service.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,19 @@ function stepRequired(step: ServiceStep, operation: DataOperation): boolean {
192192
}
193193
}
194194
}
195+
196+
if (
197+
required &&
198+
step.conditional?.exists?.includes('extend') &&
199+
(!operation.extendDimensions || operation.extendDimensions.length === 0) &&
200+
step.conditional?.exists.includes('concatenate')
201+
) {
202+
// Special temporary case which can occur if extend=false is specified and the step is
203+
// configured to run if either extend or concatenate is provided. Once EDSC is updated to be
204+
// able to provide the extend parameter and not use concatenate as a proxy we can remove
205+
// this case.
206+
required = false;
207+
}
195208
return required;
196209
}
197210

services/harmony/test/middleware/extend.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import HarmonyRequest from '../../app/models/harmony-request';
44
import DataOperation from '../../app/models/data-operation';
55
import { setExtendDimensionsDefault } from '../../app/middleware/extend';
66

7-
describe('extend serivce default value', function () {
7+
describe('extend service default value', function () {
88
beforeEach(function () {
99
const collectionId = 'C123-TEST';
1010
const shortName = 'harmony_example';
@@ -56,6 +56,17 @@ describe('extend serivce default value', function () {
5656
});
5757
});
5858

59+
describe('and the request specifies concatenation to be true, but specifies extend to be false', function () {
60+
beforeEach(function () {
61+
this.req.operation.shouldConcatenate = true;
62+
this.req.query = { extend: 'false' };
63+
});
64+
it('does not set extendDimensions', function () {
65+
setExtendDimensionsDefault(this.req);
66+
expect(this.req.operation.extendDimensions).to.equal(undefined);
67+
});
68+
});
69+
5970
describe('and the request provides dimension extension', function () {
6071
beforeEach(function () {
6172
this.req.operation.extendDimensions = ['lat', 'lon'];
@@ -79,7 +90,7 @@ describe('extend serivce default value', function () {
7990
});
8091
});
8192

82-
describe('extend serivce misconfigured without default value', function () {
93+
describe('extend service misconfigured without default value', function () {
8394
beforeEach(function () {
8495
const collectionId = 'C123-TEST';
8596
const shortName = 'harmony_example';

0 commit comments

Comments
 (0)