Commit 418b3d0
authored
fix: cross-runtime consistency fixes (#179)
* fix(approvals_service): Remove unused imports and replace InternalServerError
- Remove unused datetime import and current_date variable calculation
- Replace InternalServerError with EnvironmentError for environment variable validation
- Simplify error handling for SERVICE_NAMESPACE and CONTRACT_STATUS_TABLE checks
- InternalServerError is not appropriate for environment configuration issues that occur at module initialization
* fix(publication_manager_service): Add evaluation result validation and remove unused metric
- Add validation for evaluation_result to ensure only "APPROVED" or "DECLINED" values are processed
- Return early with skip message when unknown evaluation result is encountered
- Log warning when evaluation result is invalid for debugging purposes
- Remove unused PropertiesAdded metric that was not being utilized
- Improve robustness by preventing invalid data from being written to DynamoDB
* fix(contracts_service): Improve datetime handling and add contract metrics
- Import timezone from datetime module for UTC timestamp generation
- Import MetricUnit from aws_lambda_powertools.metrics for proper metric typing
- Replace strftime formatting with isoformat() for ISO 8601 compliant timestamps in create_contract and update_contract functions
- Add metric tracking for successful contract creation events
- Rename UpdateExpression attribute from modified_date to contract_last_modified_on for consistency
- Ensures timestamps are timezone-aware and use UTC for consistency across distributed systems
* chore(deps): bump dependencies to latest versions
* ci: Add explicit permissions to workflow jobs
- Add actions: read permission for workflow execution access
- Add contents: read permission for repository content access
- Scope down GitHub Token permissions following security best practices1 parent fcd82b1 commit 418b3d0
5 files changed
Lines changed: 21 additions & 20 deletions
File tree
- .github/workflows
- unicorn_approvals/src/approvals_service
- unicorn_contracts
- src/contracts_service
- unicorn_web/src/publication_manager_service
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | | - | |
| 14 | + | |
17 | 15 | | |
18 | | - | |
| 16 | + | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 27 | | |
34 | 28 | | |
35 | 29 | | |
| |||
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
156 | | - | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | | - | |
84 | | - | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
0 commit comments