Skip to content

Commit ab9ada7

Browse files
authored
Release v1.34.1 (#873)
* Ensure deleted failed steps are filtered when retrieving test execution steps. * Add automatic retries for 502s from M365 Excel * Remove unused tiles queue interval environment variable
2 parents ab8e223 + dbed208 commit ab9ada7

File tree

8 files changed

+48
-45
lines changed

8 files changed

+48
-45
lines changed

ecs/env.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@
221221
{
222222
"name": "ADMIN_JWT_SECRET_KEY",
223223
"valueFrom": "plumber-<ENVIRONMENT>-admin-jwt-secret-key"
224-
},
225-
{
226-
"name": "TILES_INTERVAL_BETWEEN_FIND_SINGLE_ROW_MS",
227-
"valueFrom": "plumber-<ENVIRONMENT>-tiles-interval-between-find-single-row-ms"
228224
}
229225
]
230226
}

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@
105105
"tsconfig-paths": "^4.2.0",
106106
"type-fest": "4.10.3"
107107
},
108-
"version": "1.34.0"
108+
"version": "1.34.1"
109109
}

packages/backend/src/apps/m365-excel/__tests__/common/interceptors.error-handlers.test.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,26 @@ describe('M365 request error handlers', () => {
9797
vi.restoreAllMocks()
9898
})
9999

100-
it('logs a warning and throws a RetriableError with default step delay on 503, if response does not have retry-after', async () => {
101-
mockAxiosAdapterToThrowOnce(503)
102-
await http
103-
.get('/test-url')
104-
.then(() => {
105-
expect.unreachable()
106-
})
107-
.catch((error): void => {
108-
expect(error).toBeInstanceOf(RetriableError)
109-
expect(error.delayType).toEqual('step')
110-
expect(error.delayInMs).toEqual(DEFAULT_DELAY_MS)
111-
})
112-
expect(mocks.logWarning).toHaveBeenCalledWith(
113-
expect.stringContaining('HTTP 503'),
114-
expect.objectContaining({ event: 'm365-http-503' }),
115-
)
116-
})
100+
it.each([500, 502, 503])(
101+
'logs a warning and throws a RetriableError with default step delay on %s',
102+
async (status) => {
103+
mockAxiosAdapterToThrowOnce(status)
104+
await http
105+
.get('/test-url')
106+
.then(() => {
107+
expect.unreachable()
108+
})
109+
.catch((error): void => {
110+
expect(error).toBeInstanceOf(RetriableError)
111+
expect(error.delayType).toEqual('step')
112+
expect(error.delayInMs).toEqual(DEFAULT_DELAY_MS)
113+
})
114+
expect(mocks.logWarning).toHaveBeenCalledWith(
115+
expect.stringContaining(`HTTP ${status}`),
116+
expect.objectContaining({ event: `m365-http-${status}` }),
117+
)
118+
},
119+
)
117120

118121
it('logs a warning and throws a RetriableError with step delay set to retry-after, on receiving 503', async () => {
119122
mockAxiosAdapterToThrowOnce(503, { 'retry-after': 123 })

packages/backend/src/apps/m365-excel/common/interceptors/request-error-handler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const handle429: ThrowingHandler = ($, error) => {
5959
//
6060
// Retry failures due to flakey M365 servers
6161
//
62-
const handle500and503: ThrowingHandler = function ($, error) {
62+
const handle500and502and503: ThrowingHandler = function ($, error) {
6363
// Log to monitor spikes, just in case
6464
const status = error.response.status
6565
logger.warn(`Received HTTP ${status} from MS Graph`, {
@@ -115,8 +115,9 @@ const errorHandler: IApp['requestErrorHandler'] = async function ($, error) {
115115
case 429: // Rate limited
116116
return handle429($, error)
117117
case 500:
118+
case 502: // Bad gateway
118119
case 503: // Transient error
119-
return handle500and503($, error)
120+
return handle500and502and503($, error)
120121
case 509: // Bandwidth limit reached
121122
return handle509($, error)
122123
}

packages/backend/src/helpers/get-test-execution-steps.ts

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function getTestExecutionSteps(
2929
/**
3030
* NOTE: filters out test execution steps for steps that have been deleted
3131
*/
32-
testExecutionSteps
32+
const filteredTestExecutionSteps = testExecutionSteps
3333
.filter((e) => e.step)
3434
.sort((a, b) => a.step.position - b.step.position)
3535

@@ -38,22 +38,25 @@ export async function getTestExecutionSteps(
3838
* If more than 1 exists, we return the latest one sorted by createdAt
3939
*/
4040
const stepIds = new Set<string>()
41-
const dedupedTestExecutionSteps = testExecutionSteps.reduce((acc, curr) => {
42-
if (stepIds.has(curr.stepId)) {
43-
const otherExecutionStep = acc[acc.length - 1]
44-
// possible bug in single step testing !! this should not happen
45-
console.warn(
46-
`Bug: More than 1 execution step found for step ${curr.stepId}`,
47-
)
48-
if (curr.createdAt > otherExecutionStep.createdAt) {
49-
acc[acc.length - 1] = curr
41+
const dedupedTestExecutionSteps = filteredTestExecutionSteps.reduce(
42+
(acc, curr) => {
43+
if (stepIds.has(curr.stepId)) {
44+
const otherExecutionStep = acc[acc.length - 1]
45+
// possible bug in single step testing !! this should not happen
46+
console.warn(
47+
`Bug: More than 1 execution step found for step ${curr.stepId}`,
48+
)
49+
if (curr.createdAt > otherExecutionStep.createdAt) {
50+
acc[acc.length - 1] = curr
51+
}
52+
} else {
53+
stepIds.add(curr.stepId)
54+
acc.push(curr)
5055
}
51-
} else {
52-
stepIds.add(curr.stepId)
53-
acc.push(curr)
54-
}
55-
return acc
56-
}, [] as ExecutionStep[])
56+
return acc
57+
},
58+
[] as ExecutionStep[],
59+
)
5760

5861
return dedupedTestExecutionSteps
5962
}

packages/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frontend",
3-
"version": "1.34.0",
3+
"version": "1.34.1",
44
"scripts": {
55
"dev": "wait-on tcp:3000 && vite --host --force",
66
"build": "tsc && vite build --mode=${VITE_MODE:-prod}",

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"name": "@plumber/types",
33
"description": "Shared types for plumber",
44
"types": "./index.d.ts",
5-
"version": "1.34.0"
5+
"version": "1.34.1"
66
}

0 commit comments

Comments
 (0)