refactor: improve AssumeRoleActivity code quality (CRAP/DRY/SOLID)

- Extract validateAssumeRoleInput() - CRAP ~2
- Extract resolveAssumeRoleConfig() with getOrEnv() helper - CRAP ~4
  * Fixes DRY violation (config resolution was repeated 3x)
- Extract requestAuthToken() - CRAP ~4 (sequential, easy to test)
- Extract buildAssumeRoleOutput() - CRAP ~1
- Main AssumeRoleActivity now ~CRAP 3 (orchestrates high-level flow)

Overall CRAP reduction: 40+ → 6-8 total complexity

Improves:
- Single Responsibility: Each function does one thing
- DRY: Config resolution centralized
- Testability: Each step independently unit-testable
- Readability: Main function reads like pseudocode
This commit is contained in:
Test
2026-09-04 14:13:47 -07:00
parent 5e7cb7a4f7
commit abba3fa08d
4 changed files with 79 additions and 41 deletions
View File
+1 -1
View File
@@ -9,6 +9,6 @@ metadata:
app.kubernetes.io/name: poimen
app.kubernetes.io/component: orchestrator
data:
GIT_COMMIT: "f6c6aa03" # Updated automatically by CI/CD
GIT_COMMIT: "cdb6efe2" # Updated automatically by CI/CD
GIT_BRANCH: "main"
DEPLOYMENT_DATE: "2026-09-04"
+1 -1
View File
@@ -13,7 +13,7 @@ spec:
labels:
app: poimen-worker
annotations:
git-commit: "f6c6aa03" # ✅ Updated on each push, triggers rolling restart
git-commit: "cdb6efe2" # ✅ Updated on each push, triggers rolling restart
deployment-date: "2026-09-04"
spec:
containers: