Skip to content

Commit

Permalink
Release v1.38 (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexivanov committed Apr 26, 2024
2 parents 8daf2df + 6143b7d commit dbbdc4e
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 206 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ inputs:
test-suite-id:
description: Used to differentiate between different Meticulous test suites if you run this action multiple times as part of a single workflow.
required: false
additional-ports:
description: Ports the client needs to access the application in addition to the one in the app URL, as a list of comma-separated values
required: false

outputs: {}
runs:
Expand All @@ -76,6 +79,7 @@ runs:
ALLOWED_ENVIRONMENTS: ${{ inputs.allowed-environments }}
TEST_SUITE_ID: ${{ inputs.test-suite-id }}
METICULOUS_TELEMETRY_SAMPLE_RATE: "0.01"
ADDITIONAL_PORTS: ${{ inputs.additional-ports }}
branding:
color: purple
icon: camera
42 changes: 21 additions & 21 deletions out/cloud-compute.entrypoint.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@alwaysmeticulous/client": "^2.122.0",
"@alwaysmeticulous/common": "^2.122.0",
"@alwaysmeticulous/remote-replay-launcher": "^2.123.0",
"@alwaysmeticulous/client": "^2.125.0",
"@alwaysmeticulous/common": "^2.125.0",
"@alwaysmeticulous/remote-replay-launcher": "^2.125.0",
"//": "Upgrading `replay-orchestrator-launcher`? Consider bumping the environment version `LOGICAL_ENVIRONMENT_VERSION` in `constants.ts` if the new version includes visible changes.",
"@alwaysmeticulous/replay-orchestrator-launcher": "^2.122.1",
"@alwaysmeticulous/sentry": "^2.121.0",
"@alwaysmeticulous/replay-orchestrator-launcher": "^2.125.0",
"@alwaysmeticulous/sentry": "^2.125.0",
"@sentry/node": "^7.107.0",
"lodash.debounce": "^4.0.8",
"loglevel": "^1.8.1",
"luxon": "^3.4.3",
"retry": "^0.13.1"
},
"devDependencies": {
"@alwaysmeticulous/api": "^2.122.0",
"@alwaysmeticulous/sdk-bundles-api": "^2.122.0",
"@alwaysmeticulous/api": "^2.124.0",
"@alwaysmeticulous/sdk-bundles-api": "^2.125.0",
"@parcel/packager-ts": "^2.12.0",
"@parcel/transformer-typescript-types": "^2.12.0",
"@types/jest": "^27.0.3",
Expand All @@ -63,7 +63,7 @@
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.56.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"jest": "^27.4.5",
"parcel": "^2.12.0",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/cloud-compute/cloud-compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const runMeticulousTestsCloudComputeAction = async (): Promise<void> => {
basicAuthPassword: string;
}) => {
logger.info(
`Secure tunnel to ${appUrl} created: ${url}, user: ${basicAuthUser}, password: ${basicAuthPassword}`
`Secure tunnel to ${appUrl} created: ${url} user: ${basicAuthUser} password: ${basicAuthPassword}`
);

if (isDebugPRRun) {
Expand Down
2 changes: 2 additions & 0 deletions src/actions/main/__tests__/get-inputs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const keys = [
"METICULOUS_TELEMETRY_SAMPLE_RATE",
"USE_DEPLOYMENT_URL",
"ALLOWED_ENVIRONMENTS",
"ADDITIONAL_PORTS",
];

const EXPECTED_DEFAULT_VALUES = {
Expand All @@ -28,6 +29,7 @@ const EXPECTED_DEFAULT_VALUES = {
parallelTasks: null,
testsFile: null,
testSuiteId: null,
additionalPorts: null,
};

describe("getMainActionInputs", () => {
Expand Down
6 changes: 6 additions & 0 deletions src/actions/main/get-inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export const getMainActionInputs = () => {
required: false,
type: "string-array",
});
const additionalPorts = getInputFromEnv({
name: "additional-ports",
required: false,
type: "string",
});

if (appUrl != null && appUrl != "" && useDeploymentUrl === true) {
throw new Error("Cannot use both app-url and use-deployment-url");
Expand Down Expand Up @@ -93,5 +98,6 @@ export const getMainActionInputs = () => {
useDeploymentUrl,
testSuiteId,
allowedEnvironments,
additionalPorts,
};
};
8 changes: 7 additions & 1 deletion src/actions/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const runMeticulousTestsAction = async (): Promise<void> => {
useDeploymentUrl,
allowedEnvironments,
testSuiteId,
additionalPorts,
} = getMainActionInputs();
const { payload } = context;
const event = getCodeChangeEvent(context.eventName, payload);
Expand Down Expand Up @@ -150,7 +151,12 @@ export const runMeticulousTestsAction = async (): Promise<void> => {
: appUrl;

if (urlToTestAgainst != null) {
spinUpProxyIfNeeded(urlToTestAgainst, appUrlAliasedToLocalhost, logger);
spinUpProxyIfNeeded(
urlToTestAgainst,
additionalPorts,
appUrlAliasedToLocalhost,
logger
);
await throwIfCannotConnectToOrigin(urlToTestAgainst);
}

Expand Down
27 changes: 20 additions & 7 deletions src/actions/main/utils/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,30 @@ export const DOCKER_BRIDGE_NETWORK_GATEWAY = "172.17.0.1";
// allowing auth to go ahead with HTTPS).
export const spinUpProxyIfNeeded = (
appUrl: string,
additionalPorts: string | null,
appUrlAliasedToLocalhost: boolean,
logger: Logger
): void => {
try {
const url = new URL(appUrl);
const ports = additionalPorts?.split(",") ?? [];
if (
appUrlAliasedToLocalhost ||
url.hostname === "localhost" ||
url.hostname === "127.0.0.1"
) {
const defaultPortForProtocol = url.protocol === "https:" ? 443 : 80;
const defaultPortForProtocol = url.protocol === "https:" ? "443" : "80";
const port = url.port || defaultPortForProtocol;
const nginxConfig = `
events {}
http {
if (!ports.includes(port)) {
ports.push(port);
}
}
if (ports.length > 0) {
const nginxConfig =
"events {}\nhttp {\n" +
ports
.map(
(port) => `
server {
listen ${port};
server_name ${
Expand All @@ -35,13 +44,17 @@ export const spinUpProxyIfNeeded = (
proxy_pass http://${DOCKER_BRIDGE_NETWORK_GATEWAY}:${port};
}
}
}
`;
`
)
.join("\n") +
"}\n";
mkdirSync("/etc/nginx", { recursive: true });
writeFileSync("/etc/nginx/nginx.conf", nginxConfig);
execSync("service nginx restart");
logger.info(
`Successfully set up a proxy to host machine on port ${port}`
`Successfully set up a proxy to host machine on port(s): ${ports.join(
","
)}`
);
}
} catch (error) {
Expand Down
43 changes: 24 additions & 19 deletions tests/react-bmi-calculator/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2849,21 +2849,21 @@ bluebird@^3.5.5:
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==

body-parser@1.20.1:
version "1.20.1"
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668"
integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==
body-parser@1.20.2:
version "1.20.2"
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd"
integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==
dependencies:
bytes "3.1.2"
content-type "~1.0.4"
content-type "~1.0.5"
debug "2.6.9"
depd "2.0.0"
destroy "1.2.0"
http-errors "2.0.0"
iconv-lite "0.4.24"
on-finished "2.4.1"
qs "6.11.0"
raw-body "2.5.1"
raw-body "2.5.2"
type-is "~1.6.18"
unpipe "1.0.0"

Expand Down Expand Up @@ -3295,6 +3295,11 @@ content-type@~1.0.4:
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==

content-type@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918"
integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==

convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f"
Expand All @@ -3305,10 +3310,10 @@ cookie-signature@1.0.6:
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==

cookie@0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b"
integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==
cookie@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"
integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==

core-js-compat@^3.25.1:
version "3.26.1"
Expand Down Expand Up @@ -4302,16 +4307,16 @@ expect@^27.5.1:
jest-message-util "^27.5.1"

express@^4.17.3:
version "4.18.2"
resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59"
integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==
version "4.19.2"
resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465"
integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==
dependencies:
accepts "~1.3.8"
array-flatten "1.1.1"
body-parser "1.20.1"
body-parser "1.20.2"
content-disposition "0.5.4"
content-type "~1.0.4"
cookie "0.5.0"
cookie "0.6.0"
cookie-signature "1.0.6"
debug "2.6.9"
depd "2.0.0"
Expand Down Expand Up @@ -7333,10 +7338,10 @@ range-parser@^1.2.1, range-parser@~1.2.1:
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==

raw-body@2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857"
integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==
raw-body@2.5.2:
version "2.5.2"
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a"
integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==
dependencies:
bytes "3.1.2"
http-errors "2.0.0"
Expand Down
Loading

0 comments on commit dbbdc4e

Please sign in to comment.