Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix 2 #13457

Closed
wants to merge 17 commits into from
Closed

Hotfix 2 #13457

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,176 changes: 588 additions & 588 deletions codebuild_specs/e2e_workflow_generated.yml

Large diffs are not rendered by default.

310 changes: 155 additions & 155 deletions codebuild_specs/wait_for_ids.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"license": "Apache-2.0",
"dependencies": {
"lerna": "^6.6.1",
"node-gyp": "^9.3.1",
"node-gyp": "^10.0.1",
"strip-ansi": "^6.0.0",
"yargs": "^17.7.2"
},
Expand All @@ -110,7 +110,6 @@
"@commitlint/cz-commitlint": "^17.5.0",
"@commitlint/prompt": "^17.6.1",
"@microsoft/api-extractor": "^7.34.6",
"@types/glob": "^7.1.1",
"@types/jest": "^29.0.0",
"@types/js-yaml": "^4.0.0",
"@types/node": "^18.16.1",
Expand All @@ -135,12 +134,12 @@
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-spellcheck": "^0.0.17",
"execa": "^5.1.1",
"glob": "^7.2.0",
"glob": "^9.3.5",
"husky": "^8.0.3",
"istanbul-lib-coverage": "^3.2.0",
"istanbul-lib-report": "^3.0.0",
"istanbul-reports": "^3.1.5",
"jest": "^29.0.0",
"jest": "^29.7.0",
"jest-circus": "^29.0.0",
"jest-junit": "^12.0.0",
"js-yaml": "^4.0.0",
Expand All @@ -163,7 +162,9 @@
"resolutions": {
"aws-sdk": "^2.1464.0",
"cross-fetch": "^2.2.6",
"glob": "^9.3.5",
"glob-parent": "^6.0.2",
"rimraf": "^4.4.1",
"got": "^11.8.5",
"istanbul/async": "^2.6.4",
"jake/async": "^2.6.4",
Expand Down
3 changes: 0 additions & 3 deletions packages/amplify-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
"xcode": "^2.1.0",
"yargs": "^15.1.0"
},
"devDependencies": {
"@types/glob": "^7.1.1"
},
"berry": {
"plugins": [
"@yarn/plugin-typescript"
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-category-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@aws-sdk/client-iam": "^3.303.0",
"@types/mime-types": "^2.1.1",
"cloudform-types": "^4.2.0",
"jest": "^29.5.0",
"jest": "^29.7.0",
"rimraf": "^3.0.2"
},
"jest": {
Expand Down
3 changes: 1 addition & 2 deletions packages/amplify-category-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@
"aws-cdk-lib": "~2.80.0",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
"glob": "^7.2.0",
"ora": "^4.0.3",
"uuid": "^8.3.2"
},
"devDependencies": {
"@types/lodash": "^4.14.149",
"jest": "^29.5.0",
"jest": "^29.7.0",
"rimraf": "^3.0.2"
},
"jest": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { $TSContext, CFNTemplateFormat, readCFNTemplate, pathManager, stateManager, writeCFNTemplate } from '@aws-amplify/amplify-cli-core';
import { glob } from 'glob';
import glob from 'glob';
import { prompter } from '@aws-amplify/amplify-prompts';
import * as fs from 'fs-extra';
import * as cdk from 'aws-cdk-lib';
Expand Down Expand Up @@ -37,7 +37,7 @@ describe('getResourceCfnOutputAttributes() scenarios', () => {
templateFormat: CFNTemplateFormat.JSON,
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
});
glob_mock.sync.mockReturnValueOnce(['mockFileName']);
glob_mock.globSync.mockReturnValueOnce(['mockFileName']);

expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual(['mockKey']);
});
Expand All @@ -50,7 +50,7 @@ describe('getResourceCfnOutputAttributes() scenarios', () => {
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
});

glob_mock.sync.mockReturnValueOnce(['mockFileName1', 'mockFileName2']);
glob_mock.globSync.mockReturnValueOnce(['mockFileName1', 'mockFileName2']);

expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual([]);
});
Expand All @@ -62,7 +62,7 @@ describe('getResourceCfnOutputAttributes() scenarios', () => {
templateFormat: CFNTemplateFormat.JSON,
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
});
glob_mock.sync.mockReturnValueOnce(['mockFileName']);
glob_mock.globSync.mockReturnValueOnce(['mockFileName']);

expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual(['mockKey']);
});
Expand All @@ -74,14 +74,14 @@ describe('getResourceCfnOutputAttributes() scenarios', () => {
templateFormat: CFNTemplateFormat.JSON,
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
});
glob_mock.sync.mockReturnValueOnce(['mockFileName1', 'mockFileName2']);
glob_mock.globSync.mockReturnValueOnce(['mockFileName1', 'mockFileName2']);

expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual([]);
});

it('get resource attr for resources without any cfn files', async () => {
fs_mock.existsSync.mockReturnValue(false); // if build dir exists
glob_mock.sync.mockReturnValueOnce([]);
glob_mock.globSync.mockReturnValueOnce([]);

expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual([]);
});
Expand All @@ -100,7 +100,7 @@ describe('getAllResources() scenarios', () => {
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
});

glob_mock.sync.mockReturnValue(['mockFileName']);
glob_mock.globSync.mockReturnValue(['mockFileName']);

stateManager.getMeta = jest.fn().mockReturnValue({
mockCategory1: {
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('addCDKResourceDependency() scenarios', () => {
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
});

glob_mock.sync.mockReturnValue(['mockFileName']);
glob_mock.globSync.mockReturnValue(['mockFileName']);

const mockBackendConfig = {
mockCategory1: {
Expand Down Expand Up @@ -263,7 +263,7 @@ describe('addCFNResourceDependency() scenarios', () => {
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
});

glob_mock.sync.mockReturnValue(['mockFileName']);
glob_mock.globSync.mockReturnValue(['mockFileName']);

const mockBackendConfig = {
mockCategory1: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as cdk from 'aws-cdk-lib';
import { $TSContext, $TSObject, pathManager, readCFNTemplate, stateManager, writeCFNTemplate } from '@aws-amplify/amplify-cli-core';
import { byValues, printer, prompter } from '@aws-amplify/amplify-prompts';
import * as fs from 'fs-extra';
import { glob } from 'glob';
import { globSync, GlobOptionsWithFileTypesFalse } from 'glob';
import _ from 'lodash';
import * as path from 'path';
import { categoryName, customResourceCFNFilenameSuffix } from '../utils/constants';
Expand All @@ -26,10 +26,11 @@ export function getResourceCfnOutputAttributes(category: string, resourceName: s
* Otherwise falls back to the default behavior.
*/
if (fs.existsSync(resourceBuildDir)) {
const cfnFiles = glob.sync(cfnTemplateGlobPattern, {
const cfnFiles = globSync(cfnTemplateGlobPattern, {
cwd: resourceBuildDir,
ignore: [AUTH_TRIGGER_TEMPLATE],
});
withFileTypes: false,
} as GlobOptionsWithFileTypesFalse);

if (cfnFiles.length > 0) {
// Only one CFN files is allowed per-resource - check if there's more than one and error out
Expand All @@ -45,10 +46,11 @@ export function getResourceCfnOutputAttributes(category: string, resourceName: s
}
if (!cfnFilePath) {
// For categories which do not store cfn files in build/ dir
const cfnFiles = glob.sync(cfnTemplateGlobPattern, {
const cfnFiles = globSync(cfnTemplateGlobPattern, {
cwd: resourceDir,
ignore: [AUTH_TRIGGER_TEMPLATE],
});
withFileTypes: false,
} as GlobOptionsWithFileTypesFalse);
if (cfnFiles.length > 1) {
printer.warn(`${resourceName} has more than one CloudFormation definitions in the resource folder which isn't permitted.`);
return [];
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-category-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"devDependencies": {
"@types/folder-hash": "^4.0.1",
"jest": "^29.5.0"
"jest": "^29.7.0"
},
"jest": {
"collectCoverage": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-cli-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@types/rimraf": "^3.0.0",
"@types/uuid": "^8.0.0",
"@types/yarnpkg__lockfile": "^1.1.5",
"jest": "^29.5.0",
"jest": "^29.7.0",
"nock": "^13.0.11",
"rimraf": "^3.0.0",
"strip-ansi": "^6.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/amplify-cli-npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
},
"dependencies": {
"axios": "^1.6.2",
"rimraf": "^3.0.2",
"rimraf": "^4.4.1",
"tar-stream": "^2.2.0"
},
"devDependencies": {
"@aws-amplify/cli-internal": "12.8.2",
"@types/tar": "^6.1.1",
"rimraf": "^3.0.2"
"rimraf": "^4.4.1"
},
"berry": {
"plugins": [
Expand Down
4 changes: 1 addition & 3 deletions packages/amplify-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"execa": "^5.1.1",
"folder-hash": "^4.0.2",
"fs-extra": "^8.1.0",
"glob": "^7.2.0",
"graphql": "^15.5.0",
"graphql-transformer-core": "^8.2.3",
"gunzip-maybe": "^1.4.2",
Expand All @@ -110,7 +109,6 @@
"@types/columnify": "^1.5.1",
"@types/folder-hash": "^4.0.1",
"@types/fs-extra": "^8.0.1",
"@types/glob": "^7.1.1",
"@types/gunzip-maybe": "^1.4.0",
"@types/node": "^12.12.6",
"@types/node-fetch": "^2.6.1",
Expand All @@ -121,7 +119,7 @@
"@types/update-notifier": "^5.1.0",
"amplify-headless-interface": "1.17.6",
"cloudform-types": "^4.2.0",
"jest": "^29.5.0",
"jest": "^29.7.0",
"nock": "^12.0.3",
"typescript": "^4.9.5"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ describe('resource-status-diff helpers', () => {
cwd: stubFileFolder,
follow: false,
nodir: true,
withFileTypes: false,
};

const cfnFilename = globCFNFilePath(stubFileFolder);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import * as glob from 'glob';
import { GlobOptionsWithFileTypesFalse, globSync } from 'glob';
import chalk from 'chalk';
import * as cfnDiff from '@aws-cdk/cloudformation-diff';
import { $TSAny, generateCustomPoliciesInTemplate, pathManager, readCFNTemplate } from '@aws-amplify/amplify-cli-core';
Expand Down Expand Up @@ -92,14 +92,15 @@ interface IResourcePaths {
*/
export const globCFNFilePath = (fileFolder: string): string => {
if (fs.existsSync(fileFolder)) {
const globOptions: glob.IOptions = {
const globOptions: GlobOptionsWithFileTypesFalse = {
withFileTypes: false,
absolute: false,
cwd: fileFolder,
follow: false,
// eslint-disable-next-line spellcheck/spell-checker
nodir: true,
};
const templateFileNames = glob.sync('**/*template.{yaml,yml,json}', globOptions);
const templateFileNames = globSync('**/*template.{yaml,yml,json}', globOptions);
for (const templateFileName of templateFileNames) {
const absolutePath = path.join(fileFolder, templateFileName);
return absolutePath; // only the top level cloudformation ( nested templates are picked after parsing this file )
Expand Down
6 changes: 3 additions & 3 deletions packages/amplify-cli/src/project-config-version-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from 'path';
import * as fs from 'fs-extra';
import * as inquirer from 'inquirer';
import _ from 'lodash';
import glob from 'glob';
import { GlobOptionsWithFileTypesFalse, globSync } from 'glob';
import { coerce, lt } from 'semver';
import { Context } from './domain/context';
import { ConfirmQuestion } from 'inquirer';
Expand Down Expand Up @@ -65,14 +65,14 @@ async function checkLambdaCustomResourceNodeVersion(context: Context, projectPat
const filesToUpdate: string[] = [];

if (fs.existsSync(backendDirPath)) {
const globOptions: glob.IOptions = {
const globOptions: GlobOptionsWithFileTypesFalse = {
absolute: false,
cwd: backendDirPath,
follow: false,
nodir: true,
};

const templateFileNames = glob.sync('**/*template.{yaml,yml,json}', globOptions);
const templateFileNames = globSync('**/*template.{yaml,yml,json}', globOptions);

for (const templateFileName of templateFileNames) {
const absolutePath = path.join(backendDirPath, templateFileName);
Expand Down
1 change: 0 additions & 1 deletion packages/amplify-console-hosting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"cli-table3": "^0.6.0",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
"glob": "^7.2.0",
"inquirer": "^7.3.3",
"node-fetch": "^2.6.7",
"ora": "^4.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-console-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"promise-sequential": "^1.1.1"
},
"devDependencies": {
"jest": "^29.5.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.4.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"@aws-amplify/amplify-prompts": "2.8.6",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
"glob": "^7.2.0",
"which": "^2.0.2"
},
"devDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions packages/amplify-e2e-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
"throat": "^5.0.0",
"uuid": "^8.3.2"
},
"devDependencies": {
"@types/glob": "^7.1.1"
},
"berry": {
"plugins": [
"@yarn/plugin-typescript"
Expand Down
3 changes: 1 addition & 2 deletions packages/amplify-e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"extract-zip": "^2.0.1",
"fs-extra": "^8.1.0",
"get-port": "^5.1.1",
"glob": "^8.0.3",
"graphql-tag": "^2.10.1",
"graphql-transformer-core": "^8.2.3",
"isomorphic-fetch": "^3.0.0",
Expand All @@ -73,7 +72,7 @@
"@types/node": "^18.16.1",
"@types/openpgp": "^4.4.18",
"@types/ws": "^7.4.4",
"jest": "^29.5.0",
"jest": "^29.7.0",
"openpgp": "^5.10.2",
"ts-jest": "^29.1.0",
"ts-node": "^10.4.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/amplify-environment-parameters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
"clean": "rimraf lib tsconfig.tsbuildinfo node_modules src/schemas",
"test": "jest --logHeapUsage",
"extract-api": "ts-node ../../scripts/extract-api.ts",
"generate-schemas": "mkdirp lib/schemas src/schemas && ts-json-schema-generator --path src/backend-parameters.d.ts --type BackendParameters --no-type-check --out lib/schemas/BackendParameters.schema.json && copyfiles --flat lib/schemas/BackendParameters.schema.json src/schemas"
"generate-schemas": "mkdirp lib/schemas src/schemas && ts-json-schema-generator --path src/backend-parameters.d.ts --type BackendParameters --no-type-check --out lib/schemas/BackendParameters.schema.json && cpx lib/schemas/BackendParameters.schema.json src/schemas"
},
"dependencies": {
"@aws-amplify/amplify-cli-core": "4.2.13",
"ajv": "^6.12.6",
"cpx2": "^6.0.1",
"lodash": "^4.17.21"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
"get-port": "^5.1.1",
"glob": "^7.2.0",
"semver": "^7.5.4",
"which": "^2.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-graphiql-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"graphql": "^15.5.0",
"html-webpack-plugin": "^5.5.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.0.0",
"jest": "^29.7.0",
"jest-resolve": "^26.0.2",
"jest-watch-typeahead": "^1.0.0",
"jsonwebtoken": "^9.0.0",
Expand Down
Loading