Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into feat/conditionalIntlPolyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
code-forger committed Mar 26, 2024
2 parents ca24808 + 8e543f4 commit a5a231b
Show file tree
Hide file tree
Showing 223 changed files with 12,610 additions and 16,053 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ one*.tgz
lib
.webpack-stats*
.build-meta.json
.build-cache
.build-stats
bundle.integrity.manifest.json
*.md
test-setup.js
Expand Down
33 changes: 31 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
{
"root": true,
"extends": "amex",
"plugins": ["es"],
"plugins": [
"es"
],
"parserOptions": {
"babelOptions": {
"presets": [
"@babel/preset-react"
]
}
},
"rules": {
"unicorn/prefer-node-protocol": "error",
"eslint-comments/require-description": [
"error",
{
"ignore": [
"eslint-enable"
]
}
],
"default-param-last": 0
},
"overrides": [
{
"files": [
"__performance__/**"
],
"globals": {
"__ENV": true
}
},
{
"files": [
"**/__mocks__/**"
Expand Down Expand Up @@ -39,4 +68,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
${{ runner.os }}-node-
- name: npm install
run: NODE_ENV=development npm ci
env:
HUSKY: 0
- name: npm unit test
run: npm run test:unit
- name: npm lint test
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/on-pr_dangerJS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
${{ runner.os }}-node-
- name: npm install
run: NODE_ENV=development npm ci
env:
HUSKY: 0
- name: Danger
run: NODE_ENV=production npm run test:danger
env:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/on-pr_one-app-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ jobs:
node-version-file: .nvmrc
- name: npm install
run: NODE_ENV=development npm ci
env:
HUSKY: 0
- name: Build docker image
run: docker build -t one-app:at-test . --build-arg USER=root --build-arg VERSION=$(cat .nvmrc)
- name: Run Integration Tests
run: ONE_DANGEROUSLY_SKIP_ONE_APP_IMAGE_BUILD=true npm run test:integration
- name: Archive log & trace files
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: logs-and-traces
path: prod-sample/otel-collector/tmp/*.jsonl
overwrite: true
retention-days: 5
2 changes: 2 additions & 0 deletions .github/workflows/release-step-1_manual_create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
npm run release
git add .
git commit -m "docs(changelog): update"
env:
HUSKY: 0
- name: Create release pull request
uses: peter-evans/create-pull-request@v6
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test-results

# sample prod setup
prod-sample/nginx/origin-statics
prod-sample/*/tmp
*.pem
*.crt
*.key
Expand All @@ -36,3 +37,5 @@ docker-compose.test.yml
# misc
.DS_Store
.idea
.vscode
.env
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx commitlint --edit $1
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test:lint && npm run test:unit && npm run test:lockfile
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.1
18.17.1
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ARG VERSION=20
ARG VERSION=lts
# Use the pre-baked fat node image only in the builder
# which includes build utils preinstalled (e.g. gcc, make, etc).
# This will result in faster and reliable One App docker image
# builds as we do not have to run apk installs for alpine.
FROM node:$VERSION as builder
WORKDIR /opt/build
RUN npm install -g npm@10.2.3 --registry=https://registry.npmjs.org
RUN npm install -g npm@9.6.7 --registry=https://registry.npmjs.org
COPY --chown=node:node ./ /opt/build
# npm ci does not run postinstall with root account
RUN NODE_ENV=development npm ci --build-from-source
Expand All @@ -22,6 +22,7 @@ RUN NODE_ENV=production npm run build && \
chown node:node /opt/one-app/production && \
mv /opt/build/LICENSE.txt /opt/one-app/production && \
mv /opt/build/node_modules /opt/one-app/production && \
mv /opt/build/scripts /opt/one-app/production && \
mv /opt/build/package.json /opt/one-app/production && \
mv /opt/build/lib /opt/one-app/production && \
mv /opt/build/build /opt/one-app/production && \
Expand All @@ -43,7 +44,7 @@ EXPOSE 3005
WORKDIR /opt/one-app
RUN chown node:node /opt/one-app
USER $USER
CMD ["node", "lib/server"]
CMD ["scripts/start.sh"]
COPY --from=builder --chown=node:node /opt/one-app/development ./

# production image
Expand All @@ -58,5 +59,5 @@ EXPOSE 3000
EXPOSE 3005
WORKDIR /opt/one-app
USER $USER
CMD ["node", "--dns-result-order=ipv4first", "--no-experimental-fetch", "lib/server"]
CMD ["scripts/start.sh"]
COPY --from=builder --chown=node:node /opt/one-app/production ./
33 changes: 0 additions & 33 deletions __mocks__/http.js

This file was deleted.

33 changes: 0 additions & 33 deletions __mocks__/https.js

This file was deleted.

40 changes: 0 additions & 40 deletions __mocks__/node-fetch.js

This file was deleted.

6 changes: 3 additions & 3 deletions __performance__/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:

# receives one-app internals metrics
prometheus:
image: prom/prometheus:v2.49.1
image: prom/prometheus:v2.50.1
networks:
- one-app-performance
volumes:
Expand All @@ -26,7 +26,7 @@ services:

# graphing of metrics
grafana:
image: grafana/grafana:10.0.10
image: grafana/grafana:10.0.12
networks:
- one-app-performance
ports:
Expand All @@ -43,7 +43,7 @@ services:

# runs performance scripts
k6:
image: grafana/k6:0.48.0
image: grafana/k6:0.49.0
networks:
- one-app-performance
ports:
Expand Down
4 changes: 2 additions & 2 deletions __performance__/scripts/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* permissions and limitations under the License.
*/

/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-unresolved -- performance scripts are not ran directly */
import http from 'k6/http';
import { check, sleep } from 'k6';
/* eslint-enable import/no-unresolved */

export const options = {
stages: [
Expand All @@ -30,7 +31,6 @@ export const options = {
},
};

// eslint-disable-next-line no-undef
const { TARGET_URL } = __ENV;

export default function virtualUser() {
Expand Down
5 changes: 2 additions & 3 deletions __performance__/scripts/smoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* permissions and limitations under the License.
*/

/* eslint-disable import/no-anonymous-default-export */
/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-unresolved -- performance scripts are not ran directly */
import http from 'k6/http';
import { check, sleep } from 'k6';
/* eslint-enable import/no-unresolved */

// This is a simple smoke test to ensure there is no major regression
// to the one-app server.
Expand All @@ -32,7 +32,6 @@ export const options = {
},
};

// eslint-disable-next-line no-undef
const { TARGET_URL } = __ENV;

export default function virtualUser() {
Expand Down
4 changes: 2 additions & 2 deletions __performance__/scripts/soak.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* permissions and limitations under the License.
*/

/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-unresolved -- performance scripts are not ran directly */
import http from 'k6/http';
import { check, sleep } from 'k6';
/* eslint-enable import/no-unresolved */

export const options = {
stages: [
Expand All @@ -29,7 +30,6 @@ export const options = {
},
};

// eslint-disable-next-line no-undef
const { TARGET_URL } = __ENV;

export default function virtualUser() {
Expand Down
4 changes: 2 additions & 2 deletions __performance__/scripts/spike.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* permissions and limitations under the License.
*/

/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-unresolved -- performance scripts are not ran directly */
import http from 'k6/http';
import { check, sleep } from 'k6';
/* eslint-enable import/no-unresolved */

export const options = {
stages: [
Expand All @@ -33,7 +34,6 @@ export const options = {
},
};

// eslint-disable-next-line no-undef
const { TARGET_BASE_URL } = __ENV;

export default function virtualUser() {
Expand Down
Loading

0 comments on commit a5a231b

Please sign in to comment.