Skip to content

feat(payment): rollout on hashMapAnnotations change#386

Merged
Dav-14 merged 3 commits intomainfrom
feat/configure_hash_map_for_payment_v3
Feb 6, 2026
Merged

feat(payment): rollout on hashMapAnnotations change#386
Dav-14 merged 3 commits intomainfrom
feat/configure_hash_map_for_payment_v3

Conversation

@Dav-14
Copy link
Contributor

@Dav-14 Dav-14 commented Feb 6, 2026

No description provided.

@Dav-14 Dav-14 requested a review from a team as a code owner February 6, 2026 10:16
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

Function signatures for temporalEnvVars and v3EnvVars were changed to return a resource-hash map in addition to env vars and error. Call sites (including createV3Deployment and finalizer) were updated to accept the three-value returns; the hash map is injected into Deployment annotations.

Changes

Cohort / File(s) Summary
Payments deployment logic
internal/resources/payments/deployments.go
Changed temporalEnvVars and v3EnvVars signatures to (map[string]string, []corev1.EnvVar, error). Both functions now accumulate resource reference hashes into a map, assemble Temporal/broker/TLS env vars, and propagate the map. Error-return sites switched to named/bare returns in several paths. createV3Deployment now receives the hash map and sets it on Deployment ObjectMeta.Annotations.
Finalizer call site
internal/resources/payments/finalizer.go
Updated call to temporalEnvVars to unpack the new three-value return (_, env, err := temporalEnvVars(...)), preserving existing error handling and env usage.

Sequence Diagram(s)

sequenceDiagram
    participant Controller
    participant v3EnvVars
    participant temporalEnvVars
    participant Secrets
    participant K8sDeployment

    Controller->>v3EnvVars: request envs and hashes (stack, payments, database)
    v3EnvVars->>temporalEnvVars: request temporal envs and resource hashes
    temporalEnvVars->>Secrets: fetch Temporal TLS / encryption key / secrets
    Secrets-->>temporalEnvVars: secret data (or not found)
    temporalEnvVars-->>v3EnvVars: return (hashMap, envVars, err)
    v3EnvVars-->>Controller: return (hashMap, envVars, err)
    Controller->>K8sDeployment: create/update Deployment with envVars and annotations=hashMap
    K8sDeployment-->>Controller: Deployment applied
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 I hopped through hashes, envs, and keys so bright,
I stitched them to deployments in the night,
Three values returned where once two did roam,
Annotations now carry a warm, hashed home.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to evaluate relevance to the changeset. Add a pull request description explaining the purpose and impact of the hashMapAnnotations change.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing hash map annotations for payment processing rollout.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/configure_hash_map_for_payment_v3

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@internal/resources/payments/deployments.go`:
- Around line 54-62: The code dereferences ref (accessing ref.Name and
ref.Status.Hash) before checking err; change the flow in the temporalURI
handling to check the error returned from resourcereferences.Create immediately
and only access ref when err == nil and ref != nil (e.g., call
resourcereferences.Create into ref, err, then if err != nil return the error,
else set hash[ref.Name] = ref.Status.Hash); apply the same immediate-error-check
pattern to the second Create call later in this block and ensure that after
calling resourcereferences.Delete you also handle its error before proceeding.

Comment on lines 54 to 67
if secret := temporalURI.Query().Get("secret"); secret != "" {
_, err = resourcereferences.Create(ctx, payments, "payments-temporal", secret, &corev1.Secret{})
ref, err = resourcereferences.Create(ctx, payments, "payments-temporal", secret, &corev1.Secret{})
hash[ref.Name] = ref.Status.Hash
} else {
err = resourcereferences.Delete(ctx, payments, "payments-temporal")
}
if err != nil {
return nil, err
return
}

if secret := temporalURI.Query().Get("encryptionKeySecret"); secret != "" {
_, err = resourcereferences.Create(ctx, payments, "payments-temporal-encryption-key", secret, &corev1.Secret{})
ref, err = resourcereferences.Create(ctx, payments, "payments-temporal-encryption-key", secret, &corev1.Secret{})
hash[ref.Name] = ref.Status.Hash
} else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the resource Ref to the hashMap.

resourceRef.Create does a CreateOrUpdate and keep the actual resource ref.

Comment on lines 305 to 311
},
Spec: appsv1.DeploymentSpec{
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Annotations: hashMap,
},
Spec: corev1.PodSpec{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THen adding it to the podspec

@Dav-14 Dav-14 enabled auto-merge (squash) February 6, 2026 10:37
@Dav-14 Dav-14 disabled auto-merge February 6, 2026 10:37
@Dav-14 Dav-14 force-pushed the feat/configure_hash_map_for_payment_v3 branch from 7ab664d to db38aff Compare February 6, 2026 10:41
@Dav-14 Dav-14 merged commit 920db8a into main Feb 6, 2026
2 of 3 checks passed
@Dav-14 Dav-14 deleted the feat/configure_hash_map_for_payment_v3 branch February 6, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants