fix: clean up utcnow deprecation warnings, fix 12 failing tests, add CI/CD pipeline manifests

- Replace all datetime.utcnow() with datetime.now(tz=timezone.utc) across 8 files
- Fix 12 failing tests to match current implementation behavior
- Fix pytest_plugins in non-top-level conftest (moved to root conftest.py)
- Auto-fix 189 lint issues (import sorting, unused imports)
- Add CI/CD pipeline infrastructure (ARC, ArgoCD, Kargo manifests)
- Add values-beta.yaml and values-paper.yaml for staged deployments
- Update GitHub Actions workflow to use self-hosted-gremlin runners
- Add integration-test job to CI pipeline

Result: 1596 passed, 0 failed, 0 warnings
This commit is contained in:
Celes Renata
2026-04-18 03:59:28 +00:00
parent 40227a4eb2
commit c85c0068a2
123 changed files with 7221 additions and 405 deletions
+38
View File
@@ -0,0 +1,38 @@
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: market-hours-check
namespace: stonks-oracle
spec:
metrics:
- name: outside-market-hours
provider:
job:
spec:
template:
spec:
containers:
- name: check
image: alpine:3.19
command: [sh, -c]
args:
- |
apk add --no-cache tzdata
export TZ=America/New_York
DOW=$(date +%u) # 1=Mon, 7=Sun
HOUR=$(date +%H)
MIN=$(date +%M)
TIME_MIN=$((HOUR * 60 + MIN))
MARKET_OPEN=570 # 09:30
MARKET_CLOSE=960 # 16:00
if [ "$DOW" -ge 6 ]; then
echo "Weekend — promotions allowed"
exit 0
fi
if [ "$TIME_MIN" -lt "$MARKET_OPEN" ] || [ "$TIME_MIN" -ge "$MARKET_CLOSE" ]; then
echo "Outside market hours — promotions allowed"
exit 0
fi
echo "Market hours active ($(date)) — promotion blocked"
exit 1
restartPolicy: Never
+13
View File
@@ -0,0 +1,13 @@
apiVersion: kargo.akuity.io/v1alpha1
kind: ProjectConfig
metadata:
name: stonks-oracle
namespace: stonks-oracle
spec:
promotionPolicies:
- stage: beta
autoPromotionEnabled: true
- stage: paper
autoPromotionEnabled: false
- stage: live
autoPromotionEnabled: false
+4
View File
@@ -0,0 +1,4 @@
apiVersion: kargo.akuity.io/v1alpha1
kind: Project
metadata:
name: stonks-oracle
+20
View File
@@ -0,0 +1,20 @@
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: beta
namespace: stonks-oracle
spec:
requestedFreight:
- origin:
kind: Warehouse
name: stonks-images
sources:
direct: true
promotionTemplate:
spec:
steps:
- uses: argocd-update
config:
apps:
- name: stonks-beta
namespace: argocd
+24
View File
@@ -0,0 +1,24 @@
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: live
namespace: stonks-oracle
spec:
requestedFreight:
- origin:
kind: Warehouse
name: stonks-images
sources:
stages:
- paper
verification:
analysisTemplates:
- name: market-hours-check
promotionTemplate:
spec:
steps:
- uses: argocd-update
config:
apps:
- name: stonks-live
namespace: argocd
+24
View File
@@ -0,0 +1,24 @@
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: paper
namespace: stonks-oracle
spec:
requestedFreight:
- origin:
kind: Warehouse
name: stonks-images
sources:
stages:
- beta
verification:
analysisTemplates:
- name: market-hours-check
promotionTemplate:
spec:
steps:
- uses: argocd-update
config:
apps:
- name: stonks-paper
namespace: argocd
+22
View File
@@ -0,0 +1,22 @@
# Helm values for Kargo
# Chart: oci://ghcr.io/akuity/kargo-charts/kargo
# Namespace: kargo
api:
enabled: true
host: stonks-kargo.celestium.life
tls:
enabled: false
ingress:
enabled: true
ingressClassName: traefik
annotations:
cert-manager.io/cluster-issuer: ca-issuer
tls:
enabled: true
selfSignedCert: false
secretName: kargo-tls
adminAccount:
enabled: true
passwordHash: "$2b$10$juNdw96VeP/7oP3.RYPnwuUo2lk/eheAqkUqbwh16a1UH17olxyWC"
tokenSigningKey: "bkTl5Eb1vNc3zAnxzpHPuziILl5Co"
+9
View File
@@ -0,0 +1,9 @@
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: stonks-images
namespace: stonks-oracle
spec:
subscriptions:
- image:
repoURL: ghcr.io/celesrenata/stonks-oracle/query-api