Skip to content

Commit

Permalink
chore: use node18 (#1771)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoArregui authored Apr 26, 2024
1 parent 273e475 commit 147f60e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 23 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Use Node.js 16.16.0
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 16.16.0
node-version: 18.x
cache: yarn
- name: install
run: yarn install --frozen-lockfile
Expand All @@ -53,15 +53,14 @@ jobs:
- name: test
run: yarn test:content


test-lambdas:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.16.0
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.16.0
node-version: 18.x
cache: yarn
- name: install
run: yarn install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine as base
FROM node:18-alpine as base
WORKDIR /app
RUN apk add --no-cache bash git

Expand Down
2 changes: 1 addition & 1 deletion content/src/Environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export class EnvironmentBuilder {
EnvironmentConfig.CONTENT_SERVER_ADDRESS,
() =>
process.env.CONTENT_SERVER_ADDRESS ||
'http://localhost:' + env.getConfig<number>(EnvironmentConfig.HTTP_SERVER_PORT).toString()
'http://127.0.0.1:' + env.getConfig<number>(EnvironmentConfig.HTTP_SERVER_PORT).toString()
)

this.registerConfigIfNotAlreadySet(
Expand Down
10 changes: 6 additions & 4 deletions content/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,15 @@ export async function initComponentsWithEnv(env: Environment): Promise<AppCompon
let started = false
const server = {
..._server,
start: async (options) => {
start: async (options: any) => {
started = true
return _server.start && _server.start(options)
if (_server.start) {
await _server.start(options)
}
},
stop: async () => {
if (started) {
return _server.stop && _server.stop()
if (started && _server.stop) {
return _server.stop()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ export const createRetryFailedDeployments = (
): IRetryFailedDeploymentsComponent => {
const retryDelay = components.env.getConfig<number>(EnvironmentConfig.RETRY_FAILED_DEPLOYMENTS_DELAY_TIME)
const logger = components.logs.getLogger('RetryFailedDeployments')
let ac: AbortController | undefined = new AbortController()
const signal = ac.signal

let running = false
return {
start: async () => {
Expand All @@ -38,15 +35,11 @@ export const createRetryFailedDeployments = (
},
stop: async () => {
running = false
if (ac) {
ac.abort()
}
ac = undefined
logger.debug('Stopping retry failed deployments')
},
schedule: async () => {
while (running) {
await setTimeout(retryDelay, null, { signal })
await setTimeout(retryDelay, null)
if (!running) {
return
}
Expand Down
8 changes: 6 additions & 2 deletions content/test/integration/E2ETestEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ export class ServerBuilder {
private readonly builder: EnvironmentBuilder
private readonly storageBaseFolder: string

constructor(private readonly testEnvCalls: TestEnvCalls, env: Environment, public dao: DAOComponent) {
constructor(
private readonly testEnvCalls: TestEnvCalls,
env: Environment,
public dao: DAOComponent
) {
this.builder = new EnvironmentBuilder(env)
this.storageBaseFolder = env.getConfig(EnvironmentConfig.STORAGE_ROOT_FOLDER) ?? 'storage'
}
Expand All @@ -175,7 +179,7 @@ export class ServerBuilder {
const servers: TestProgram[] = []
for (let i = 0; i < ports.length; i++) {
const port = ports[i]
const domain = `http://localhost:${port}`
const domain = `http://127.0.0.1:${port}`
this.testEnvCalls.addToDAO(domain)
const components = await this.builder
.withConfig(EnvironmentConfig.HTTP_SERVER_PORT, port)
Expand Down
2 changes: 1 addition & 1 deletion content/test/integration/TestProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class TestProgram {

getUrl(): string {
const port = this.components.env.getConfig(EnvironmentConfig.HTTP_SERVER_PORT)
return `http://localhost:${port}`
return `http://127.0.0.1:${port}`
}

async stopProgram(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion content/test/integration/simpleTestEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function createServer(
.withConfig(EnvironmentConfig.STORAGE_ROOT_FOLDER, `${storageBaseFolder}/${serverPort}`)
.buildConfigAndComponents()

const domain = `http://localhost:${serverPort}`
const domain = `http://127.0.0.1:${serverPort}`
dao.add(domain)
const server = new TestProgram(components)
server.components.daoClient = dao
Expand Down

0 comments on commit 147f60e

Please sign in to comment.