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

chore: Remove ruby2.7 support #6674

Merged
merged 4 commits into from
Feb 9, 2024
Merged
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
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: '1.19'
- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
mndeveci marked this conversation as resolved.
Show resolved Hide resolved
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
Expand Down
2 changes: 1 addition & 1 deletion designs/per_command_help_text.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ Usage: sam build [OPTIONS] [RESOURCE_LOGICAL_ID]

2. Nodejs 18.x, 16.x, 14.x, 12.x using NPM

3. Ruby 2.7 using Bundler
3. Ruby3.2 using Bundler

4. Java 8, Java 11 using Gradle and Maven

Expand Down
2 changes: 1 addition & 1 deletion samcli/commands/build/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
------------------
1. Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12 using PIP\n
2. Nodejs 20.x, 18.x, 16.x, 14.x, 12.x using NPM\n
3. Ruby 2.7, 3.2 using Bundler\n
3. Ruby 3.2 using Bundler\n
4. Java 8, Java 11, Java 17, Java 21 using Gradle and Maven\n
5. Dotnet6 using Dotnet CLI (without --use-container)\n
6. Go 1.x using Go Modules (without --use-container)\n
Expand Down
1 change: 1 addition & 0 deletions samcli/lib/build/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"python2.7",
"python3.6",
"ruby2.5",
"ruby2.7",
}
BUILD_PROPERTIES = "BuildProperties"
2 changes: 0 additions & 2 deletions samcli/lib/build/workflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def get_layer_subfolder(build_workflow: str) -> str:
"nodejs16.x": "nodejs",
"nodejs18.x": "nodejs",
"nodejs20.x": "nodejs",
"ruby2.7": "ruby/lib",
"ruby3.2": "ruby/lib",
"java8": "java",
"java11": "java",
Expand Down Expand Up @@ -162,7 +161,6 @@ def get_workflow_config(
"nodejs16.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
"nodejs18.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
"nodejs20.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
"ruby2.7": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
"ruby3.2": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
"dotnet6": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
"go1.x": BasicWorkflowSelector(GO_MOD_CONFIG),
Expand Down
10 changes: 0 additions & 10 deletions samcli/lib/init/local_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,5 @@
"packageType": "Zip",
"useCaseName": "Hello World Example"
}
],
"ruby2.7": [
{
"directory": "template/cookiecutter-aws-sam-hello-ruby",
"displayName": "Hello World Example",
"dependencyManager": "bundler",
"appTemplate": "hello-world",
"packageType": "Zip",
"useCaseName": "Hello World Example"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A cookiecutter template to create a Ruby Hello world boilerplate using [Serverle

Generate a boilerplate template in your current project directory using the following syntax:

* **Ruby 2.5**: `sam init --runtime ruby2.5`
* **Ruby 3.2**: `sam init --runtime ruby3.2`

> **NOTE**: ``--name`` allows you to specify a different project folder name (`sam-app` is the default)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"project_name": "Name of the project",
"runtime": "ruby2.5",
"runtime": "ruby3.2",
"architectures": {
"value": [
"x86_64"
Expand Down
1 change: 0 additions & 1 deletion samcli/lib/utils/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"python3.10": [ARM64, X86_64],
"python3.11": [ARM64, X86_64],
"python3.12": [ARM64, X86_64],
"ruby2.7": [ARM64, X86_64],
"ruby3.2": [ARM64, X86_64],
"java8": [X86_64],
"java8.al2": [ARM64, X86_64],
Expand Down
4 changes: 1 addition & 3 deletions samcli/local/common/runtime_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],
"ruby": [
{
"runtimes": ["ruby3.2", "ruby2.7"],
"runtimes": ["ruby3.2"],
"dependency_manager": "bundler",
"init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-ruby"),
"build": True,
Expand Down Expand Up @@ -124,7 +124,6 @@ def get_local_lambda_images_location(mapping, runtime):
"python3.7",
# ruby runtimes in descending order
"ruby3.2",
"ruby2.7",
]


Expand All @@ -148,7 +147,6 @@ def get_local_lambda_images_location(mapping, runtime):
"python3.8": "amazon/python3.8-base",
"python3.7": "amazon/python3.7-base",
"ruby3.2": "amazon/ruby3.2-base",
"ruby2.7": "amazon/ruby2.7-base",
}

LAMBDA_IMAGES_RUNTIMES: List = sorted(list(set(LAMBDA_IMAGES_RUNTIMES_MAP.values())))
Expand Down
1 change: 0 additions & 1 deletion samcli/local/docker/lambda_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class Runtime(Enum):
python310 = "python3.10"
python311 = "python3.11"
python312 = "python3.12"
ruby27 = "ruby2.7"
ruby32 = "ruby3.2"
java8 = "java8"
java8al2 = "java8.al2"
Expand Down
8 changes: 3 additions & 5 deletions schema/samcli.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"properties": {
"parameters": {
"title": "Parameters for the init command",
"description": "Available parameters for the init command:\n* no_interactive:\nDisable interactive prompting for init parameters. (fail if any required values are missing)\n* architecture:\nArchitectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']\n* location:\nTemplate location (git, mercurial, http(s), zip, path).\n* runtime:\nLambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2, ruby2.7\n* package_type:\nLambda deployment package type.\n\nPackage Types: Zip, Image\n* base_image:\nLambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby2.7-base, amazon/ruby3.2-base\n* dependency_manager:\nDependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip\n* output_dir:\nDirectory to initialize AWS SAM application.\n* name:\nName of AWS SAM Application.\n* app_template:\nIdentifier of the managed application template to be used. Alternatively, run '$sam init' without options for an interactive workflow.\n* no_input:\nDisable Cookiecutter prompting and accept default values defined in the cookiecutter config.\n* extra_context:\nOverride custom parameters in the template's cookiecutter.json configuration e.g. {\"customParam1\": \"customValue1\", \"customParam2\":\"customValue2\"}\n* tracing:\nEnable AWS X-Ray tracing for application.\n* application_insights:\nEnable CloudWatch Application Insights monitoring for application.\n* structured_logging:\nEnable Structured Logging for application.\n* beta_features:\nEnable/Disable beta features.\n* debug:\nTurn on debug logging to print debug message generated by AWS SAM CLI and display timestamps.\n* save_params:\nSave the parameters provided via the command line to the configuration file.",
"description": "Available parameters for the init command:\n* no_interactive:\nDisable interactive prompting for init parameters. (fail if any required values are missing)\n* architecture:\nArchitectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']\n* location:\nTemplate location (git, mercurial, http(s), zip, path).\n* runtime:\nLambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2\n* package_type:\nLambda deployment package type.\n\nPackage Types: Zip, Image\n* base_image:\nLambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base\n* dependency_manager:\nDependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip\n* output_dir:\nDirectory to initialize AWS SAM application.\n* name:\nName of AWS SAM Application.\n* app_template:\nIdentifier of the managed application template to be used. Alternatively, run '$sam init' without options for an interactive workflow.\n* no_input:\nDisable Cookiecutter prompting and accept default values defined in the cookiecutter config.\n* extra_context:\nOverride custom parameters in the template's cookiecutter.json configuration e.g. {\"customParam1\": \"customValue1\", \"customParam2\":\"customValue2\"}\n* tracing:\nEnable AWS X-Ray tracing for application.\n* application_insights:\nEnable CloudWatch Application Insights monitoring for application.\n* structured_logging:\nEnable Structured Logging for application.\n* beta_features:\nEnable/Disable beta features.\n* debug:\nTurn on debug logging to print debug message generated by AWS SAM CLI and display timestamps.\n* save_params:\nSave the parameters provided via the command line to the configuration file.",
"type": "object",
"properties": {
"no_interactive": {
Expand All @@ -48,7 +48,7 @@
"runtime": {
"title": "runtime",
"type": "string",
"description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2, ruby2.7",
"description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2",
"enum": [
"dotnet6",
"go1.x",
Expand All @@ -69,7 +69,6 @@
"python3.7",
"python3.8",
"python3.9",
"ruby2.7",
"ruby3.2"
]
},
Expand All @@ -85,7 +84,7 @@
"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/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-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/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base",
"enum": [
"amazon/dotnet6-base",
"amazon/go-provided.al2-base",
Expand All @@ -105,7 +104,6 @@
"amazon/python3.7-base",
"amazon/python3.8-base",
"amazon/python3.9-base",
"amazon/ruby2.7-base",
"amazon/ruby3.2-base"
]
},
Expand Down
22 changes: 11 additions & 11 deletions tests/integration/buildcmd/test_build_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,25 +798,25 @@ def test_building_default_package_json(self, runtime, use_container, architectur


class TestBuildCommand_RubyFunctions(BuildIntegRubyBase):
@parameterized.expand(["ruby2.7", "ruby3.2"])
@parameterized.expand(["ruby3.2"])
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
def test_building_ruby_in_container(self, runtime):
self._test_with_default_gemfile(runtime, "use_container", "Ruby", self.test_data_path)

@parameterized.expand(["ruby2.7", "ruby3.2"])
@parameterized.expand(["ruby3.2"])
def test_building_ruby_in_process(self, runtime):
self._test_with_default_gemfile(runtime, False, "Ruby", self.test_data_path)


class TestBuildCommand_RubyFunctions_With_Architecture(BuildIntegRubyBase):
template = "template_with_architecture.yaml"

@parameterized.expand([("ruby2.7", "Ruby"), ("ruby3.2", "Ruby32")])
@parameterized.expand([("ruby3.2", "Ruby32")])
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
def test_building_ruby_in_container_with_specified_architecture(self, runtime, codeuri):
self._test_with_default_gemfile(runtime, "use_container", codeuri, self.test_data_path, "x86_64")

@parameterized.expand([("ruby2.7", "Ruby"), ("ruby3.2", "Ruby32")])
@parameterized.expand([("ruby3.2", "Ruby32")])
def test_building_ruby_in_process_with_specified_architecture(self, runtime, codeuri):
self._test_with_default_gemfile(runtime, False, codeuri, self.test_data_path, "x86_64")

Expand All @@ -827,7 +827,7 @@ class TestBuildCommand_RubyFunctionsWithGemfileInTheRoot(BuildIntegRubyBase):
This doesn't apply to containerized build, since it copies only the function folder to the container
"""

@parameterized.expand([("ruby2.7"), ("ruby3.2")])
@parameterized.expand([("ruby3.2")])
def test_building_ruby_in_process_with_root_gemfile(self, runtime):
self._prepare_application_environment()
self._test_with_default_gemfile(runtime, False, "RubyWithRootGemfile", self.working_dir)
Expand Down Expand Up @@ -2130,12 +2130,12 @@ class TestBuildWithDedupBuilds(DedupBuildIntegBase):
(False, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"),
(False, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
(False, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"),
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
# container
(True, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"),
(True, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
(True, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"),
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
]
)
def test_dedup_build(self, use_container, code_uri, function1_handler, function2_handler, runtime):
Expand Down Expand Up @@ -2249,12 +2249,12 @@ class TestBuildWithCacheBuilds(CachedBuildIntegBase):
(False, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"),
(False, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
(False, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"),
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
# container
(True, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"),
(True, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
(True, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"),
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
]
)
def test_cache_build(self, use_container, code_uri, function1_handler, function2_handler, runtime):
Expand Down Expand Up @@ -2428,12 +2428,12 @@ class TestParallelBuilds(DedupBuildIntegBase):
(False, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"),
(False, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
(False, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"),
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
# container
(True, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"),
(True, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
(True, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"),
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
]
)
def test_dedup_build(self, use_container, code_uri, function1_handler, function2_handler, runtime):
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/buildcmd/test_build_cmd_arm64.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ def test_building_default_package_json(self, runtime, use_container):
class TestBuildCommand_RubyFunctions_With_Architecture_arm64(BuildIntegRubyBase):
template = "template_with_architecture.yaml"

@parameterized.expand([("ruby2.7", "Ruby"), ("ruby3.2", "Ruby32")])
@parameterized.expand([("ruby3.2", "Ruby32")])
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
def test_building_ruby_in_container_with_specified_architecture(self, runtime, code_uri):
self._test_with_default_gemfile(runtime, "use_container", code_uri, self.test_data_path, ARM64)

@parameterized.expand([("ruby2.7", "Ruby"), ("ruby3.2", "Ruby32")])
@parameterized.expand([("ruby3.2", "Ruby32")])
def test_building_ruby_in_process_with_specified_architecture(self, runtime, code_uri):
self._test_with_default_gemfile(runtime, False, code_uri, self.test_data_path, ARM64)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

ruby '~> 2.7.0'
ruby '~> 3.2.0'
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Resources:
Properties:
CodeUri: ruby
Handler: app.lambda_handler
Runtime: ruby2.7
Runtime: ruby3.2
NodeStsExample:
Type: AWS::Serverless::Function
Properties:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/validate/test_validate_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ def test_lint_supported_runtimes(self):
"provided",
"provided.al2",
"provided.al2023",
"ruby3.2",
"python3.7",
"python3.8",
"python3.9",
"python3.10",
"ruby2.7",
hnnasit marked this conversation as resolved.
Show resolved Hide resolved
]
i = 0
for runtime in supported_runtimes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Resources:
CompatibleRuntimes:
- nodejs18.x
- python3.9
- ruby2.7
- ruby3.2
- java8
- go1.x
ContentUri:
Expand Down
Loading
Loading