From 3b973791a617d082db49c0b8e754104c5d07e223 Mon Sep 17 00:00:00 2001 From: Leonardo Gama Date: Wed, 2 Aug 2023 10:31:07 -0700 Subject: [PATCH 1/4] Add schema generation workflow --- .github/workflows/generate-schema.yml | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/generate-schema.yml diff --git a/.github/workflows/generate-schema.yml b/.github/workflows/generate-schema.yml new file mode 100644 index 0000000000..9056a03ab4 --- /dev/null +++ b/.github/workflows/generate-schema.yml @@ -0,0 +1,46 @@ +name: Generate SAM CLI JSON schema + +on: + schedule: + - cron: 30 15 * * 1-5 # 8:30am PST Monday-Friday + +jobs: + generateSchema: + permissions: + pull-requests: write + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + name: Checkout latest AWS SAM CLI commit + with: + repository: 'aws/aws-sam-cli' + ref: 'develop' + path: 'aws-sam-cli-develop' + - uses: actions/setup-python@v4 + name: Install Python 3.9 + with: + python-version: 3.9 + - run: | + make -C aws-sam-cli-develop init + cd aws-sam-cli-develop + diff <( cat schema/samcli.json ) <( python schema/make_schema.py; cat schema/samcli.json ) && exit 0 # exit if schema is unchanged + echo "is_schema_changed=1" >> $GITHUB_ENV + git config --global user.email "action@github.com" + git config --global user.name "GitHub Action" + git checkout -b update-schema + git status + git add schema/samcli.json + git commit -m "chore: Update JSON schema" && exit 0 + name: Generate the schema + shell: bash + - name: Raise PR to update JSON schema + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ env.is_schema_changed == 1 }} # run only if there was a change + run: | + cd aws-sam-cli-develop + git push --force origin update-schema + gh pr list --repo aws/aws-sam-cli --head update-schema --json id --jq length | grep 1 && exit 0 # exit if there is existing pr + gh pr create --base develop --head update-schema --title "chore: Update JSON schema" --body "This PR & commit are automatically created by the SAM CLI repo to update the JSON schema with the latest changes." --label "pr/internal" --label "area/schema" + From cb90e94da81ff7d22fcf60eb8ac3937e7b48c690 Mon Sep 17 00:00:00 2001 From: Leonardo Gama Date: Wed, 2 Aug 2023 13:48:56 -0700 Subject: [PATCH 2/4] Reduce GHA and add schema generation to makefile --- .github/workflows/build.yml | 23 ++++ .github/workflows/generate-schema.yml | 46 -------- Makefile | 7 +- schema/make_schema.py | 2 +- schema/samcli.json | 156 +++----------------------- 5 files changed, 48 insertions(+), 186 deletions(-) delete mode 100644 .github/workflows/generate-schema.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9af2f5e4a..2699b01295 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,7 @@ jobs: runs-on: ubuntu-latest needs: - make-pr + - validate-schema - integration-tests - smoke-and-functional-tests - docker-disabled @@ -32,6 +33,7 @@ jobs: - name: report-failure if : | needs.make-pr.result != 'success' || + needs.validate-schema.result != 'success' || needs.integration-tests.result != 'success' || needs.smoke-and-functional-tests.result != 'success' || needs.docker-disabled.result != 'success' @@ -64,6 +66,27 @@ jobs: - run: make init - run: make pr + validate-schema: + name: Validate JSON schema + if: github.repository_owner == 'aws' + permissions: + pull-requests: write + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + name: Install Python 3.9 + with: + python-version: 3.9 + - run: make init + - run: | + diff <( cat schema/samcli.json ) <( python schema/make_schema.py; cat schema/samcli.json ) && exit 0 # exit if schema is unchanged + echo "The generated schema differs from that in the PR. Please run 'make schema'." + exit 1 + name: Generate and compare the schema + shell: bash + integration-tests: name: Integration Tests / ${{ matrix.os }} / ${{ matrix.python }} / ${{ matrix.tests_folder }} if: github.repository_owner == 'aws' diff --git a/.github/workflows/generate-schema.yml b/.github/workflows/generate-schema.yml deleted file mode 100644 index 9056a03ab4..0000000000 --- a/.github/workflows/generate-schema.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Generate SAM CLI JSON schema - -on: - schedule: - - cron: 30 15 * * 1-5 # 8:30am PST Monday-Friday - -jobs: - generateSchema: - permissions: - pull-requests: write - contents: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - name: Checkout latest AWS SAM CLI commit - with: - repository: 'aws/aws-sam-cli' - ref: 'develop' - path: 'aws-sam-cli-develop' - - uses: actions/setup-python@v4 - name: Install Python 3.9 - with: - python-version: 3.9 - - run: | - make -C aws-sam-cli-develop init - cd aws-sam-cli-develop - diff <( cat schema/samcli.json ) <( python schema/make_schema.py; cat schema/samcli.json ) && exit 0 # exit if schema is unchanged - echo "is_schema_changed=1" >> $GITHUB_ENV - git config --global user.email "action@github.com" - git config --global user.name "GitHub Action" - git checkout -b update-schema - git status - git add schema/samcli.json - git commit -m "chore: Update JSON schema" && exit 0 - name: Generate the schema - shell: bash - - name: Raise PR to update JSON schema - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: ${{ env.is_schema_changed == 1 }} # run only if there was a change - run: | - cd aws-sam-cli-develop - git push --force origin update-schema - gh pr list --repo aws/aws-sam-cli --head update-schema --json id --jq length | grep 1 && exit 0 # exit if there is existing pr - gh pr create --base develop --head update-schema --title "chore: Update JSON schema" --body "This PR & commit are automatically created by the SAM CLI repo to update the JSON schema with the latest changes." --label "pr/internal" --label "area/schema" - diff --git a/Makefile b/Makefile index 23e1bf8217..f12f34df84 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ # environment variable. SAM_CLI_TELEMETRY ?= 0 +.PHONY: schema + init: SAM_CLI_DEV=1 pip install -e '.[dev]' @@ -50,8 +52,11 @@ black-check: format: black ruff samcli --fix +schema: + python schema/make_schema.py + # Verifications to run before sending a pull request -pr: init dev black-check +pr: init dev schema black-check # (jfuss) We updated to have two requirement files, one for mac and one for linux. This # is meant to be a short term fix when upgrading the Linux installer to be python3.11 from diff --git a/schema/make_schema.py b/schema/make_schema.py index e1d7e889cf..6b13be3022 100644 --- a/schema/make_schema.py +++ b/schema/make_schema.py @@ -60,7 +60,7 @@ def to_schema(self) -> Dict[str, Any]: if self.choices: if isinstance(self.choices, list): self.choices.sort() - param.update({"enum": self.choices}) + # param.update({"enum": self.choices}) return param diff --git a/schema/samcli.json b/schema/samcli.json index cbe8ee4fce..fb812ad5e3 100644 --- a/schema/samcli.json +++ b/schema/samcli.json @@ -34,11 +34,7 @@ "architecture": { "title": "architecture", "type": "string", - "description": "Architectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']", - "enum": [ - "arm64", - "x86_64" - ] + "description": "Architectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']" }, "location": { "title": "location", @@ -48,76 +44,22 @@ "runtime": { "title": "runtime", "type": "string", - "description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java17, java11, java8.al2, java8, nodejs18.x, nodejs16.x, nodejs14.x, nodejs12.x, provided, provided.al2, python3.9, python3.8, python3.7, python3.11, python3.10, ruby3.2, ruby2.7", - "enum": [ - "dotnet6", - "go1.x", - "java11", - "java17", - "java8", - "java8.al2", - "nodejs12.x", - "nodejs14.x", - "nodejs16.x", - "nodejs18.x", - "provided", - "provided.al2", - "python3.10", - "python3.11", - "python3.7", - "python3.8", - "python3.9", - "ruby2.7", - "ruby3.2" - ] + "description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java17, java11, java8.al2, java8, nodejs18.x, nodejs16.x, nodejs14.x, nodejs12.x, provided, provided.al2, python3.9, python3.8, python3.7, python3.11, python3.10, ruby3.2, ruby2.7" }, "package_type": { "title": "package_type", "type": "string", - "description": "Lambda deployment package type.\n\nPackage Types: Zip, Image", - "enum": [ - "Image", - "Zip" - ] + "description": "Lambda deployment package type.\n\nPackage Types: Zip, Image" }, "base_image": { "title": "base_image", "type": "string", - "description": "Lambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs12.x-base, amazon/nodejs14.x-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby2.7-base, amazon/ruby3.2-base", - "enum": [ - "amazon/dotnet6-base", - "amazon/go-provided.al2-base", - "amazon/go1.x-base", - "amazon/java11-base", - "amazon/java17-base", - "amazon/java8-base", - "amazon/java8.al2-base", - "amazon/nodejs12.x-base", - "amazon/nodejs14.x-base", - "amazon/nodejs16.x-base", - "amazon/nodejs18.x-base", - "amazon/python3.10-base", - "amazon/python3.11-base", - "amazon/python3.7-base", - "amazon/python3.8-base", - "amazon/python3.9-base", - "amazon/ruby2.7-base", - "amazon/ruby3.2-base" - ] + "description": "Lambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs12.x-base, amazon/nodejs14.x-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby2.7-base, amazon/ruby3.2-base" }, "dependency_manager": { "title": "dependency_manager", "type": "string", - "description": "Dependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip", - "enum": [ - "bundler", - "cli-package", - "gradle", - "maven", - "mod", - "npm", - "pip" - ] + "description": "Dependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip" }, "output_dir": { "title": "output_dir", @@ -272,11 +214,7 @@ "title": "mount_with", "type": "string", "description": "Specify mount mode for building functions/layers inside container. If it is mounted with write permissions, some files in source code directory may be changed/added by the build process. By default the source code directory is read only.", - "default": "READ", - "enum": [ - "READ", - "WRITE" - ] + "default": "READ" }, "build_dir": { "title": "build_dir", @@ -622,11 +560,7 @@ "warm_containers": { "title": "warm_containers", "type": "string", - "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations.", - "enum": [ - "EAGER", - "LAZY" - ] + "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations." }, "debug_function": { "title": "debug_function", @@ -803,11 +737,7 @@ "warm_containers": { "title": "warm_containers", "type": "string", - "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations.", - "enum": [ - "EAGER", - "LAZY" - ] + "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations." }, "debug_function": { "title": "debug_function", @@ -1013,12 +943,7 @@ "title": "on_failure", "type": "string", "description": "Provide an action to determine what will happen when a stack fails to create. Three actions are available:\n\n- ROLLBACK: This will rollback a stack to a previous known good state.\n\n- DELETE: The stack will rollback to a previous state if one exists, otherwise the stack will be deleted.\n\n- DO_NOTHING: The stack will not rollback or delete, this is the same as disabling rollback.\n\nDefault behaviour is ROLLBACK.\n\n\n\nThis option is mutually exclusive with --disable-rollback/--no-disable-rollback. You can provide\n--on-failure or --disable-rollback/--no-disable-rollback but not both at the same time.", - "default": "ROLLBACK", - "enum": [ - "DELETE", - "DO_NOTHING", - "ROLLBACK" - ] + "default": "ROLLBACK" }, "stack_name": { "title": "stack_name", @@ -1259,11 +1184,7 @@ "output": { "title": "output", "type": "string", - "description": "The formatting style of the command output. Following options are available:\n\nTEXT: Prints information as regular text with some formatting (default option)\n\nJSON: Prints each line as JSON without formatting", - "enum": [ - "json", - "text" - ] + "description": "The formatting style of the command output. Following options are available:\n\nTEXT: Prints information as regular text with some formatting (default option)\n\nJSON: Prints each line as JSON without formatting" }, "end_time": { "title": "end_time", @@ -1372,11 +1293,7 @@ "output": { "title": "output", "type": "string", - "description": "The formatting style of the command output. Following options are available:\n\nTEXT: Prints information as regular text with some formatting (default option)\n\nJSON: Prints each line as JSON without formatting", - "enum": [ - "json", - "text" - ] + "description": "The formatting style of the command output. Following options are available:\n\nTEXT: Prints information as regular text with some formatting (default option)\n\nJSON: Prints each line as JSON without formatting" }, "end_time": { "title": "end_time", @@ -1449,19 +1366,7 @@ "resource": { "title": "resource", "type": "string", - "description": "Sync code for all resources of the given resource type. Accepted values are ['AWS::Serverless::Function', 'AWS::Lambda::Function', 'AWS::Serverless::LayerVersion', 'AWS::Lambda::LayerVersion', 'AWS::Serverless::Api', 'AWS::ApiGateway::RestApi', 'AWS::Serverless::HttpApi', 'AWS::ApiGatewayV2::Api', 'AWS::Serverless::StateMachine', 'AWS::StepFunctions::StateMachine']", - "enum": [ - "AWS::ApiGateway::RestApi", - "AWS::ApiGatewayV2::Api", - "AWS::Lambda::Function", - "AWS::Lambda::LayerVersion", - "AWS::Serverless::Api", - "AWS::Serverless::Function", - "AWS::Serverless::HttpApi", - "AWS::Serverless::LayerVersion", - "AWS::Serverless::StateMachine", - "AWS::StepFunctions::StateMachine" - ] + "description": "Sync code for all resources of the given resource type. Accepted values are ['AWS::Serverless::Function', 'AWS::Lambda::Function', 'AWS::Serverless::LayerVersion', 'AWS::Lambda::LayerVersion', 'AWS::Serverless::Api', 'AWS::ApiGateway::RestApi', 'AWS::Serverless::HttpApi', 'AWS::ApiGatewayV2::Api', 'AWS::Serverless::StateMachine', 'AWS::StepFunctions::StateMachine']" }, "dependency_layer": { "title": "dependency_layer", @@ -1665,11 +1570,7 @@ "title": "permissions_provider", "type": "string", "description": "Choose a permissions provider to assume the pipeline execution role. Default is to use an IAM User.", - "default": "iam", - "enum": [ - "iam", - "oidc" - ] + "default": "iam" }, "oidc_provider_url": { "title": "oidc_provider_url", @@ -1699,12 +1600,7 @@ "oidc_provider": { "title": "oidc_provider", "type": "string", - "description": "The name of the CI/CD system that will be used for OIDC permissions Currently supported CI/CD systems are : GitLab, GitHub and Bitbucket", - "enum": [ - "bitbucket-pipelines", - "github-actions", - "gitlab" - ] + "description": "The name of the CI/CD system that will be used for OIDC permissions Currently supported CI/CD systems are : GitLab, GitHub and Bitbucket" }, "gitlab_group": { "title": "gitlab_group", @@ -1813,11 +1709,7 @@ "title": "output", "type": "string", "description": "Output the results from the command in a given output format (json or table).", - "default": "table", - "enum": [ - "json", - "table" - ] + "default": "table" }, "template_file": { "title": "template_file", @@ -1870,11 +1762,7 @@ "title": "output", "type": "string", "description": "Output the results from the command in a given output format (json or table).", - "default": "table", - "enum": [ - "json", - "table" - ] + "default": "table" }, "profile": { "title": "profile", @@ -1932,11 +1820,7 @@ "title": "output", "type": "string", "description": "Output the results from the command in a given output format (json or table).", - "default": "table", - "enum": [ - "json", - "table" - ] + "default": "table" }, "template_file": { "title": "template_file", @@ -2014,11 +1898,7 @@ "title": "output", "type": "string", "description": "Output the results from the command in a given output format. The text format prints a readable AWS API response. The json format prints the full AWS API response.", - "default": "text", - "enum": [ - "json", - "text" - ] + "default": "text" }, "parameter": { "title": "parameter", From 3388f21f58985f94cf933439f68f9e8116e439f9 Mon Sep 17 00:00:00 2001 From: Leonardo Gama Date: Wed, 2 Aug 2023 14:43:56 -0700 Subject: [PATCH 3/4] oops broke the schema lmao --- schema/make_schema.py | 2 +- schema/samcli.json | 156 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 139 insertions(+), 19 deletions(-) diff --git a/schema/make_schema.py b/schema/make_schema.py index 6b13be3022..e1d7e889cf 100644 --- a/schema/make_schema.py +++ b/schema/make_schema.py @@ -60,7 +60,7 @@ def to_schema(self) -> Dict[str, Any]: if self.choices: if isinstance(self.choices, list): self.choices.sort() - # param.update({"enum": self.choices}) + param.update({"enum": self.choices}) return param diff --git a/schema/samcli.json b/schema/samcli.json index fb812ad5e3..cbe8ee4fce 100644 --- a/schema/samcli.json +++ b/schema/samcli.json @@ -34,7 +34,11 @@ "architecture": { "title": "architecture", "type": "string", - "description": "Architectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']" + "description": "Architectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']", + "enum": [ + "arm64", + "x86_64" + ] }, "location": { "title": "location", @@ -44,22 +48,76 @@ "runtime": { "title": "runtime", "type": "string", - "description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java17, java11, java8.al2, java8, nodejs18.x, nodejs16.x, nodejs14.x, nodejs12.x, provided, provided.al2, python3.9, python3.8, python3.7, python3.11, python3.10, ruby3.2, ruby2.7" + "description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java17, java11, java8.al2, java8, nodejs18.x, nodejs16.x, nodejs14.x, nodejs12.x, provided, provided.al2, python3.9, python3.8, python3.7, python3.11, python3.10, ruby3.2, ruby2.7", + "enum": [ + "dotnet6", + "go1.x", + "java11", + "java17", + "java8", + "java8.al2", + "nodejs12.x", + "nodejs14.x", + "nodejs16.x", + "nodejs18.x", + "provided", + "provided.al2", + "python3.10", + "python3.11", + "python3.7", + "python3.8", + "python3.9", + "ruby2.7", + "ruby3.2" + ] }, "package_type": { "title": "package_type", "type": "string", - "description": "Lambda deployment package type.\n\nPackage Types: Zip, Image" + "description": "Lambda deployment package type.\n\nPackage Types: Zip, Image", + "enum": [ + "Image", + "Zip" + ] }, "base_image": { "title": "base_image", "type": "string", - "description": "Lambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs12.x-base, amazon/nodejs14.x-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby2.7-base, amazon/ruby3.2-base" + "description": "Lambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs12.x-base, amazon/nodejs14.x-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby2.7-base, amazon/ruby3.2-base", + "enum": [ + "amazon/dotnet6-base", + "amazon/go-provided.al2-base", + "amazon/go1.x-base", + "amazon/java11-base", + "amazon/java17-base", + "amazon/java8-base", + "amazon/java8.al2-base", + "amazon/nodejs12.x-base", + "amazon/nodejs14.x-base", + "amazon/nodejs16.x-base", + "amazon/nodejs18.x-base", + "amazon/python3.10-base", + "amazon/python3.11-base", + "amazon/python3.7-base", + "amazon/python3.8-base", + "amazon/python3.9-base", + "amazon/ruby2.7-base", + "amazon/ruby3.2-base" + ] }, "dependency_manager": { "title": "dependency_manager", "type": "string", - "description": "Dependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip" + "description": "Dependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip", + "enum": [ + "bundler", + "cli-package", + "gradle", + "maven", + "mod", + "npm", + "pip" + ] }, "output_dir": { "title": "output_dir", @@ -214,7 +272,11 @@ "title": "mount_with", "type": "string", "description": "Specify mount mode for building functions/layers inside container. If it is mounted with write permissions, some files in source code directory may be changed/added by the build process. By default the source code directory is read only.", - "default": "READ" + "default": "READ", + "enum": [ + "READ", + "WRITE" + ] }, "build_dir": { "title": "build_dir", @@ -560,7 +622,11 @@ "warm_containers": { "title": "warm_containers", "type": "string", - "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations." + "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations.", + "enum": [ + "EAGER", + "LAZY" + ] }, "debug_function": { "title": "debug_function", @@ -737,7 +803,11 @@ "warm_containers": { "title": "warm_containers", "type": "string", - "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations." + "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations.", + "enum": [ + "EAGER", + "LAZY" + ] }, "debug_function": { "title": "debug_function", @@ -943,7 +1013,12 @@ "title": "on_failure", "type": "string", "description": "Provide an action to determine what will happen when a stack fails to create. Three actions are available:\n\n- ROLLBACK: This will rollback a stack to a previous known good state.\n\n- DELETE: The stack will rollback to a previous state if one exists, otherwise the stack will be deleted.\n\n- DO_NOTHING: The stack will not rollback or delete, this is the same as disabling rollback.\n\nDefault behaviour is ROLLBACK.\n\n\n\nThis option is mutually exclusive with --disable-rollback/--no-disable-rollback. You can provide\n--on-failure or --disable-rollback/--no-disable-rollback but not both at the same time.", - "default": "ROLLBACK" + "default": "ROLLBACK", + "enum": [ + "DELETE", + "DO_NOTHING", + "ROLLBACK" + ] }, "stack_name": { "title": "stack_name", @@ -1184,7 +1259,11 @@ "output": { "title": "output", "type": "string", - "description": "The formatting style of the command output. Following options are available:\n\nTEXT: Prints information as regular text with some formatting (default option)\n\nJSON: Prints each line as JSON without formatting" + "description": "The formatting style of the command output. Following options are available:\n\nTEXT: Prints information as regular text with some formatting (default option)\n\nJSON: Prints each line as JSON without formatting", + "enum": [ + "json", + "text" + ] }, "end_time": { "title": "end_time", @@ -1293,7 +1372,11 @@ "output": { "title": "output", "type": "string", - "description": "The formatting style of the command output. Following options are available:\n\nTEXT: Prints information as regular text with some formatting (default option)\n\nJSON: Prints each line as JSON without formatting" + "description": "The formatting style of the command output. Following options are available:\n\nTEXT: Prints information as regular text with some formatting (default option)\n\nJSON: Prints each line as JSON without formatting", + "enum": [ + "json", + "text" + ] }, "end_time": { "title": "end_time", @@ -1366,7 +1449,19 @@ "resource": { "title": "resource", "type": "string", - "description": "Sync code for all resources of the given resource type. Accepted values are ['AWS::Serverless::Function', 'AWS::Lambda::Function', 'AWS::Serverless::LayerVersion', 'AWS::Lambda::LayerVersion', 'AWS::Serverless::Api', 'AWS::ApiGateway::RestApi', 'AWS::Serverless::HttpApi', 'AWS::ApiGatewayV2::Api', 'AWS::Serverless::StateMachine', 'AWS::StepFunctions::StateMachine']" + "description": "Sync code for all resources of the given resource type. Accepted values are ['AWS::Serverless::Function', 'AWS::Lambda::Function', 'AWS::Serverless::LayerVersion', 'AWS::Lambda::LayerVersion', 'AWS::Serverless::Api', 'AWS::ApiGateway::RestApi', 'AWS::Serverless::HttpApi', 'AWS::ApiGatewayV2::Api', 'AWS::Serverless::StateMachine', 'AWS::StepFunctions::StateMachine']", + "enum": [ + "AWS::ApiGateway::RestApi", + "AWS::ApiGatewayV2::Api", + "AWS::Lambda::Function", + "AWS::Lambda::LayerVersion", + "AWS::Serverless::Api", + "AWS::Serverless::Function", + "AWS::Serverless::HttpApi", + "AWS::Serverless::LayerVersion", + "AWS::Serverless::StateMachine", + "AWS::StepFunctions::StateMachine" + ] }, "dependency_layer": { "title": "dependency_layer", @@ -1570,7 +1665,11 @@ "title": "permissions_provider", "type": "string", "description": "Choose a permissions provider to assume the pipeline execution role. Default is to use an IAM User.", - "default": "iam" + "default": "iam", + "enum": [ + "iam", + "oidc" + ] }, "oidc_provider_url": { "title": "oidc_provider_url", @@ -1600,7 +1699,12 @@ "oidc_provider": { "title": "oidc_provider", "type": "string", - "description": "The name of the CI/CD system that will be used for OIDC permissions Currently supported CI/CD systems are : GitLab, GitHub and Bitbucket" + "description": "The name of the CI/CD system that will be used for OIDC permissions Currently supported CI/CD systems are : GitLab, GitHub and Bitbucket", + "enum": [ + "bitbucket-pipelines", + "github-actions", + "gitlab" + ] }, "gitlab_group": { "title": "gitlab_group", @@ -1709,7 +1813,11 @@ "title": "output", "type": "string", "description": "Output the results from the command in a given output format (json or table).", - "default": "table" + "default": "table", + "enum": [ + "json", + "table" + ] }, "template_file": { "title": "template_file", @@ -1762,7 +1870,11 @@ "title": "output", "type": "string", "description": "Output the results from the command in a given output format (json or table).", - "default": "table" + "default": "table", + "enum": [ + "json", + "table" + ] }, "profile": { "title": "profile", @@ -1820,7 +1932,11 @@ "title": "output", "type": "string", "description": "Output the results from the command in a given output format (json or table).", - "default": "table" + "default": "table", + "enum": [ + "json", + "table" + ] }, "template_file": { "title": "template_file", @@ -1898,7 +2014,11 @@ "title": "output", "type": "string", "description": "Output the results from the command in a given output format. The text format prints a readable AWS API response. The json format prints the full AWS API response.", - "default": "text" + "default": "text", + "enum": [ + "json", + "text" + ] }, "parameter": { "title": "parameter", From 7c035a295d7239a9a5f3f26f87e506dfba8cf2c6 Mon Sep 17 00:00:00 2001 From: Leonardo Gama Date: Wed, 2 Aug 2023 16:55:12 -0700 Subject: [PATCH 4/4] Support latest version of Python --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2699b01295..50de9abd7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,9 +76,9 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 - name: Install Python 3.9 + name: Install Python 3.11 with: - python-version: 3.9 + python-version: 3.11 - run: make init - run: | diff <( cat schema/samcli.json ) <( python schema/make_schema.py; cat schema/samcli.json ) && exit 0 # exit if schema is unchanged