skuba 9.1.0 → 9.2.0-main-20250115035914
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli/adapter/prettier.js +4 -1
- package/lib/cli/adapter/prettier.js.map +2 -2
- package/lib/cli/configure/analysis/git.js +14 -1
- package/lib/cli/configure/analysis/git.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/prettier.js +4 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +2 -2
- package/lib/cli/lint/annotate/github/prettier.js +1 -1
- package/lib/cli/lint/annotate/github/prettier.js.map +2 -2
- package/lib/wrapper/http.js +12 -13
- package/lib/wrapper/http.js.map +3 -3
- package/package.json +11 -11
- package/template/express-rest-api/.buildkite/pipeline.yml +4 -4
- package/template/express-rest-api/Dockerfile.dev-deps +1 -1
- package/template/express-rest-api/gantry.build.yml +0 -3
- package/template/express-rest-api/package.json +3 -3
- package/template/greeter/.buildkite/pipeline.yml +3 -3
- package/template/greeter/Dockerfile +1 -1
- package/template/greeter/package.json +2 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +4 -4
- package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
- package/template/koa-rest-api/gantry.build.yml +0 -3
- package/template/koa-rest-api/package.json +6 -6
- package/template/koa-rest-api/src/framework/server.test.ts +0 -1
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +5 -5
- package/template/lambda-sqs-worker/Dockerfile +1 -1
- package/template/lambda-sqs-worker/package.json +2 -2
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +5 -5
- package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
- package/template/lambda-sqs-worker-cdk/README.md +4 -3
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +14 -2
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +5 -3
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +2 -0
- package/template/lambda-sqs-worker-cdk/package.json +6 -5
|
@@ -163,7 +163,10 @@ const runPrettier = async (mode, logger, cwd = process.cwd()) => {
|
|
|
163
163
|
if (result.errored.length) {
|
|
164
164
|
logger.plain(`Flagged ${(0, import_logging.pluralise)(result.errored.length, "file")}:`);
|
|
165
165
|
for (const { err, filepath } of result.errored) {
|
|
166
|
-
logger.warn(
|
|
166
|
+
logger.warn(
|
|
167
|
+
filepath,
|
|
168
|
+
...typeof err === "string" || err instanceof Error ? [String(err)] : []
|
|
169
|
+
);
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
172
|
return { ok: result.errored.length === 0, result };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/adapter/prettier.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport {\n type Options,\n type SupportLanguage,\n check,\n format,\n getSupportInfo,\n resolveConfig,\n} from 'prettier';\n\nimport { crawlDirectory } from '../../utils/dir';\nimport { type Logger, pluralise } from '../../utils/logging';\nimport { getConsumerManifest } from '../../utils/manifest';\nimport { formatPackage, parsePackage } from '../configure/processing/package';\n\nlet languages: SupportLanguage[] | undefined;\n\n/**\n * Infers a parser for the specified filepath.\n *\n * This is a cut-down version of Prettier's built-in function of the same name;\n * ours operates purely on the `filepath` string and does not perform file I/O.\n * Prettier's internal `getInterpreter` function can open a file to read the\n * shebang, and its file descriptor usage can throw warnings on worker threads:\n *\n * ```console\n * Warning: File descriptor 123 closed but not opened in unmanaged mode\n * at Object.closeSync (node:fs:530:11)\n * at Object.closeSync (node_modules/graceful-fs/graceful-fs.js:74:20)\n * ...\n * ```\n *\n * References:\n *\n * - https://github.com/prettier/prettier/blob/2.4.1/src/main/options.js#L167\n * - seek-oss/skuba#659\n */\nexport const inferParser = async (\n filepath: string,\n): Promise<string | undefined> => {\n const filename = path.basename(filepath).toLowerCase();\n\n languages ??= (await getSupportInfo()).languages;\n\n const firstLanguage = languages.find(\n (language) =>\n language.extensions?.some((extension) => filename.endsWith(extension)) ||\n language.filenames?.some((name) => name.toLowerCase() === filename),\n );\n\n return firstLanguage?.parsers[0];\n};\n\nconst isPackageJsonOk = async ({\n data,\n filepath,\n}: {\n data: string;\n filepath: string;\n}): Promise<boolean> => {\n if (path.basename(filepath) !== 'package.json') {\n return true;\n }\n\n try {\n const packageJson = parsePackage(data);\n\n return !packageJson || (await formatPackage(packageJson)) === data;\n } catch {\n // Be more lenient about our custom formatting and don't throw if it errors.\n }\n\n return true;\n};\n\ninterface File {\n data: string;\n options: Options;\n filepath: string;\n}\n\ninterface Result {\n count: number;\n errored: Array<{ err?: unknown; filepath: string }>;\n touched: string[];\n unparsed: string[];\n}\n\nexport const formatOrLintFile = async (\n { data, filepath, options }: File,\n mode: 'format' | 'lint',\n result: Result | null,\n): Promise<string | undefined> => {\n if (mode === 'lint') {\n let ok: boolean;\n try {\n ok =\n (await check(data, options)) &&\n (await isPackageJsonOk({ data, filepath }));\n } catch (err) {\n result?.errored.push({ err, filepath });\n return;\n }\n\n if (!ok) {\n result?.errored.push({ filepath });\n }\n\n return;\n }\n\n let formatted: string;\n try {\n formatted = await format(data, options);\n } catch (err) {\n result?.errored.push({ err, filepath });\n return;\n }\n\n // Perform additional formatting (i.e. sorting) on a `package.json` manifest.\n try {\n if (path.basename(filepath) === 'package.json') {\n const packageJson = parsePackage(formatted);\n if (packageJson) {\n formatted = await formatPackage(packageJson);\n }\n }\n } catch {\n // Be more lenient about our custom formatting and don't throw if it errors.\n }\n\n if (formatted === data) {\n return;\n }\n\n result?.touched.push(filepath);\n return formatted;\n};\n\nexport interface PrettierOutput {\n ok: boolean;\n result: Result;\n}\n\n/**\n * Formats/lints files with Prettier.\n *\n * Prettier doesn't provide a higher-level Node.js API that replicates the\n * behaviour of its CLI, so we have to plumb together its lower-level functions.\n * On the other hand, this affords more flexibility in how we track and report\n * on progress and results.\n */\nexport const runPrettier = async (\n mode: 'format' | 'lint',\n logger: Logger,\n cwd = process.cwd(),\n): Promise<PrettierOutput> => {\n logger.debug('Initialising Prettier...');\n\n const start = process.hrtime.bigint();\n\n const manifest = await getConsumerManifest(cwd);\n\n const directory = manifest ? path.dirname(manifest.path) : cwd;\n\n logger.debug(\n manifest ? 'Detected project root:' : 'Detected working directory:',\n directory,\n );\n\n logger.debug('Discovering files...');\n\n // Match Prettier's opinion of respecting `.gitignore`.\n // This avoids exhibiting different behaviour than a Prettier IDE integration,\n // though it may present headaches if `.gitignore` and `.prettierignore` rules\n // conflict.\n const relativeFilepaths = await crawlDirectory(directory, [\n '.gitignore',\n '.prettierignore',\n ]);\n\n logger.debug(`Discovered ${pluralise(relativeFilepaths.length, 'file')}.`);\n\n const result: Result = {\n count: relativeFilepaths.length,\n errored: [],\n touched: [],\n unparsed: [],\n };\n\n logger.debug(mode === 'format' ? 'Formatting' : 'Linting', 'files...');\n\n for (const relativeFilepath of relativeFilepaths) {\n // Use relative paths to keep log output cleaner, particularly in the common\n // case where we are executing against the current working directory.\n const filepath = path.relative(\n process.cwd(),\n path.join(directory, relativeFilepath),\n );\n\n // Infer parser upfront so we can skip unsupported files.\n const parser = await inferParser(filepath);\n\n logger.debug(filepath);\n logger.debug(' parser:', parser ?? '-');\n\n if (!parser) {\n result.unparsed.push(filepath);\n continue;\n }\n\n const [config, data] = await Promise.all([\n resolveConfig(filepath),\n fs.promises.readFile(filepath, 'utf-8'),\n ]);\n\n const file: File = {\n data,\n filepath,\n options: { ...config, filepath },\n };\n\n const formatted = await formatOrLintFile(file, mode, result);\n\n if (typeof formatted === 'string') {\n await fs.promises.writeFile(filepath, formatted);\n }\n }\n\n const end = process.hrtime.bigint();\n\n logger.plain(\n `Processed ${pluralise(\n result.count - result.unparsed.length,\n 'file',\n )} in ${logger.timing(start, end)}.`,\n );\n\n if (result.touched.length) {\n logger.plain(`Formatted ${pluralise(result.touched.length, 'file')}:`);\n for (const filepath of result.touched) {\n logger.warn(filepath);\n }\n }\n\n if (result.errored.length) {\n logger.plain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\n check,\n format,\n getSupportInfo,\n resolveConfig,\n} from 'prettier';\n\nimport { crawlDirectory } from '../../utils/dir';\nimport { type Logger, pluralise } from '../../utils/logging';\nimport { getConsumerManifest } from '../../utils/manifest';\nimport { formatPackage, parsePackage } from '../configure/processing/package';\n\nlet languages: SupportLanguage[] | undefined;\n\n/**\n * Infers a parser for the specified filepath.\n *\n * This is a cut-down version of Prettier's built-in function of the same name;\n * ours operates purely on the `filepath` string and does not perform file I/O.\n * Prettier's internal `getInterpreter` function can open a file to read the\n * shebang, and its file descriptor usage can throw warnings on worker threads:\n *\n * ```console\n * Warning: File descriptor 123 closed but not opened in unmanaged mode\n * at Object.closeSync (node:fs:530:11)\n * at Object.closeSync (node_modules/graceful-fs/graceful-fs.js:74:20)\n * ...\n * ```\n *\n * References:\n *\n * - https://github.com/prettier/prettier/blob/2.4.1/src/main/options.js#L167\n * - seek-oss/skuba#659\n */\nexport const inferParser = async (\n filepath: string,\n): Promise<string | undefined> => {\n const filename = path.basename(filepath).toLowerCase();\n\n languages ??= (await getSupportInfo()).languages;\n\n const firstLanguage = languages.find(\n (language) =>\n language.extensions?.some((extension) => filename.endsWith(extension)) ||\n language.filenames?.some((name) => name.toLowerCase() === filename),\n );\n\n return firstLanguage?.parsers[0];\n};\n\nconst isPackageJsonOk = async ({\n data,\n filepath,\n}: {\n data: string;\n filepath: string;\n}): Promise<boolean> => {\n if (path.basename(filepath) !== 'package.json') {\n return true;\n }\n\n try {\n const packageJson = parsePackage(data);\n\n return !packageJson || (await formatPackage(packageJson)) === data;\n } catch {\n // Be more lenient about our custom formatting and don't throw if it errors.\n }\n\n return true;\n};\n\ninterface File {\n data: string;\n options: Options;\n filepath: string;\n}\n\ninterface Result {\n count: number;\n errored: Array<{ err?: unknown; filepath: string }>;\n touched: string[];\n unparsed: string[];\n}\n\nexport const formatOrLintFile = async (\n { data, filepath, options }: File,\n mode: 'format' | 'lint',\n result: Result | null,\n): Promise<string | undefined> => {\n if (mode === 'lint') {\n let ok: boolean;\n try {\n ok =\n (await check(data, options)) &&\n (await isPackageJsonOk({ data, filepath }));\n } catch (err) {\n result?.errored.push({ err, filepath });\n return;\n }\n\n if (!ok) {\n result?.errored.push({ filepath });\n }\n\n return;\n }\n\n let formatted: string;\n try {\n formatted = await format(data, options);\n } catch (err) {\n result?.errored.push({ err, filepath });\n return;\n }\n\n // Perform additional formatting (i.e. sorting) on a `package.json` manifest.\n try {\n if (path.basename(filepath) === 'package.json') {\n const packageJson = parsePackage(formatted);\n if (packageJson) {\n formatted = await formatPackage(packageJson);\n }\n }\n } catch {\n // Be more lenient about our custom formatting and don't throw if it errors.\n }\n\n if (formatted === data) {\n return;\n }\n\n result?.touched.push(filepath);\n return formatted;\n};\n\nexport interface PrettierOutput {\n ok: boolean;\n result: Result;\n}\n\n/**\n * Formats/lints files with Prettier.\n *\n * Prettier doesn't provide a higher-level Node.js API that replicates the\n * behaviour of its CLI, so we have to plumb together its lower-level functions.\n * On the other hand, this affords more flexibility in how we track and report\n * on progress and results.\n */\nexport const runPrettier = async (\n mode: 'format' | 'lint',\n logger: Logger,\n cwd = process.cwd(),\n): Promise<PrettierOutput> => {\n logger.debug('Initialising Prettier...');\n\n const start = process.hrtime.bigint();\n\n const manifest = await getConsumerManifest(cwd);\n\n const directory = manifest ? path.dirname(manifest.path) : cwd;\n\n logger.debug(\n manifest ? 'Detected project root:' : 'Detected working directory:',\n directory,\n );\n\n logger.debug('Discovering files...');\n\n // Match Prettier's opinion of respecting `.gitignore`.\n // This avoids exhibiting different behaviour than a Prettier IDE integration,\n // though it may present headaches if `.gitignore` and `.prettierignore` rules\n // conflict.\n const relativeFilepaths = await crawlDirectory(directory, [\n '.gitignore',\n '.prettierignore',\n ]);\n\n logger.debug(`Discovered ${pluralise(relativeFilepaths.length, 'file')}.`);\n\n const result: Result = {\n count: relativeFilepaths.length,\n errored: [],\n touched: [],\n unparsed: [],\n };\n\n logger.debug(mode === 'format' ? 'Formatting' : 'Linting', 'files...');\n\n for (const relativeFilepath of relativeFilepaths) {\n // Use relative paths to keep log output cleaner, particularly in the common\n // case where we are executing against the current working directory.\n const filepath = path.relative(\n process.cwd(),\n path.join(directory, relativeFilepath),\n );\n\n // Infer parser upfront so we can skip unsupported files.\n const parser = await inferParser(filepath);\n\n logger.debug(filepath);\n logger.debug(' parser:', parser ?? '-');\n\n if (!parser) {\n result.unparsed.push(filepath);\n continue;\n }\n\n const [config, data] = await Promise.all([\n resolveConfig(filepath),\n fs.promises.readFile(filepath, 'utf-8'),\n ]);\n\n const file: File = {\n data,\n filepath,\n options: { ...config, filepath },\n };\n\n const formatted = await formatOrLintFile(file, mode, result);\n\n if (typeof formatted === 'string') {\n await fs.promises.writeFile(filepath, formatted);\n }\n }\n\n const end = process.hrtime.bigint();\n\n logger.plain(\n `Processed ${pluralise(\n result.count - result.unparsed.length,\n 'file',\n )} in ${logger.timing(start, end)}.`,\n );\n\n if (result.touched.length) {\n logger.plain(`Formatted ${pluralise(result.touched.length, 'file')}:`);\n for (const filepath of result.touched) {\n logger.warn(filepath);\n }\n }\n\n if (result.errored.length) {\n logger.plain(`Flagged ${pluralise(result.errored.length, 'file')}:`);\n for (const { err, filepath } of result.errored) {\n logger.warn(\n filepath,\n ...(typeof err === 'string' || err instanceof Error\n ? [String(err)]\n : []),\n );\n }\n }\n\n return { ok: result.errored.length === 0, result };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,sBAOO;AAEP,iBAA+B;AAC/B,qBAAuC;AACvC,sBAAoC;AACpC,qBAA4C;AAE5C,IAAI;AAsBG,MAAM,cAAc,OACzB,aACgC;AAChC,QAAM,WAAW,YAAAA,QAAK,SAAS,QAAQ,EAAE,YAAY;AAErD,iBAAe,UAAM,gCAAe,GAAG;AAEvC,QAAM,gBAAgB,UAAU;AAAA,IAC9B,CAAC,aACC,SAAS,YAAY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,IACjC;AAEA,UAAM,YAAY,MAAM,iBAAiB,MAAM,MAAM,MAAM;AAE3D,QAAI,OAAO,cAAc,UAAU;AACjC,YAAM,gBAAAA,QAAG,SAAS,UAAU,UAAU,SAAS;AAAA,IACjD;AAAA,EACF;AAEA,QAAM,MAAM,QAAQ,OAAO,OAAO;AAElC,SAAO;AAAA,IACL,iBAAa;AAAA,MACX,OAAO,QAAQ,OAAO,SAAS;AAAA,MAC/B;AAAA,IACF,CAAC,OAAO,OAAO,OAAO,OAAO,GAAG,CAAC;AAAA,EACnC;AAEA,MAAI,OAAO,QAAQ,QAAQ;AACzB,WAAO,MAAM,iBAAa,0BAAU,OAAO,QAAQ,QAAQ,MAAM,CAAC,GAAG;AACrE,eAAW,YAAY,OAAO,SAAS;AACrC,aAAO,KAAK,QAAQ;AAAA,IACtB;AAAA,EACF;AAEA,MAAI,OAAO,QAAQ,QAAQ;AACzB,WAAO,MAAM,eAAW,0BAAU,OAAO,QAAQ,QAAQ,MAAM,CAAC,GAAG;AACnE,eAAW,EAAE,KAAK,SAAS,KAAK,OAAO,SAAS;AAC9C,aAAO;AAAA,QACL;AAAA,QACA,GAAI,OAAO,QAAQ,YAAY,eAAe,QAC1C,CAAC,OAAO,GAAG,CAAC,IACZ,CAAC;AAAA,MACP;AAAA,IACF;AAAA,EACF;AAEA,SAAO,EAAE,IAAI,OAAO,QAAQ,WAAW,GAAG,OAAO;AACnD;",
|
|
6
6
|
"names": ["path", "fs"]
|
|
7
7
|
}
|
|
@@ -37,14 +37,27 @@ var import_dir = require("../../../utils/dir");
|
|
|
37
37
|
var import_logging = require("../../../utils/logging");
|
|
38
38
|
const auditWorkingTree = async (dir) => {
|
|
39
39
|
const filepaths = await (0, import_dir.crawlDirectory)(dir);
|
|
40
|
+
let anyFailed = false;
|
|
40
41
|
const statuses = await Promise.all(
|
|
41
|
-
filepaths.map((filepath) =>
|
|
42
|
+
filepaths.map(async (filepath) => {
|
|
43
|
+
try {
|
|
44
|
+
return await import_isomorphic_git.default.status({ dir, fs: import_fs_extra.default, filepath });
|
|
45
|
+
} catch {
|
|
46
|
+
anyFailed = true;
|
|
47
|
+
return "absent";
|
|
48
|
+
}
|
|
49
|
+
})
|
|
42
50
|
);
|
|
43
51
|
if (statuses.some(
|
|
44
52
|
(status) => status !== "absent" && status !== "ignored" && status !== "unmodified"
|
|
45
53
|
)) {
|
|
46
54
|
import_logging.log.newline();
|
|
47
55
|
import_logging.log.warn("You have dirty/untracked files that may be overwritten.");
|
|
56
|
+
} else if (anyFailed) {
|
|
57
|
+
import_logging.log.newline();
|
|
58
|
+
import_logging.log.warn(
|
|
59
|
+
"Some files failed to be read. Check that you don't have any dirty/untracked files that may be overwritten."
|
|
60
|
+
);
|
|
48
61
|
}
|
|
49
62
|
};
|
|
50
63
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/analysis/git.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { crawlDirectory } from '../../../utils/dir';\nimport { log } from '../../../utils/logging';\n\nexport const auditWorkingTree = async (dir: string) => {\n const filepaths = await crawlDirectory(dir);\n\n const statuses = await Promise.all(\n filepaths.map((filepath) => git.status({ dir, fs, filepath })),\n );\n\n if (\n statuses.some(\n (status) =>\n status !== 'absent' && status !== 'ignored' && status !== 'unmodified',\n )\n ) {\n log.newline();\n log.warn('You have dirty/untracked files that may be overwritten.');\n }\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAEhB,iBAA+B;AAC/B,qBAAoB;AAEb,MAAM,mBAAmB,OAAO,QAAgB;AACrD,QAAM,YAAY,UAAM,2BAAe,GAAG;AAE1C,QAAM,WAAW,MAAM,QAAQ;AAAA,IAC7B,UAAU,IAAI,
|
|
4
|
+
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { crawlDirectory } from '../../../utils/dir';\nimport { log } from '../../../utils/logging';\n\nexport const auditWorkingTree = async (dir: string) => {\n const filepaths = await crawlDirectory(dir);\n\n let anyFailed = false;\n\n const statuses = await Promise.all(\n filepaths.map(async (filepath) => {\n try {\n return await git.status({ dir, fs, filepath });\n } catch {\n // TODO: Why does isomorphic-git sometimes just _fail_?\n anyFailed = true;\n return 'absent';\n }\n }),\n );\n\n if (\n statuses.some(\n (status) =>\n status !== 'absent' && status !== 'ignored' && status !== 'unmodified',\n )\n ) {\n log.newline();\n log.warn('You have dirty/untracked files that may be overwritten.');\n } else if (anyFailed) {\n log.newline();\n log.warn(\n \"Some files failed to be read. Check that you don't have any dirty/untracked files that may be overwritten.\",\n );\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAEhB,iBAA+B;AAC/B,qBAAoB;AAEb,MAAM,mBAAmB,OAAO,QAAgB;AACrD,QAAM,YAAY,UAAM,2BAAe,GAAG;AAE1C,MAAI,YAAY;AAEhB,QAAM,WAAW,MAAM,QAAQ;AAAA,IAC7B,UAAU,IAAI,OAAO,aAAa;AAChC,UAAI;AACF,eAAO,MAAM,sBAAAA,QAAI,OAAO,EAAE,KAAK,oBAAAC,SAAI,SAAS,CAAC;AAAA,MAC/C,QAAQ;AAEN,oBAAY;AACZ,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH;AAEA,MACE,SAAS;AAAA,IACP,CAAC,WACC,WAAW,YAAY,WAAW,aAAa,WAAW;AAAA,EAC9D,GACA;AACA,uBAAI,QAAQ;AACZ,uBAAI,KAAK,yDAAyD;AAAA,EACpE,WAAW,WAAW;AACpB,uBAAI,QAAQ;AACZ,uBAAI;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["git", "fs"]
|
|
7
7
|
}
|
|
@@ -36,7 +36,10 @@ const createPrettierAnnotations = (prettier) => !prettier.ok ? [
|
|
|
36
36
|
"**Prettier**",
|
|
37
37
|
Buildkite.md.terminal(
|
|
38
38
|
prettier.result.errored.map(
|
|
39
|
-
({ err, filepath }) => [
|
|
39
|
+
({ err, filepath }) => [
|
|
40
|
+
filepath,
|
|
41
|
+
...typeof err === "string" || err instanceof Error ? [String(err)] : []
|
|
42
|
+
].join(" ")
|
|
40
43
|
).join("\n")
|
|
41
44
|
)
|
|
42
45
|
] : [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/cli/lint/annotate/buildkite/prettier.ts"],
|
|
4
|
-
"sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { PrettierOutput } from '../../../adapter/prettier';\n\nexport const createPrettierAnnotations = (\n prettier: PrettierOutput,\n): string[] =>\n !prettier.ok\n ? [\n '**Prettier**',\n Buildkite.md.terminal(\n prettier.result.errored\n .map(({ err, filepath }) =>\n [filepath
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,4BAA4B,CACvC,aAEA,CAAC,SAAS,KACN;AAAA,EACE;AAAA,EACA,UAAU,GAAG;AAAA,IACX,SAAS,OAAO,QACb;AAAA,MAAI,CAAC,EAAE,KAAK,SAAS,MACpB,
|
|
4
|
+
"sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { PrettierOutput } from '../../../adapter/prettier';\n\nexport const createPrettierAnnotations = (\n prettier: PrettierOutput,\n): string[] =>\n !prettier.ok\n ? [\n '**Prettier**',\n Buildkite.md.terminal(\n prettier.result.errored\n .map(({ err, filepath }) =>\n [\n filepath,\n ...(typeof err === 'string' || err instanceof Error\n ? [String(err)]\n : []),\n ].join(' '),\n )\n .join('\\n'),\n ),\n ]\n : [];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,4BAA4B,CACvC,aAEA,CAAC,SAAS,KACN;AAAA,EACE;AAAA,EACA,UAAU,GAAG;AAAA,IACX,SAAS,OAAO,QACb;AAAA,MAAI,CAAC,EAAE,KAAK,SAAS,MACpB;AAAA,QACE;AAAA,QACA,GAAI,OAAO,QAAQ,YAAY,eAAe,QAC1C,CAAC,OAAO,GAAG,CAAC,IACZ,CAAC;AAAA,MACP,EAAE,KAAK,GAAG;AAAA,IACZ,EACC,KAAK,IAAI;AAAA,EACd;AACF,IACA,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,7 +28,7 @@ const createPrettierAnnotations = (prettier) => prettier.result.errored.map((res
|
|
|
28
28
|
start_line: 1,
|
|
29
29
|
end_line: 1,
|
|
30
30
|
path: result.filepath,
|
|
31
|
-
message: message ? String(message) : "This file has not been formatted.",
|
|
31
|
+
message: typeof message === "string" || message instanceof Error ? String(message) : "This file has not been formatted.",
|
|
32
32
|
title: "Prettier"
|
|
33
33
|
};
|
|
34
34
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/cli/lint/annotate/github/prettier.ts"],
|
|
4
|
-
"sourcesContent": ["import type * as GitHub from '../../../../api/github';\nimport type { PrettierOutput } from '../../../adapter/prettier';\n\nexport const createPrettierAnnotations = (\n prettier: PrettierOutput,\n): GitHub.Annotation[] =>\n prettier.result.errored.map((result) => {\n const message =\n result.err instanceof Error ? result.err.message : result.err;\n\n return {\n annotation_level: 'failure',\n start_line: 1,\n end_line: 1,\n path: result.filepath,\n message
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,4BAA4B,CACvC,aAEA,SAAS,OAAO,QAAQ,IAAI,CAAC,WAAW;AACtC,QAAM,UACJ,OAAO,eAAe,QAAQ,OAAO,IAAI,UAAU,OAAO;AAE5D,SAAO;AAAA,IACL,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM,OAAO;AAAA,IACb,
|
|
4
|
+
"sourcesContent": ["import type * as GitHub from '../../../../api/github';\nimport type { PrettierOutput } from '../../../adapter/prettier';\n\nexport const createPrettierAnnotations = (\n prettier: PrettierOutput,\n): GitHub.Annotation[] =>\n prettier.result.errored.map((result) => {\n const message =\n result.err instanceof Error ? result.err.message : result.err;\n\n return {\n annotation_level: 'failure',\n start_line: 1,\n end_line: 1,\n path: result.filepath,\n message:\n typeof message === 'string' || message instanceof Error\n ? String(message)\n : 'This file has not been formatted.',\n title: 'Prettier',\n };\n });\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,4BAA4B,CACvC,aAEA,SAAS,OAAO,QAAQ,IAAI,CAAC,WAAW;AACtC,QAAM,UACJ,OAAO,eAAe,QAAQ,OAAO,IAAI,UAAU,OAAO;AAE5D,SAAO;AAAA,IACL,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM,OAAO;AAAA,IACb,SACE,OAAO,YAAY,YAAY,mBAAmB,QAC9C,OAAO,OAAO,IACd;AAAA,IACN,OAAO;AAAA,EACT;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/wrapper/http.js
CHANGED
|
@@ -34,19 +34,16 @@ __export(http_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(http_exports);
|
|
36
36
|
var import_http = __toESM(require("http"));
|
|
37
|
-
var
|
|
37
|
+
var import_util = __toESM(require("util"));
|
|
38
38
|
var import_logging = require("../utils/logging");
|
|
39
39
|
const createRequestListenerFromFunction = (fn) => async (req, res) => {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
48
|
-
);
|
|
49
|
-
};
|
|
40
|
+
const writeResponse = (response) => new Promise(
|
|
41
|
+
(resolve, reject) => response === void 0 ? res.end(resolve) : res.write(
|
|
42
|
+
response,
|
|
43
|
+
"utf8",
|
|
44
|
+
(err) => err ? reject(err) : res.end(resolve)
|
|
45
|
+
)
|
|
46
|
+
);
|
|
50
47
|
try {
|
|
51
48
|
const requestBody = await new Promise((resolve, reject) => {
|
|
52
49
|
const data = [];
|
|
@@ -55,9 +52,11 @@ const createRequestListenerFromFunction = (fn) => async (req, res) => {
|
|
|
55
52
|
const jsonRequest = requestBody ? JSON.parse(requestBody) : [];
|
|
56
53
|
const args = Array.isArray(jsonRequest) ? jsonRequest : [jsonRequest];
|
|
57
54
|
const response = await fn(...args);
|
|
58
|
-
|
|
55
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
56
|
+
await writeResponse(JSON.stringify(response, null, 2));
|
|
59
57
|
} catch (err) {
|
|
60
|
-
|
|
58
|
+
res.writeHead(500);
|
|
59
|
+
await writeResponse(import_util.default.inspect(err));
|
|
61
60
|
}
|
|
62
61
|
};
|
|
63
62
|
const serveRequestListener = (requestListener, port) => {
|
package/lib/wrapper/http.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/wrapper/http.ts"],
|
|
4
|
-
"sourcesContent": ["import http from 'http';\nimport type { AddressInfo } from 'net';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;
|
|
6
|
-
"names": ["http"]
|
|
4
|
+
"sourcesContent": ["import http from 'http';\nimport type { AddressInfo } from 'net';\nimport util from 'util';\n\nimport { log } from '../utils/logging';\n\n/**\n * Create an HTTP request listener based on the supplied function.\n *\n * - The request body is JSON parsed and passed into the function as parameters.\n * - The function's return value is JSON stringified into the response body.\n */\nexport const createRequestListenerFromFunction =\n (fn: (...args: unknown[]) => Promise<unknown>): http.RequestListener =>\n async (req, res) => {\n const writeResponse = (response: unknown) =>\n new Promise<void>((resolve, reject) =>\n response === undefined\n ? res.end(resolve)\n : res.write(response, 'utf8', (err) =>\n err ? reject(err) : res.end(resolve),\n ),\n );\n\n try {\n const requestBody = await new Promise<string>((resolve, reject) => {\n const data: Buffer[] = [];\n\n req\n .on('data', (chunk: Buffer) => data.push(chunk))\n .on('end', () => resolve(Buffer.concat(data).toString()))\n .on('error', (err) => reject(err));\n });\n\n // Treat an empty body as no arguments\n const jsonRequest: unknown = requestBody ? JSON.parse(requestBody) : [];\n\n // Pass a non-array request body as the first parameter\n const args: unknown[] = Array.isArray(jsonRequest)\n ? jsonRequest\n : [jsonRequest];\n\n const response: unknown = await fn(...args);\n\n res.writeHead(200, { 'Content-Type': 'application/json' });\n\n await writeResponse(JSON.stringify(response, null, 2));\n } catch (err) {\n res.writeHead(500);\n\n await writeResponse(util.inspect(err));\n }\n };\n\n/**\n * Create a HTTP server based on the supplied `http.RequestListener`.\n *\n * This function resolves when the server is closed.\n */\nexport const serveRequestListener = (\n requestListener: http.RequestListener,\n port?: number,\n) => {\n const server = http.createServer(requestListener);\n return startServer(server, port);\n};\n\n/**\n * Returns a HTTP server wrapped in a promise\n *\n * This function resolves when the server is closed.\n */\nexport const startServer = (server: http.Server, port?: number) =>\n new Promise<void>((resolve, reject) =>\n server\n .listen(port)\n .on('close', resolve)\n .on('error', reject)\n .on('listening', () => {\n const address = server.address() as AddressInfo;\n\n log.ok('listening on port', log.bold(address.port));\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,k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B,GAAG,SAAS,MAAM,EAClB,GAAG,aAAa,MAAM;AACrB,UAAM,UAAU,OAAO,QAAQ;AAE/B,uBAAI,GAAG,qBAAqB,mBAAI,KAAK,QAAQ,IAAI,CAAC;AAAA,EACpD,CAAC;AACL;",
|
|
6
|
+
"names": ["util", "http"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0-main-20250115035914",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SEEK development toolkit for backend applications and packages",
|
|
6
6
|
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"function-arguments": "^1.0.9",
|
|
74
74
|
"get-port": "^5.1.1",
|
|
75
75
|
"golden-fleece": "^1.0.9",
|
|
76
|
-
"ignore": "^
|
|
76
|
+
"ignore": "^7.0.0",
|
|
77
77
|
"is-installed-globally": "^0.4.0",
|
|
78
78
|
"isomorphic-git": "^1.11.1",
|
|
79
79
|
"jest": "^29.0.1",
|
|
@@ -85,11 +85,10 @@
|
|
|
85
85
|
"npm-run-path": "^4.0.1",
|
|
86
86
|
"npm-which": "^3.0.1",
|
|
87
87
|
"picomatch": "^4.0.0",
|
|
88
|
-
"prettier": "~3.
|
|
88
|
+
"prettier": "~3.4.0",
|
|
89
89
|
"prettier-plugin-packagejson": "^2.4.10",
|
|
90
90
|
"read-pkg-up": "^7.0.1",
|
|
91
91
|
"semantic-release": "^22.0.12",
|
|
92
|
-
"serialize-error": "^8.0.1",
|
|
93
92
|
"simple-git": "^3.5.0",
|
|
94
93
|
"ts-dedent": "^2.2.0",
|
|
95
94
|
"ts-jest": "^29.1.0",
|
|
@@ -97,13 +96,13 @@
|
|
|
97
96
|
"tsconfig-paths": "^4.0.0",
|
|
98
97
|
"tsconfig-seek": "2.0.0",
|
|
99
98
|
"tsx": "^4.16.2",
|
|
100
|
-
"typescript": "~5.
|
|
99
|
+
"typescript": "~5.7.0",
|
|
101
100
|
"validate-npm-package-name": "^6.0.0",
|
|
102
101
|
"zod": "^3.22.4",
|
|
103
|
-
"eslint-config-skuba": "5.
|
|
102
|
+
"eslint-config-skuba": "5.1.0-main-20250115035914"
|
|
104
103
|
},
|
|
105
104
|
"devDependencies": {
|
|
106
|
-
"@changesets/cli": "2.27.
|
|
105
|
+
"@changesets/cli": "2.27.11",
|
|
107
106
|
"@changesets/get-github-info": "0.6.0",
|
|
108
107
|
"@jest/reporters": "29.7.0",
|
|
109
108
|
"@jest/test-result": "29.7.0",
|
|
@@ -117,15 +116,16 @@
|
|
|
117
116
|
"@types/module-alias": "2.0.4",
|
|
118
117
|
"@types/npm-which": "3.0.3",
|
|
119
118
|
"@types/picomatch": "3.0.1",
|
|
119
|
+
"@types/semver": "7.5.8",
|
|
120
120
|
"@types/supertest": "6.0.2",
|
|
121
121
|
"@types/validate-npm-package-name": "4.0.2",
|
|
122
|
-
"enhanced-resolve": "5.
|
|
123
|
-
"express": "4.21.
|
|
124
|
-
"fastify": "5.
|
|
122
|
+
"enhanced-resolve": "5.18.0",
|
|
123
|
+
"express": "4.21.2",
|
|
124
|
+
"fastify": "5.2.0",
|
|
125
125
|
"jest-diff": "29.7.0",
|
|
126
126
|
"jsonfile": "6.1.0",
|
|
127
127
|
"koa": "2.15.3",
|
|
128
|
-
"memfs": "4.
|
|
128
|
+
"memfs": "4.15.1",
|
|
129
129
|
"remark-cli": "12.0.1",
|
|
130
130
|
"remark-preset-lint-recommended": "7.0.0",
|
|
131
131
|
"semver": "7.6.3",
|
|
@@ -9,7 +9,7 @@ configs:
|
|
|
9
9
|
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
|
|
10
10
|
|
|
11
11
|
- &docker-ecr-cache
|
|
12
|
-
seek-oss/docker-ecr-cache#v2.2.
|
|
12
|
+
seek-oss/docker-ecr-cache#v2.2.1: &docker-ecr-cache-defaults
|
|
13
13
|
cache-on:
|
|
14
14
|
- .npmrc
|
|
15
15
|
- package.json#.packageManager
|
|
@@ -18,7 +18,7 @@ configs:
|
|
|
18
18
|
secrets: id=npm,src=/tmp/.npmrc
|
|
19
19
|
|
|
20
20
|
- &private-npm
|
|
21
|
-
seek-oss/private-npm#v1.
|
|
21
|
+
seek-oss/private-npm#v1.3.0:
|
|
22
22
|
env: NPM_READ_TOKEN
|
|
23
23
|
output-path: /tmp/
|
|
24
24
|
|
|
@@ -38,7 +38,7 @@ steps:
|
|
|
38
38
|
plugins:
|
|
39
39
|
- *aws-sm
|
|
40
40
|
- *private-npm
|
|
41
|
-
- seek-oss/docker-ecr-cache#v2.2.
|
|
41
|
+
- seek-oss/docker-ecr-cache#v2.2.1:
|
|
42
42
|
<<: *docker-ecr-cache-defaults
|
|
43
43
|
skip-pull-from-cache: true
|
|
44
44
|
|
|
@@ -57,7 +57,7 @@ steps:
|
|
|
57
57
|
- *aws-sm
|
|
58
58
|
- *private-npm
|
|
59
59
|
- *docker-ecr-cache
|
|
60
|
-
- docker-compose#v5.
|
|
60
|
+
- docker-compose#v5.5.0:
|
|
61
61
|
run: app
|
|
62
62
|
environment:
|
|
63
63
|
- GITHUB_API_TOKEN
|
|
@@ -8,7 +8,4 @@ buildArgs:
|
|
|
8
8
|
# https://github.com/seek-oss/docker-ecr-cache-buildkite-plugin#building-on-the-resulting-image
|
|
9
9
|
BASE_IMAGE: '{{.Env.BUILDKITE_PLUGIN_DOCKER_ECR_CACHE_EXPORT_IMAGE}}:{{.Env.BUILDKITE_PLUGIN_DOCKER_ECR_CACHE_EXPORT_TAG}}'
|
|
10
10
|
|
|
11
|
-
# SEEK-Jobs/gantry#1661
|
|
12
|
-
failOnScanFindings: false
|
|
13
|
-
|
|
14
11
|
cpuArchitecture: <%- platformName %>
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"skuba-dive": "^2.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/express": "^
|
|
23
|
+
"@types/express": "^5.0.0",
|
|
24
24
|
"@types/node": "^20.16.5",
|
|
25
25
|
"@types/supertest": "^6.0.0",
|
|
26
26
|
"mime": "^4.0.1",
|
|
27
|
-
"pino-pretty": "^
|
|
27
|
+
"pino-pretty": "^13.0.0",
|
|
28
28
|
"skuba": "*",
|
|
29
29
|
"supertest": "^7.0.0"
|
|
30
30
|
},
|
|
31
|
-
"packageManager": "pnpm@9.
|
|
31
|
+
"packageManager": "pnpm@9.15.3",
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=20"
|
|
34
34
|
}
|
|
@@ -11,7 +11,7 @@ configs:
|
|
|
11
11
|
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
|
|
12
12
|
|
|
13
13
|
- &docker-ecr-cache
|
|
14
|
-
seek-oss/docker-ecr-cache#v2.2.
|
|
14
|
+
seek-oss/docker-ecr-cache#v2.2.1:
|
|
15
15
|
cache-on:
|
|
16
16
|
- .npmrc
|
|
17
17
|
- package.json#.packageManager
|
|
@@ -19,7 +19,7 @@ configs:
|
|
|
19
19
|
secrets: id=npm,src=/tmp/.npmrc
|
|
20
20
|
|
|
21
21
|
- &private-npm
|
|
22
|
-
seek-oss/private-npm#v1.
|
|
22
|
+
seek-oss/private-npm#v1.3.0:
|
|
23
23
|
env: NPM_READ_TOKEN
|
|
24
24
|
output-path: /tmp/
|
|
25
25
|
|
|
@@ -38,7 +38,7 @@ steps:
|
|
|
38
38
|
- *aws-sm
|
|
39
39
|
- *private-npm
|
|
40
40
|
- *docker-ecr-cache
|
|
41
|
-
- docker-compose#v5.
|
|
41
|
+
- docker-compose#v5.5.0:
|
|
42
42
|
run: app
|
|
43
43
|
environment:
|
|
44
44
|
- GITHUB_API_TOKEN
|
|
@@ -9,7 +9,7 @@ configs:
|
|
|
9
9
|
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
|
|
10
10
|
|
|
11
11
|
- &docker-ecr-cache
|
|
12
|
-
seek-oss/docker-ecr-cache#v2.2.
|
|
12
|
+
seek-oss/docker-ecr-cache#v2.2.1: &docker-ecr-cache-defaults
|
|
13
13
|
cache-on:
|
|
14
14
|
- .npmrc
|
|
15
15
|
- package.json#.packageManager
|
|
@@ -18,7 +18,7 @@ configs:
|
|
|
18
18
|
secrets: id=npm,src=/tmp/.npmrc
|
|
19
19
|
|
|
20
20
|
- &private-npm
|
|
21
|
-
seek-oss/private-npm#v1.
|
|
21
|
+
seek-oss/private-npm#v1.3.0:
|
|
22
22
|
env: NPM_READ_TOKEN
|
|
23
23
|
output-path: /tmp/
|
|
24
24
|
|
|
@@ -38,7 +38,7 @@ steps:
|
|
|
38
38
|
plugins:
|
|
39
39
|
- *aws-sm
|
|
40
40
|
- *private-npm
|
|
41
|
-
- seek-oss/docker-ecr-cache#v2.2.
|
|
41
|
+
- seek-oss/docker-ecr-cache#v2.2.1:
|
|
42
42
|
<<: *docker-ecr-cache-defaults
|
|
43
43
|
skip-pull-from-cache: true
|
|
44
44
|
|
|
@@ -57,7 +57,7 @@ steps:
|
|
|
57
57
|
- *aws-sm
|
|
58
58
|
- *private-npm
|
|
59
59
|
- *docker-ecr-cache
|
|
60
|
-
- docker-compose#v5.
|
|
60
|
+
- docker-compose#v5.5.0:
|
|
61
61
|
run: app
|
|
62
62
|
environment:
|
|
63
63
|
- GITHUB_API_TOKEN
|
|
@@ -8,7 +8,4 @@ buildArgs:
|
|
|
8
8
|
# https://github.com/seek-oss/docker-ecr-cache-buildkite-plugin#building-on-the-resulting-image
|
|
9
9
|
BASE_IMAGE: '{{.Env.BUILDKITE_PLUGIN_DOCKER_ECR_CACHE_EXPORT_IMAGE}}:{{.Env.BUILDKITE_PLUGIN_DOCKER_ECR_CACHE_EXPORT_TAG}}'
|
|
10
10
|
|
|
11
|
-
# SEEK-Jobs/gantry#1661
|
|
12
|
-
failOnScanFindings: false
|
|
13
|
-
|
|
14
11
|
cpuArchitecture: <%- platformName %>
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"@koa/router": "^13.0.0",
|
|
18
18
|
"@opentelemetry/api": "^1.9.0",
|
|
19
19
|
"@opentelemetry/core": "^1.25.0",
|
|
20
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
21
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
22
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
20
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.57.0",
|
|
21
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.49.0",
|
|
22
|
+
"@opentelemetry/instrumentation-http": "^0.57.0",
|
|
23
23
|
"@opentelemetry/propagator-b3": "^1.25.0",
|
|
24
|
-
"@opentelemetry/sdk-node": "^0.
|
|
24
|
+
"@opentelemetry/sdk-node": "^0.57.0",
|
|
25
25
|
"@seek/logger": "^9.0.0",
|
|
26
26
|
"hot-shots": "^10.0.0",
|
|
27
27
|
"koa": "^2.13.4",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"@types/supertest": "^6.0.0",
|
|
41
41
|
"chance": "^1.1.8",
|
|
42
42
|
"mime": "^4.0.1",
|
|
43
|
-
"pino-pretty": "^
|
|
43
|
+
"pino-pretty": "^13.0.0",
|
|
44
44
|
"skuba": "*",
|
|
45
45
|
"supertest": "^7.0.0"
|
|
46
46
|
},
|
|
47
|
-
"packageManager": "pnpm@9.
|
|
47
|
+
"packageManager": "pnpm@9.15.3",
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=20"
|
|
50
50
|
}
|
|
@@ -9,7 +9,7 @@ configs:
|
|
|
9
9
|
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
|
|
10
10
|
|
|
11
11
|
- &docker-ecr-cache
|
|
12
|
-
seek-oss/docker-ecr-cache#v2.2.
|
|
12
|
+
seek-oss/docker-ecr-cache#v2.2.1: &docker-ecr-cache-defaults
|
|
13
13
|
cache-on:
|
|
14
14
|
- .npmrc
|
|
15
15
|
- package.json#.packageManager
|
|
@@ -17,7 +17,7 @@ configs:
|
|
|
17
17
|
secrets: id=npm,src=/tmp/.npmrc
|
|
18
18
|
|
|
19
19
|
- &private-npm
|
|
20
|
-
seek-oss/private-npm#v1.
|
|
20
|
+
seek-oss/private-npm#v1.3.0:
|
|
21
21
|
env: NPM_READ_TOKEN
|
|
22
22
|
output-path: /tmp/
|
|
23
23
|
|
|
@@ -36,7 +36,7 @@ configs:
|
|
|
36
36
|
- *aws-sm
|
|
37
37
|
- *private-npm
|
|
38
38
|
- *docker-ecr-cache
|
|
39
|
-
- docker-compose#v5.
|
|
39
|
+
- docker-compose#v5.5.0:
|
|
40
40
|
dependencies: false
|
|
41
41
|
run: app
|
|
42
42
|
propagate-environment: true
|
|
@@ -67,7 +67,7 @@ steps:
|
|
|
67
67
|
- *aws-sm
|
|
68
68
|
- *private-npm
|
|
69
69
|
- *docker-ecr-cache
|
|
70
|
-
- docker-compose#v5.
|
|
70
|
+
- docker-compose#v5.5.0:
|
|
71
71
|
run: app
|
|
72
72
|
environment:
|
|
73
73
|
- GITHUB_API_TOKEN
|
|
@@ -82,7 +82,7 @@ steps:
|
|
|
82
82
|
plugins:
|
|
83
83
|
- *aws-sm
|
|
84
84
|
- *private-npm
|
|
85
|
-
- seek-oss/docker-ecr-cache#v2.2.
|
|
85
|
+
- seek-oss/docker-ecr-cache#v2.2.1:
|
|
86
86
|
<<: *docker-ecr-cache-defaults
|
|
87
87
|
skip-pull-from-cache: true
|
|
88
88
|
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"aws-sdk-client-mock": "^4.0.0",
|
|
32
32
|
"aws-sdk-client-mock-jest": "^4.0.0",
|
|
33
33
|
"chance": "^1.1.8",
|
|
34
|
-
"pino-pretty": "^
|
|
34
|
+
"pino-pretty": "^13.0.0",
|
|
35
35
|
"serverless": "^3.39.0",
|
|
36
36
|
"serverless-plugin-canary-deployments": "^0.8.0",
|
|
37
37
|
"serverless-plugin-datadog": "^5.12.0",
|
|
38
38
|
"serverless-prune-plugin": "^2.0.0",
|
|
39
39
|
"skuba": "*"
|
|
40
40
|
},
|
|
41
|
-
"packageManager": "pnpm@9.
|
|
41
|
+
"packageManager": "pnpm@9.15.3",
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=20"
|
|
44
44
|
}
|
|
@@ -9,7 +9,7 @@ configs:
|
|
|
9
9
|
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
|
|
10
10
|
|
|
11
11
|
- &docker-ecr-cache
|
|
12
|
-
seek-oss/docker-ecr-cache#v2.2.
|
|
12
|
+
seek-oss/docker-ecr-cache#v2.2.1: &docker-ecr-cache-defaults
|
|
13
13
|
cache-on:
|
|
14
14
|
- .npmrc
|
|
15
15
|
- package.json#.packageManager
|
|
@@ -17,7 +17,7 @@ configs:
|
|
|
17
17
|
secrets: id=npm,src=/tmp/.npmrc
|
|
18
18
|
|
|
19
19
|
- &private-npm
|
|
20
|
-
seek-oss/private-npm#v1.
|
|
20
|
+
seek-oss/private-npm#v1.3.0:
|
|
21
21
|
env: NPM_READ_TOKEN
|
|
22
22
|
output-path: /tmp/
|
|
23
23
|
|
|
@@ -33,7 +33,7 @@ configs:
|
|
|
33
33
|
- *aws-sm
|
|
34
34
|
- *private-npm
|
|
35
35
|
- *docker-ecr-cache
|
|
36
|
-
- docker-compose#v5.
|
|
36
|
+
- docker-compose#v5.5.0:
|
|
37
37
|
dependencies: false
|
|
38
38
|
run: app
|
|
39
39
|
environment:
|
|
@@ -63,7 +63,7 @@ steps:
|
|
|
63
63
|
- *aws-sm
|
|
64
64
|
- *private-npm
|
|
65
65
|
- *docker-ecr-cache
|
|
66
|
-
- docker-compose#v5.
|
|
66
|
+
- docker-compose#v5.5.0:
|
|
67
67
|
run: app
|
|
68
68
|
environment:
|
|
69
69
|
- GITHUB_API_TOKEN
|
|
@@ -78,7 +78,7 @@ steps:
|
|
|
78
78
|
plugins:
|
|
79
79
|
- *aws-sm
|
|
80
80
|
- *private-npm
|
|
81
|
-
- seek-oss/docker-ecr-cache#v2.2.
|
|
81
|
+
- seek-oss/docker-ecr-cache#v2.2.1:
|
|
82
82
|
<<: *docker-ecr-cache-defaults
|
|
83
83
|
skip-pull-from-cache: true
|
|
84
84
|
|
|
@@ -14,9 +14,10 @@ Next steps:
|
|
|
14
14
|
3. [ ] Add the repository to BuildAgency;
|
|
15
15
|
see our internal [Buildkite Docs] for more information.
|
|
16
16
|
4. [ ] Add Datadog extension, deployment bucket configuration and data classification tags to [infra/config.ts](infra/config.ts).
|
|
17
|
-
5. [ ]
|
|
18
|
-
6. [ ]
|
|
19
|
-
7. [ ]
|
|
17
|
+
5. [ ] For the smoke test, make sure Lambda has permissions to publish SNS message and configure `sourceSnsTopicArn` in [infra/config.ts](infra/config.ts).
|
|
18
|
+
6. [ ] Push local commits to the upstream GitHub branch.
|
|
19
|
+
7. [ ] Configure [GitHub repository settings].
|
|
20
|
+
8. [ ] Delete this checklist 😌.
|
|
20
21
|
|
|
21
22
|
[Buildkite Docs]: https://backstage.myseek.xyz/docs/default/component/buildkite-docs
|
|
22
23
|
[GitHub repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
@@ -187,7 +187,6 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
187
187
|
"DD_SERVERLESS_APPSEC_ENABLED": "false",
|
|
188
188
|
"DD_SERVERLESS_LOGS_ENABLED": "false",
|
|
189
189
|
"DD_SITE": "datadoghq.com",
|
|
190
|
-
"DD_TAGS": "git.commit.sha:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,git.repository_url:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
191
190
|
"DD_TRACE_ENABLED": "true",
|
|
192
191
|
"DESTINATION_SNS_TOPIC_ARN": {
|
|
193
192
|
"Ref": "destinationtopicDCE2E0B8",
|
|
@@ -604,6 +603,13 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
604
603
|
"Properties": {
|
|
605
604
|
"PolicyDocument": {
|
|
606
605
|
"Statement": [
|
|
606
|
+
{
|
|
607
|
+
"Action": "sns:Publish",
|
|
608
|
+
"Effect": "Allow",
|
|
609
|
+
"Resource": {
|
|
610
|
+
"Ref": "destinationtopicDCE2E0B8",
|
|
611
|
+
},
|
|
612
|
+
},
|
|
607
613
|
{
|
|
608
614
|
"Action": [
|
|
609
615
|
"secretsmanager:GetSecretValue",
|
|
@@ -907,7 +913,6 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
907
913
|
"DD_SERVERLESS_APPSEC_ENABLED": "false",
|
|
908
914
|
"DD_SERVERLESS_LOGS_ENABLED": "false",
|
|
909
915
|
"DD_SITE": "datadoghq.com",
|
|
910
|
-
"DD_TAGS": "git.commit.sha:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,git.repository_url:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
911
916
|
"DD_TRACE_ENABLED": "true",
|
|
912
917
|
"DESTINATION_SNS_TOPIC_ARN": {
|
|
913
918
|
"Ref": "destinationtopicDCE2E0B8",
|
|
@@ -1324,6 +1329,13 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
1324
1329
|
"Properties": {
|
|
1325
1330
|
"PolicyDocument": {
|
|
1326
1331
|
"Statement": [
|
|
1332
|
+
{
|
|
1333
|
+
"Action": "sns:Publish",
|
|
1334
|
+
"Effect": "Allow",
|
|
1335
|
+
"Resource": {
|
|
1336
|
+
"Ref": "destinationtopicDCE2E0B8",
|
|
1337
|
+
},
|
|
1338
|
+
},
|
|
1327
1339
|
{
|
|
1328
1340
|
"Action": [
|
|
1329
1341
|
"secretsmanager:GetSecretValue",
|
|
@@ -16,9 +16,11 @@ jest.useFakeTimers({
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
const originalEnv = process.env.ENVIRONMENT;
|
|
19
|
+
const originalVersion = process.env.VERSION;
|
|
19
20
|
|
|
20
21
|
afterAll(() => {
|
|
21
22
|
process.env.ENVIRONMENT = originalEnv;
|
|
23
|
+
process.env.VERSION = originalVersion;
|
|
22
24
|
});
|
|
23
25
|
|
|
24
26
|
afterEach(() => {
|
|
@@ -29,6 +31,7 @@ it.each(['dev', 'prod'])(
|
|
|
29
31
|
'returns expected CloudFormation stack for %s',
|
|
30
32
|
async (env) => {
|
|
31
33
|
process.env.ENVIRONMENT = env;
|
|
34
|
+
process.env.VERSION = 'local';
|
|
32
35
|
|
|
33
36
|
const { AppStack } = await import('./appStack');
|
|
34
37
|
|
|
@@ -63,9 +66,8 @@ it.each(['dev', 'prod'])(
|
|
|
63
66
|
)
|
|
64
67
|
.replaceAll(/"Value":"v\d+\.\d+\.\d+"/g, (_) => `"Value": "vx.x.x"`)
|
|
65
68
|
.replace(
|
|
66
|
-
/"DD_TAGS":"git.commit.sha:([0-9a-f]+),git.repository_url:([^\"]+)"
|
|
67
|
-
|
|
68
|
-
`"DD_TAGS":"git.commit.sha:${'x'.repeat(sha.length)},git.repository_url:${'x'.repeat(url.length)}"`,
|
|
69
|
+
/"DD_TAGS":"git.commit.sha:([0-9a-f]+),git.repository_url:([^\"]+)",/g,
|
|
70
|
+
'',
|
|
69
71
|
)
|
|
70
72
|
.replaceAll(
|
|
71
73
|
/(layer:Datadog-Extension-.+?:)\d+/g,
|
|
@@ -109,6 +109,8 @@ export class AppStack extends Stack {
|
|
|
109
109
|
reservedConcurrentExecutions: config.workerLambda.reservedConcurrency,
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
+
destinationTopic.grantPublish(worker);
|
|
113
|
+
|
|
112
114
|
const datadogSecret = aws_secretsmanager.Secret.fromSecretPartialArn(
|
|
113
115
|
this,
|
|
114
116
|
'datadog-api-key-secret',
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"deploy:watch": "pnpm --silent deploy:hotswap --watch",
|
|
9
9
|
"format": "skuba format",
|
|
10
10
|
"lint": "skuba lint",
|
|
11
|
+
"start": "skuba start --port <%- port %>",
|
|
11
12
|
"test": "skuba test",
|
|
12
13
|
"test:ci": "skuba test --coverage",
|
|
13
14
|
"test:watch": "skuba test --watch"
|
|
@@ -27,17 +28,17 @@
|
|
|
27
28
|
"@types/aws-lambda": "^8.10.82",
|
|
28
29
|
"@types/chance": "^1.1.3",
|
|
29
30
|
"@types/node": "^20.16.5",
|
|
30
|
-
"aws-cdk": "^2.
|
|
31
|
-
"aws-cdk-lib": "^2.
|
|
31
|
+
"aws-cdk": "^2.167.1",
|
|
32
|
+
"aws-cdk-lib": "^2.167.1",
|
|
32
33
|
"aws-sdk-client-mock": "^4.0.0",
|
|
33
34
|
"aws-sdk-client-mock-jest": "^4.0.0",
|
|
34
35
|
"chance": "^1.1.8",
|
|
35
36
|
"constructs": "^10.0.17",
|
|
36
37
|
"datadog-cdk-constructs-v2": "^1.18.0",
|
|
37
|
-
"pino-pretty": "^
|
|
38
|
-
"skuba": "
|
|
38
|
+
"pino-pretty": "^13.0.0",
|
|
39
|
+
"skuba": "9.2.0-main-20250115035914"
|
|
39
40
|
},
|
|
40
|
-
"packageManager": "pnpm@9.
|
|
41
|
+
"packageManager": "pnpm@9.15.3",
|
|
41
42
|
"engines": {
|
|
42
43
|
"node": ">=20"
|
|
43
44
|
}
|