Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Cross-runtime consistency fixes

Aperta
#178 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
aws, python
Ambito
backend, cloud

Direzione di ricerca

Confronta contract_event_handler.py, contract_status_changed_event_handler.py e publication_evaluation_event_handler.py con i runtime Java, TypeScript e .NET. Esamina innanzitutto i comportamenti indicati relativi a timestamp, DynamoDB, variabili d’ambiente, convalida e metriche, quindi esegui i test del servizio pertinenti, se disponibili. Il lavoro è completo quando gli handler Python corrispondono ai contratti dichiarati tra i runtime, senza scritture involontarie né metriche duplicate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

pending-release

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: replaced datetime.now().strftime("%d/%m/%Y %H:%M:%S") with datetime.now(timezone.utc).isoformat() for both contract_created and contract_last_modified_on
  • update_contract: replaced datetime.now().strftime(...) with datetime.now(timezone.utc).isoformat()
  • Format change: custom DD/MM/YYYY HH:MM:SS → ISO 8601 YYYY-MM-DDTHH:MM:SS.ffffff+00:00
  • Uses the non-deprecated timezone-aware API (timezone.utc) instead of datetime.utcnow()
DynamoDB attribute name (contract_event_handler.py)
  • update_contract: changed UpdateExpression from "set contract_status=:t, modified_date=:m" to "set contract_status=:t, contract_last_modified_on=:m"
  • This corrects a bug where update_contract wrote to a non-existent modified_date attribute instead of the correct contract_last_modified_on attribute used in create_contract
Observability metrics (contract_event_handler.py)
  • Added metrics.add_metric(name="ContractCreated", unit=MetricUnit.Count, value=1) to create_contract success path

Approvals Service

Per-invocation timestamp (contract_status_changed_event_handler.py)
  • Removed module-level now = datetime.now() and current_date variable 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(...) with raise EnvironmentError(...) for both SERVICE_NAMESPACE and CONTRACT_STATUS_TABLE missing variable checks
  • Removed the now-unused InternalServerError import from aws_lambda_powertools.event_handler.exceptions

Web Service

Evaluation result validation (publication_evaluation_event_handler.py)
  • Added validation guard: only updates DynamoDB when evaluation_result is "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
Lingua principale
Python
Stelle
47
Fork
20
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws-samples/aws-serverless-developer-experience-workshop-python

Tutte le issue di aws-samples/aws-serverless-developer-experience-workshop-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.