Cross-runtime consistency fixes
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
So sánh contract_event_handler.py, contract_status_changed_event_handler.py và publication_evaluation_event_handler.py với các runtime Java, TypeScript và .NET. Trước tiên, xem xét các hành vi được liệt kê đối với timestamp, DynamoDB, biến môi trường, validation và metric, sau đó chạy các service test liên quan nếu có. Công việc được xem là hoàn tất khi các Python handler khớp với các cross-runtime contract đã nêu mà không có thao tác ghi ngoài ý muốn hoặc metric trùng lặp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
A set of fixes to align the Python runtime with the other runtimes (Java, TypeScript, .NET) for functional equivalence and cross-runtime consistency.
Contracts Service
Timestamp format (contract_event_handler.py)
create_contract: replaceddatetime.now().strftime("%d/%m/%Y %H:%M:%S")withdatetime.now(timezone.utc).isoformat()for bothcontract_createdandcontract_last_modified_onupdate_contract: replaceddatetime.now().strftime(...)withdatetime.now(timezone.utc).isoformat()- Format change: custom
DD/MM/YYYY HH:MM:SS→ ISO 8601YYYY-MM-DDTHH:MM:SS.ffffff+00:00 - Uses the non-deprecated timezone-aware API (
timezone.utc) instead ofdatetime.utcnow()
DynamoDB attribute name (contract_event_handler.py)
update_contract: changedUpdateExpressionfrom"set contract_status=:t, modified_date=:m"to"set contract_status=:t, contract_last_modified_on=:m"- This corrects a bug where
update_contractwrote to a non-existentmodified_dateattribute instead of the correctcontract_last_modified_onattribute used increate_contract
Observability metrics (contract_event_handler.py)
- Added
metrics.add_metric(name="ContractCreated", unit=MetricUnit.Count, value=1)tocreate_contractsuccess path
Approvals Service
Per-invocation timestamp (contract_status_changed_event_handler.py)
- Removed module-level
now = datetime.now()andcurrent_datevariable assignments - Moved timestamp computation inside the handler function body to ensure each invocation captures its own execution time rather than the container initialisation time
Environment variable error type (contract_status_changed_event_handler.py)
- Replaced
raise InternalServerError(...)withraise EnvironmentError(...)for bothSERVICE_NAMESPACEandCONTRACT_STATUS_TABLEmissing variable checks - Removed the now-unused
InternalServerErrorimport fromaws_lambda_powertools.event_handler.exceptions
Web Service
Evaluation result validation (publication_evaluation_event_handler.py)
- Added validation guard: only updates DynamoDB when
evaluation_resultis"APPROVED"or"DECLINED"(case-insensitive) - Logs a warning and returns without writing to DynamoDB for any other value
Metric name correction (publication_evaluation_event_handler.py)
- Removed duplicate
metrics.add_metric(name="PropertiesAdded", ...)call - Retained
metrics.add_metric(name="PropertiesApproved", ...)as the single metric for this path
- Ngôn ngữ chính
- Python
- Star
- 47
- Fork
- 20
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws-samples/aws-serverless-developer-experience-workshop-python
-
internal pending-release triage
aws-samples/aws-serverless-developer-experience-workshop-python#32 · 1 người được giao ·
-
bug triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
aws-samples/aws-serverless-developer-experience-workshop-python#30 ·
Tất cả issue của aws-samples/aws-serverless-developer-experience-workshop-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anthropics/skills#1811 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
speaches-ai/speaches#678 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
datalayer/mcp-compose#42 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
conda-forge/spacy-feedstock#177 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
UKGovernmentBEIS/inspect_evals#2523 ·