Skip to content

Commit 9c7fd42

Browse files
committed
Merge branch 'main' into cfn/v2/resolve-2
2 parents f6c9131 + c417544 commit 9c7fd42

File tree

59 files changed

+799
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+799
-238
lines changed

.github/workflows/aws-tests-s3-image.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: AWS / S3 Image Integration Tests
33
on:
44
push:
55
paths:
6-
- .github/workflows/tests-s3-image.yml
6+
- .github/workflows/aws-tests-s3-image.yml
77
- localstack-core/localstack/aws/*.py
88
- localstack-core/localstack/aws/handlers/*¨
99
- localstack-core/localstack/aws/protocol/**
@@ -22,7 +22,7 @@ on:
2222
- main
2323
pull_request:
2424
paths:
25-
- .github/workflows/tests-s3-image.yml
25+
- .github/workflows/aws-tests-s3-image.yml
2626
- localstack-core/localstack/aws/*.py
2727
- localstack-core/localstack/aws/handlers/*¨
2828
- localstack-core/localstack/aws/protocol/**
@@ -83,7 +83,7 @@ jobs:
8383
- arch: amd64
8484
runner: ubuntu-latest
8585
- arch: arm64
86-
runner: buildjet-2vcpu-ubuntu-2204-arm
86+
runner: ubuntu-24.04-arm
8787
name: "Build and Test S3 image"
8888
env:
8989
PLATFORM: ${{ matrix.arch }}

bin/docker-helper.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,28 @@ function _get_current_branch() {
6565
git branch --show-current
6666
}
6767

68+
function _get_current_tag() {
69+
git describe --tags --exact-match 2> /dev/null || true
70+
}
71+
6872
function _enforce_image_name() {
6973
if [ -z "$IMAGE_NAME" ]; then _fail "Mandatory parameter IMAGE_NAME missing."; fi
7074
}
7175

72-
function _enforce_main_branch() {
76+
function _enforce_tagged_or_main_branch() {
7377
MAIN_BRANCH=${MAIN_BRANCH-"main"}
7478
CURRENT_BRANCH=$(_get_current_branch)
79+
CURRENT_TAG=$(_get_current_tag)
7580
echo "Current git branch: '$CURRENT_BRANCH'"
76-
test "$CURRENT_BRANCH" == "$MAIN_BRANCH" || _fail "Current branch ($CURRENT_BRANCH) is not $MAIN_BRANCH."
81+
echo "Current tag: '$CURRENT_TAG'"
82+
test -n "$CURRENT_TAG" || test "$CURRENT_BRANCH" == "$MAIN_BRANCH" || _fail "Current branch ($CURRENT_BRANCH) is not $MAIN_BRANCH and current tag ($CURRENT_TAG) is not set."
83+
84+
# if we're not on the main branch but have a tag, ensure it's a version tag like v1.2.3
85+
if [[ "$CURRENT_BRANCH" != "$MAIN_BRANCH" && -n "$CURRENT_TAG" ]]; then
86+
if ! [[ "$CURRENT_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
87+
_fail "tag '$CURRENT_TAG' is not a version tag of the shape ^v[0-9]+\.[0-9]+\.[0-9]+$"
88+
fi
89+
fi
7790
}
7891

7992
function _enforce_no_fork() {
@@ -158,7 +171,7 @@ function cmd-load() {
158171

159172
function cmd-push() {
160173
_enforce_image_name
161-
_enforce_main_branch
174+
_enforce_tagged_or_main_branch
162175
_enforce_no_fork
163176
_enforce_docker_credentials
164177
_enforce_platform
@@ -213,7 +226,7 @@ function cmd-push() {
213226

214227
function cmd-push-manifests() {
215228
_enforce_image_name
216-
_enforce_main_branch
229+
_enforce_tagged_or_main_branch
217230
_enforce_no_fork
218231
_enforce_docker_credentials
219232
_set_version_defaults

localstack-core/localstack/aws/handlers/internal_requests.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ def __call__(self, chain: HandlerChain, context: RequestContext, response: Respo
2020
try:
2121
dto = MappingProxyType(load_dto(header))
2222
except Exception as e:
23-
LOG.exception("Error loading request parameters '%s', Error: %s", header, e)
23+
LOG.error(
24+
"Error loading request parameters '%s', Error: %s",
25+
header,
26+
e,
27+
exc_info=LOG.isEnabledFor(logging.DEBUG),
28+
)
2429
return
2530

2631
context.internal_request_params = dto

localstack-core/localstack/aws/spec.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,9 @@ def get_service_catalog() -> ServiceCatalog:
343343
index = build_service_index_cache(cache_catalog_file)
344344
return ServiceCatalog(index)
345345
except Exception:
346-
LOG.exception(
347-
"error while processing service catalog index cache, falling back to lazy-loaded index"
346+
LOG.error(
347+
"error while processing service catalog index cache, falling back to lazy-loaded index",
348+
exc_info=LOG.isEnabledFor(logging.DEBUG),
348349
)
349350
return ServiceCatalog()
350351

localstack-core/localstack/services/apigateway/legacy/invocations.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ def _is_body_valid(self, resource) -> bool:
142142
# try to get the resolved model first
143143
resolved_schema = model_resolver.get_resolved_model()
144144
if not resolved_schema:
145-
LOG.exception(
146-
"An exception occurred while trying to validate the request: could not find the model"
145+
LOG.error(
146+
"An exception occurred while trying to validate the request: could not find the model",
147+
exc_info=LOG.isEnabledFor(logging.DEBUG),
147148
)
148149
return False
149150

@@ -334,7 +335,7 @@ def invoke_rest_api_integration(invocation_context: ApiInvocationContext):
334335
return e.to_response()
335336
except Exception as e:
336337
msg = f"Error invoking integration for API Gateway ID '{invocation_context.api_id}': {e}"
337-
LOG.exception(msg)
338+
LOG.error(msg, exc_info=LOG.isEnabledFor(logging.DEBUG))
338339
return make_error_response(msg, 400)
339340

340341

localstack-core/localstack/services/apigateway/next_gen/execute_api/handlers/method_request.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ def validate_request(
5050
# check if there is a validator for this request
5151
if not (validator := rest_api.validators.get(request_validator_id)):
5252
# TODO Should we raise an exception instead?
53-
LOG.exception("No validator were found with matching id: '%s'", request_validator_id)
53+
LOG.error(
54+
"No validator were found with matching id: '%s'",
55+
request_validator_id,
56+
exc_info=LOG.isEnabledFor(logging.DEBUG),
57+
)
5458
return
5559

5660
if self.should_validate_request(validator) and (
@@ -87,9 +91,10 @@ def _is_body_valid(
8791
# try to get the resolved model first
8892
resolved_schema = model_resolver.get_resolved_model()
8993
if not resolved_schema:
90-
LOG.exception(
94+
LOG.error(
9195
"An exception occurred while trying to validate the request: could not resolve the model '%s'",
9296
model_name,
97+
exc_info=LOG.isEnabledFor(logging.DEBUG),
9398
)
9499
return False
95100

localstack-core/localstack/services/cloudformation/engine/template_deployer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,10 +1479,11 @@ def delete_stack(self):
14791479
# correct order yet.
14801480
continue
14811481
case OperationStatus.FAILED:
1482-
LOG.exception(
1482+
LOG.error(
14831483
"Failed to delete resource with id %s. Reason: %s",
14841484
resource_id,
14851485
event.message or "unknown",
1486+
exc_info=LOG.isEnabledFor(logging.DEBUG),
14861487
)
14871488
case OperationStatus.IN_PROGRESS:
14881489
# the resource provider executor should not return this state, so
@@ -1494,10 +1495,11 @@ def delete_stack(self):
14941495
raise Exception(f"Use of unsupported status found: {other_status}")
14951496

14961497
except Exception as e:
1497-
LOG.exception(
1498+
LOG.error(
14981499
"Failed to delete resource with id %s. Final exception: %s",
14991500
resource_id,
15001501
e,
1502+
exc_info=LOG.isEnabledFor(logging.DEBUG),
15011503
)
15021504

15031505
# update status

0 commit comments

Comments
 (0)