diff --git a/samcli/commands/_utils/experimental.py b/samcli/commands/_utils/experimental.py index 51dcfb44d0..3d0acbaa32 100644 --- a/samcli/commands/_utils/experimental.py +++ b/samcli/commands/_utils/experimental.py @@ -43,7 +43,6 @@ class ExperimentalFlag: """Class for storing all experimental related ConfigEntries""" All = ExperimentalEntry("experimentalAll", EXPERIMENTAL_ENV_VAR_PREFIX + "FEATURES") - Accelerate = ExperimentalEntry("experimentalAccelerate", EXPERIMENTAL_ENV_VAR_PREFIX + "ACCELERATE") Esbuild = ExperimentalEntry("experimentalEsbuild", EXPERIMENTAL_ENV_VAR_PREFIX + "ESBUILD") diff --git a/samcli/commands/_utils/options.py b/samcli/commands/_utils/options.py index cc849f351b..99bc153b02 100644 --- a/samcli/commands/_utils/options.py +++ b/samcli/commands/_utils/options.py @@ -367,12 +367,11 @@ def common_observability_click_options(): "-t", is_flag=True, help="Tail events. This will ignore the end time argument and continue to fetch events as they " - "become available. [Beta Feature] If in beta --tail without a --name will pull from all possible resources", + "become available. If --tail without a --name will pull from all possible resources", ), click.option( "--output", help=""" - [Beta Feature] The formatting style of the command output. Following options are available:\n TEXT: Prints information as regular text with some formatting (default option)\n JSON: Prints each line as JSON without formatting diff --git a/samcli/commands/logs/command.py b/samcli/commands/logs/command.py index 71a228df2f..292bda722a 100644 --- a/samcli/commands/logs/command.py +++ b/samcli/commands/logs/command.py @@ -8,12 +8,6 @@ from samcli.cli.cli_config_file import configuration_option, TomlProvider from samcli.cli.main import pass_context, common_options as cli_framework_options, aws_creds_options, print_cmdline_args -from samcli.commands._utils.experimental import ( - ExperimentalFlag, - force_experimental_option, - experimental, - prompt_experimental, -) from samcli.commands._utils.options import common_observability_options from samcli.commands.logs.validation_and_exception_handlers import ( SAM_LOGS_ADDITIONAL_EXCEPTION_HANDLERS, @@ -44,8 +38,6 @@ Use the --filter option to quickly find logs that match terms, phrases or values in your log events. $ sam logs -n HelloWorldFunction --stack-name mystack --filter "error" \n \b -[Beta Features] -\b You can now fetch logs from supported resources, by only providing --stack-name parameter $ sam logs --stack-name mystack \n \b @@ -81,27 +73,22 @@ "--include-traces", "-i", is_flag=True, - help="[Beta Feature] Include the XRay traces in the log output.", + help="Include the XRay traces in the log output.", ) @click.option( "--cw-log-group", multiple=True, - help="[Beta Feature] " - "Additional CloudWatch Log group names that are not auto-discovered based upon --name parameter. " + help="Additional CloudWatch Log group names that are not auto-discovered based upon --name parameter. " "When provided, it will only tail the given CloudWatch Log groups. If you want to tail log groups related " "to resources, please also provide their names as well", ) @common_observability_options -@experimental @cli_framework_options @aws_creds_options @pass_context @track_command @check_newer_version @print_cmdline_args -@force_experimental_option("include_traces", config_entry=ExperimentalFlag.Accelerate) # pylint: disable=E1120 -@force_experimental_option("cw_log_group", config_entry=ExperimentalFlag.Accelerate) # pylint: disable=E1120 -@force_experimental_option("output", config_entry=ExperimentalFlag.Accelerate) # pylint: disable=E1120 @command_exception_handler(SAM_LOGS_ADDITIONAL_EXCEPTION_HANDLERS) @stack_name_cw_log_group_validation def cli( @@ -162,10 +149,7 @@ def do_cli( from samcli.lib.observability.util import OutputOption from samcli.lib.utils.boto_utils import get_boto_client_provider_with_config, get_boto_resource_provider_with_config - if not names or len(names) > 1: - if not prompt_experimental(ExperimentalFlag.Accelerate): - return - else: + if names and len(names) <= 1: click.echo( "You can now use 'sam logs' without --name parameter, " "which will pull the logs from all supported resources in your stack." diff --git a/samcli/commands/sync/command.py b/samcli/commands/sync/command.py index 5d0e9cc3be..6902beebc2 100644 --- a/samcli/commands/sync/command.py +++ b/samcli/commands/sync/command.py @@ -44,13 +44,6 @@ ) from samcli.cli.context import Context from samcli.lib.sync.watch_manager import WatchManager -from samcli.commands._utils.experimental import ( - ExperimentalFlag, - experimental, - is_experimental_enabled, - set_experimental, - update_experimental_context, -) if TYPE_CHECKING: # pragma: no cover from samcli.commands.deploy.deploy_context import DeployContext @@ -60,7 +53,7 @@ LOG = logging.getLogger(__name__) HELP_TEXT = """ -[Beta Feature] Update/Sync local artifacts to AWS +Update/Sync local artifacts to AWS By default, the sync command runs a full stack update. You can specify --code or --watch to switch modes. \b @@ -77,20 +70,8 @@ Enter Y to proceed with the command, or enter N to cancel: """ -SYNC_CONFIRMATION_TEXT_WITH_BETA = """ -This feature is currently in beta. Visit the docs page to learn more about the AWS Beta terms https://aws.amazon.com/service-terms/. -The SAM CLI will use the AWS Lambda, Amazon API Gateway, and AWS StepFunctions APIs to upload your code without -performing a CloudFormation deployment. This will cause drift in your CloudFormation stack. -**The sync command should only be used against a development stack**. - -Confirm that you are synchronizing a development stack and want to turn on beta features. - -Enter Y to proceed with the command, or enter N to cancel: -""" - - -SHORT_HELP = "[Beta Feature] Sync a project to AWS" +SHORT_HELP = "Sync a project to AWS" DEFAULT_TEMPLATE_NAME = "template.yaml" DEFAULT_CAPABILITIES = ("CAPABILITY_NAMED_IAM", "CAPABILITY_AUTO_EXPAND") @@ -145,7 +126,6 @@ @notification_arns_option @tags_option @capabilities_option(default=DEFAULT_CAPABILITIES) # pylint: disable=E1120 -@experimental @pass_context @track_command @image_repository_validation @@ -242,17 +222,9 @@ def do_cli( from samcli.commands.package.package_context import PackageContext from samcli.commands.deploy.deploy_context import DeployContext - confirmation_text = SYNC_CONFIRMATION_TEXT - - if not is_experimental_enabled(ExperimentalFlag.Accelerate): - confirmation_text = SYNC_CONFIRMATION_TEXT_WITH_BETA - - if not click.confirm(Colored().yellow(confirmation_text), default=False): + if not click.confirm(Colored().yellow(SYNC_CONFIRMATION_TEXT), default=False): return - set_experimental(ExperimentalFlag.Accelerate) - update_experimental_context() - s3_bucket = manage_stack(profile=profile, region=region) build_dir = DEFAULT_BUILD_DIR_WITH_AUTO_DEPENDENCY_LAYER if dependency_layer else DEFAULT_BUILD_DIR diff --git a/samcli/commands/traces/command.py b/samcli/commands/traces/command.py index f5542582e6..ae5835cb84 100644 --- a/samcli/commands/traces/command.py +++ b/samcli/commands/traces/command.py @@ -12,16 +12,16 @@ from samcli.lib.observability.util import OutputOption from samcli.lib.telemetry.metric import track_command from samcli.lib.utils.version_checker import check_newer_version -from samcli.commands._utils.experimental import ExperimentalFlag, force_experimental + LOG = logging.getLogger(__name__) HELP_TEXT = """ -[Beta Feature] Use this command to fetch AWS X-Ray traces generated by your stack.\n +Use this command to fetch AWS X-Ray traces generated by your stack.\n """ -@click.command("traces", help=HELP_TEXT, short_help="[Beta Feature] Fetch AWS X-Ray traces") +@click.command("traces", help=HELP_TEXT, short_help="Fetch AWS X-Ray traces") @configuration_option(provider=TomlProvider(section="parameters")) @click.option( "--trace-id", @@ -31,7 +31,6 @@ ) @common_observability_options @cli_framework_options -@force_experimental(config_entry=ExperimentalFlag.Accelerate) # pylint: disable=E1120 @aws_creds_options @pass_context @track_command diff --git a/samcli/lib/build/build_strategy.py b/samcli/lib/build/build_strategy.py index c41ffd964a..9637bdee3b 100644 --- a/samcli/lib/build/build_strategy.py +++ b/samcli/lib/build/build_strategy.py @@ -10,7 +10,6 @@ from copy import deepcopy from typing import Callable, Dict, List, Any, Optional, cast, Set -from samcli.commands._utils.experimental import is_experimental_enabled, ExperimentalFlag from samcli.lib.utils import osutils from samcli.lib.utils.async_utils import AsyncContext from samcli.lib.utils.hash import dir_checksum @@ -163,7 +162,7 @@ def build_single_function_definition(self, build_definition: FunctionBuildDefini single_build_dir, build_definition.metadata, container_env_vars, - build_definition.dependencies_dir if is_experimental_enabled(ExperimentalFlag.Accelerate) else None, + build_definition.dependencies_dir, build_definition.download_dependencies, ) function_build_results[single_full_path] = result @@ -210,7 +209,7 @@ def build_single_layer_definition(self, layer_definition: LayerBuildDefinition) layer.build_architecture, single_build_dir, layer_definition.env_vars, - layer_definition.dependencies_dir if is_experimental_enabled(ExperimentalFlag.Accelerate) else None, + layer_definition.dependencies_dir, layer_definition.download_dependencies, ) } @@ -562,7 +561,7 @@ def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: @staticmethod def _is_incremental_build_supported(runtime: Optional[str]) -> bool: - if not runtime or not is_experimental_enabled(ExperimentalFlag.Accelerate): + if not runtime: return False for supported_runtime_prefix in CachedOrIncrementalBuildStrategyWrapper.SUPPORTED_RUNTIME_PREFIXES: diff --git a/samcli/lib/observability/cw_logs/cw_log_group_provider.py b/samcli/lib/observability/cw_logs/cw_log_group_provider.py index d42d4d17fc..6cf4c2dbaa 100644 --- a/samcli/lib/observability/cw_logs/cw_log_group_provider.py +++ b/samcli/lib/observability/cw_logs/cw_log_group_provider.py @@ -4,7 +4,6 @@ import logging from typing import Optional -from samcli.commands._utils.experimental import force_experimental, ExperimentalFlag from samcli.lib.utils.resources import ( AWS_LAMBDA_FUNCTION, AWS_APIGATEWAY_RESTAPI, @@ -53,7 +52,6 @@ def for_lambda_function(function_name: str) -> str: return "/aws/lambda/{}".format(function_name) @staticmethod - @force_experimental(config_entry=ExperimentalFlag.Accelerate) # pylint: disable=E1120 def for_apigw_rest_api(rest_api_id: str, stage: str = "Prod") -> str: """ Returns the CloudWatch Log Group Name created by default for the AWS Api gateway rest api with given id @@ -76,7 +74,6 @@ def for_apigw_rest_api(rest_api_id: str, stage: str = "Prod") -> str: return "API-Gateway-Execution-Logs_{}/{}".format(rest_api_id, stage) @staticmethod - @force_experimental(config_entry=ExperimentalFlag.Accelerate) # pylint: disable=E1120 def for_apigwv2_http_api( boto_client_provider: BotoProviderType, http_api_id: str, stage: str = "$default" ) -> Optional[str]: @@ -110,7 +107,6 @@ def for_apigwv2_http_api( return log_group_name @staticmethod - @force_experimental(config_entry=ExperimentalFlag.Accelerate) # pylint: disable=E1120 def for_step_functions( boto_client_provider: BotoProviderType, step_function_name: str, diff --git a/tests/integration/buildcmd/test_build_cmd.py b/tests/integration/buildcmd/test_build_cmd.py index 0d29fde5e6..1ec5248f8d 100644 --- a/tests/integration/buildcmd/test_build_cmd.py +++ b/tests/integration/buildcmd/test_build_cmd.py @@ -1653,9 +1653,9 @@ def test_no_cached_override_build(self): cmdlist = self.get_command_list(parameter_overrides=overrides) cmdlist.extend(["--config-file", config_file]) command_result = run_command(cmdlist, cwd=self.working_dir) - self.assertTrue( - "Valid cache found, copying previously built resources for following functions" - in str(command_result.stderr), + self.assertRegex( + str(command_result.stderr), + "Manifest is not changed for .* running incremental build", "Should have built using cache", ) cmdlist.extend(["--no-cached"]) diff --git a/tests/integration/telemetry/test_experimental_metric.py b/tests/integration/telemetry/test_experimental_metric.py index 36111ddf3a..d9a829054d 100644 --- a/tests/integration/telemetry/test_experimental_metric.py +++ b/tests/integration/telemetry/test_experimental_metric.py @@ -2,6 +2,7 @@ import platform import time from pathlib import Path +from unittest import skip from unittest.mock import ANY from .integ_base import IntegBase, TelemetryServer @@ -13,6 +14,10 @@ class TestExperimentalMetric(IntegBase): Validates the basic tenets/contract Telemetry module needs to adhere to """ + @skip( + "Accelerate are not in experimental any more, just skip this test. If we have new experimental commands, " + "we can update this test" + ) def test_must_send_experimental_metrics_if_experimental_command(self): """ Metrics should be sent if "Disabled via config file but Enabled via Envvar" @@ -53,7 +58,6 @@ def test_must_send_experimental_metrics_if_experimental_command(self): "region": ANY, "commandName": ANY, "metricSpecificAttributes": { - "experimentalAccelerate": True, "experimentalAll": False, "experimentalEsbuild": False, }, @@ -67,6 +71,10 @@ def test_must_send_experimental_metrics_if_experimental_command(self): self.assertEqual(request["data"], expected_data) os.environ["SAM_CLI_BETA_ACCELERATE"] = "0" + @skip( + "Accelerate are not in experimental any more, just skip this test. If we have new experimental commands, " + "we can update this test" + ) def test_must_send_experimental_metrics_if_experimental_option(self): """ Metrics should be sent if "Disabled via config file but Enabled via Envvar" @@ -104,7 +112,6 @@ def test_must_send_experimental_metrics_if_experimental_option(self): "region": ANY, "commandName": ANY, "metricSpecificAttributes": { - "experimentalAccelerate": True, "experimentalAll": True, "experimentalEsbuild": True, }, diff --git a/tests/unit/commands/_utils/test_experimental.py b/tests/unit/commands/_utils/test_experimental.py index 67709912cf..ed94cb35fc 100644 --- a/tests/unit/commands/_utils/test_experimental.py +++ b/tests/unit/commands/_utils/test_experimental.py @@ -59,13 +59,13 @@ def test_set_experimental(self): self.gc_mock.return_value.set_value.assert_called_once_with(config_entry, False, is_flag=True, flush=False) def test_get_all_experimental(self): - self.assertEqual(len(get_all_experimental()), 3) + self.assertEqual(len(get_all_experimental()), 2) def test_get_all_experimental_statues(self): - self.assertEqual(len(get_all_experimental_statues()), 3) + self.assertEqual(len(get_all_experimental_statues()), 2) def test_get_enabled_experimental_flags(self): - self.assertEqual(len(get_enabled_experimental_flags()), 3) + self.assertEqual(len(get_enabled_experimental_flags()), 2) @patch("samcli.commands._utils.experimental.set_experimental") @patch("samcli.commands._utils.experimental.get_all_experimental") diff --git a/tests/unit/commands/sync/test_command.py b/tests/unit/commands/sync/test_command.py index bebe5677e9..1474c92141 100644 --- a/tests/unit/commands/sync/test_command.py +++ b/tests/unit/commands/sync/test_command.py @@ -49,7 +49,6 @@ def setUp(self): @parameterized.expand([(False, False, True), (False, False, False)]) @patch("os.environ", {**os.environ, "SAM_CLI_POLL_DELAY": 10}) - @patch("samcli.commands.sync.command.update_experimental_context") @patch("samcli.commands.sync.command.click") @patch("samcli.commands.sync.command.execute_code_sync") @patch("samcli.commands.build.command.click") @@ -75,7 +74,6 @@ def test_infra_must_succeed_sync( mock_build_click, execute_code_sync_mock, click_mock, - update_experimental_context_mock, ): build_context_mock = Mock() @@ -177,7 +175,6 @@ def test_infra_must_succeed_sync( execute_code_sync_mock.assert_not_called() @parameterized.expand([(False, True, False)]) - @patch("samcli.commands.sync.command.update_experimental_context") @patch("samcli.commands.sync.command.click") @patch("samcli.commands.sync.command.execute_watch") @patch("samcli.commands.build.command.click") @@ -203,7 +200,6 @@ def test_watch_must_succeed_sync( mock_build_click, execute_watch_mock, click_mock, - update_experimental_context_mock, ): build_context_mock = Mock() @@ -303,7 +299,6 @@ def test_watch_must_succeed_sync( ) @parameterized.expand([(True, False, True)]) - @patch("samcli.commands.sync.command.update_experimental_context") @patch("samcli.commands.sync.command.click") @patch("samcli.commands.sync.command.execute_code_sync") @patch("samcli.commands.build.command.click") @@ -329,7 +324,6 @@ def test_code_must_succeed_sync( mock_build_click, execute_code_sync_mock, click_mock, - update_experimental_context_mock, ): build_context_mock = Mock() diff --git a/tests/unit/lib/build_module/test_build_strategy.py b/tests/unit/lib/build_module/test_build_strategy.py index a2e6ae6dd7..9feb836904 100644 --- a/tests/unit/lib/build_module/test_build_strategy.py +++ b/tests/unit/lib/build_module/test_build_strategy.py @@ -551,17 +551,12 @@ def setUp(self) -> None: @parameterized.expand( [ - ("python3.7", True), - ("nodejs12.x", True), - ("ruby2.7", True), - ("python3.7", False), + "python3.7", + "nodejs12.x", + "ruby2.7", ] ) - @patch("samcli.lib.build.build_strategy.is_experimental_enabled") - def test_will_call_incremental_build_strategy( - self, mocked_read, mocked_write, runtime, experimental_enabled, patched_experimental - ): - patched_experimental.return_value = experimental_enabled + def test_will_call_incremental_build_strategy(self, mocked_read, mocked_write, runtime): build_definition = FunctionBuildDefinition(runtime, "codeuri", "packate_type", X86_64, {}, "handler") self.build_graph.put_function_build_definition(build_definition, Mock(full_path="function_full_path")) with patch.object( @@ -571,12 +566,8 @@ def test_will_call_incremental_build_strategy( ) as patched_cached_build_strategy: self.build_strategy.build() - if experimental_enabled: - patched_incremental_build_strategy.build_single_function_definition.assert_called_with(build_definition) - patched_cached_build_strategy.assert_not_called() - else: - patched_cached_build_strategy.build_single_function_definition.assert_called_with(build_definition) - patched_incremental_build_strategy.assert_not_called() + patched_incremental_build_strategy.build_single_function_definition.assert_called_with(build_definition) + patched_cached_build_strategy.assert_not_called() @parameterized.expand( [ diff --git a/tests/unit/lib/observability/cw_logs/test_cw_log_group_provider.py b/tests/unit/lib/observability/cw_logs/test_cw_log_group_provider.py index d3f2bd71cd..19c4746f37 100644 --- a/tests/unit/lib/observability/cw_logs/test_cw_log_group_provider.py +++ b/tests/unit/lib/observability/cw_logs/test_cw_log_group_provider.py @@ -1,30 +1,25 @@ from unittest import TestCase -from unittest.mock import Mock, ANY, patch +from unittest.mock import Mock, ANY from parameterized import parameterized -from samcli.commands._utils.experimental import set_experimental, ExperimentalFlag from samcli.lib.observability.cw_logs.cw_log_group_provider import LogGroupProvider -@patch("samcli.commands._utils.experimental.update_experimental_context") class TestLogGroupProvider_for_lambda_function(TestCase): - def setUp(self) -> None: - set_experimental(config_entry=ExperimentalFlag.Accelerate, enabled=True) - - def test_must_return_log_group_name(self, patched_update_experimental_context): + def test_must_return_log_group_name(self): expected = "/aws/lambda/my_function_name" result = LogGroupProvider.for_lambda_function("my_function_name") self.assertEqual(expected, result) - def test_rest_api_log_group_name(self, patched_update_experimental_context): + def test_rest_api_log_group_name(self): expected = "API-Gateway-Execution-Logs_my_function_name/Prod" result = LogGroupProvider.for_resource(Mock(), "AWS::ApiGateway::RestApi", "my_function_name") self.assertEqual(expected, result) - def test_http_api_log_group_name(self, patched_update_experimental_context): + def test_http_api_log_group_name(self): given_client_provider = Mock() given_client_provider(ANY).get_stage.return_value = { "AccessLogSettings": {"DestinationArn": "test:my_log_group"} @@ -34,14 +29,14 @@ def test_http_api_log_group_name(self, patched_update_experimental_context): self.assertEqual(expected, result) - def test_http_api_log_group_name_not_exist(self, patched_update_experimental_context): + def test_http_api_log_group_name_not_exist(self): given_client_provider = Mock() given_client_provider(ANY).get_stage.return_value = {} result = LogGroupProvider.for_resource(given_client_provider, "AWS::ApiGatewayV2::Api", "my_function_name") self.assertIsNone(result) - def test_step_functions(self, patched_update_experimental_context): + def test_step_functions(self): given_client_provider = Mock() given_cw_log_group_name = "sam-app-logs-command-test-MyStateMachineLogGroup-ucwMaQpNBJTD" given_client_provider(ANY).describe_state_machine.return_value = { @@ -63,7 +58,7 @@ def test_step_functions(self, patched_update_experimental_context): self.assertIsNotNone(result) self.assertEqual(result, given_cw_log_group_name) - def test_invalid_step_functions(self, patched_update_experimental_context): + def test_invalid_step_functions(self): given_client_provider = Mock() given_client_provider(ANY).describe_state_machine.return_value = {"loggingConfiguration": {"destinations": []}} @@ -74,7 +69,7 @@ def test_invalid_step_functions(self, patched_update_experimental_context): self.assertIsNone(result) @parameterized.expand(["non-ARN-log-group", "invalid:log:arn"]) - def test_invalid_step_functions_configuration(self, patched_update_experimental_context, log_group_arn): + def test_invalid_step_functions_configuration(self, log_group_arn): given_client_provider = Mock() given_client_provider(ANY).describe_state_machine.return_value = { "loggingConfiguration": {"destinations": [{"cloudWatchLogsLogGroup": {"logGroupArn": log_group_arn}}]}