Add feature_flags:sync to deploy initContainer (pal-e-deployments) #140

Closed
opened 2026-06-07 01:45:09 +00:00 by ldraney · 1 comment
Owner

Type

Feature

Lineage

Dependent on #130 (FeatureFlag model). Cannot be done until #130 merges and the migration + rake task exist. Cross-repo change in pal-e-deployments.

Repo

ldraney/pal-e-deployments

User Story

As a platform operator
I want feature flags to be registered automatically on every deploy
So that new flags appear in production without manual rake task execution

Context

Issue #130 creates the FeatureFlag model and feature_flags:sync rake task. The rake task is idempotent — find_or_create_by! creates missing flags without overwriting existing enabled state. But it only runs if the deploy initContainer invokes it.

Currently the initContainer runs bin/rails db:prepare only. db:prepare runs seeds on first DB creation but skips them on subsequent deploys. New flags added to the rake task would never appear in production without this change.

File Targets

Files to modify:

  • overlays/landscaping-assistant/prod/deployment-patch.yaml — update initContainer command

Files NOT to touch:

  • Anything in landscaping-assistant repo (that's #130)

Acceptance Criteria

  • initContainer command changes from bin/rails db:prepare to sh -c "bin/rails db:prepare && bin/rails feature_flags:sync"
  • ArgoCD syncs successfully after the change
  • Flags appear in the database after deploy without manual intervention

Test Expectations

  • Deploy with the change, verify FeatureFlag.count matches rake task entries via kubectl exec
  • Run command: kubectl exec -it deploy/landscaping-assistant -n landscaping-assistant -- bin/rails runner "puts FeatureFlag.pluck(:name, :enabled)"

Constraints

  • BLOCKED on #130 merging first — the rake task and migration must exist
  • One-line change in kustomize overlay
  • Do not modify the base deployment, only the overlay

Checklist

  • PR opened on pal-e-deployments
  • ArgoCD sync verified
  • No unrelated changes
  • project-landscaping-assistant — main project
  • #130 — creates FeatureFlag model and rake task (BLOCKER)
### Type Feature ### Lineage Dependent on #130 (FeatureFlag model). Cannot be done until #130 merges and the migration + rake task exist. Cross-repo change in pal-e-deployments. ### Repo `ldraney/pal-e-deployments` ### User Story As a platform operator I want feature flags to be registered automatically on every deploy So that new flags appear in production without manual rake task execution ### Context Issue #130 creates the `FeatureFlag` model and `feature_flags:sync` rake task. The rake task is idempotent — `find_or_create_by!` creates missing flags without overwriting existing `enabled` state. But it only runs if the deploy initContainer invokes it. Currently the initContainer runs `bin/rails db:prepare` only. `db:prepare` runs seeds on first DB creation but skips them on subsequent deploys. New flags added to the rake task would never appear in production without this change. ### File Targets Files to modify: - `overlays/landscaping-assistant/prod/deployment-patch.yaml` — update initContainer command Files NOT to touch: - Anything in landscaping-assistant repo (that's #130) ### Acceptance Criteria - [ ] initContainer command changes from `bin/rails db:prepare` to `sh -c "bin/rails db:prepare && bin/rails feature_flags:sync"` - [ ] ArgoCD syncs successfully after the change - [ ] Flags appear in the database after deploy without manual intervention ### Test Expectations - [ ] Deploy with the change, verify `FeatureFlag.count` matches rake task entries via `kubectl exec` - Run command: `kubectl exec -it deploy/landscaping-assistant -n landscaping-assistant -- bin/rails runner "puts FeatureFlag.pluck(:name, :enabled)"` ### Constraints - BLOCKED on #130 merging first — the rake task and migration must exist - One-line change in kustomize overlay - Do not modify the base deployment, only the overlay ### Checklist - [ ] PR opened on pal-e-deployments - [ ] ArgoCD sync verified - [ ] No unrelated changes ### Related - `project-landscaping-assistant` — main project - #130 — creates FeatureFlag model and rake task (BLOCKER)
Author
Owner

Scope Review: NEEDS_REFINEMENT

Review note: review-1368-2026-06-06

Ticket scope is solid — file target verified, blocker #130 resolved, rake task confirmed idempotent, single-line change fits easily in one agent pass.

Two traceability gaps (systemic, not ticket-specific):

  • [SCOPE] No "auth" user story entry in project-landscaping-assistant user-stories table (referenced by 10+ board items)
  • [SCOPE] No arch-k8s-deploy architecture note in pal-e-docs (referenced by multiple board items)
## Scope Review: NEEDS_REFINEMENT Review note: `review-1368-2026-06-06` Ticket scope is solid — file target verified, blocker #130 resolved, rake task confirmed idempotent, single-line change fits easily in one agent pass. Two traceability gaps (systemic, not ticket-specific): - **[SCOPE]** No "auth" user story entry in project-landscaping-assistant user-stories table (referenced by 10+ board items) - **[SCOPE]** No `arch-k8s-deploy` architecture note in pal-e-docs (referenced by multiple board items)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/landscaping-assistant#140
No description provided.