Skip to content

Conversation

@goblincore
Copy link
Collaborator

@goblincore goblincore commented Jan 26, 2026

Overview

🎟 Relevant Jira Issues

📚 What is the context and goal of this PR?

Previously, the deploy.yml GitHub Actions workflow had two separate jobs for deploying frontend applications:

  • deploy-lca-frontend - For the LearnCard App
  • deploy-scouts-frontend - For the Scouts App
    Both jobs contained nearly identical logic with only minor differences in configuration values (Netlify branch, CapGo app ID, build paths, etc.). This led to ~160 lines of duplicated YAML code and required maintaining two separate workflow inputs in the Actions UI.

🥴 TL; RL:

💡 Feature Breakdown (screenshots & videos encouraged!)

1. Consolidated Workflow Inputs

  • Removed: deploy-lca-frontend and deploy-scouts-frontend checkboxes
  • Added: Single deploy-frontend checkbox labeled "Deploy Frontend (Netlify + CapGo)"

2. Merged Deployment Jobs

Replaced both frontend jobs with a single deploy-frontend job that dynamically sets configuration based on the selected target-environment.

3. Resolved Workflow Structure

Component Change
determine-affected Added dynamic environment outputs (target_frontend_env, target_brain_service_env, etc.) so each job just references ${{ needs.determine-affected.outputs.target_*_env }}
deploy-frontend Single consolidated job that uses a Set Deployment Variables step to switch between LCA and Scouts configs based on target-environment input
Service Jobs Now reference the centralized environment outputs instead of inline ternary logic
push-docker-images Preserved from origin/main, builds images after successful service deploys
publish-npm Updated to depend on deploy-frontend (ensuring packages publish only after full deploy)
Formatting Standardized to 4-space indentation and double quotes throughout

"Set Deployment Variables" step outputs the correct values based on environment:

Variable Scouts LCA (Default)
app_id scouts lca
project_name scouts learn-card-app
netlify_branch production-scouts production
capgo_id org.scoutpass.app com.learncard.app
build_path apps/scouts/build apps/learn-card-app/build
force_push true false

4. Updated Job Dependencies

The publish-npm job now depends on the consolidated deploy-frontend job.

🛠 Important tradeoffs made:

🔍 Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (refactor, documentation update, etc)

💳 Does This Create Any New Technical Debt? ( If yes, please describe and add JIRA TODOs )

  • No
  • Yes

Testing

🔬 How Can Someone QA This?

I'd have to merge in main to test properly

📱 🖥 Which devices would you like help testing on?

🧪 Code Coverage

Documentation

📝 Documentation Checklist

User-Facing Docs (docs/docs.learncard.com)

  • Tutorial — New capability that users need to learn (docs/tutorials/)
  • How-To Guide — New workflow or integration (docs/how-to-guides/)
  • Reference — New/changed API, config, or SDK method (docs/sdks/)
  • Concept — New mental model or architecture explanation (docs/core-concepts/)
  • App Flows — Changes to LearnCard App or ScoutPass user flows (docs/apps/)

Internal/AI Docs

  • CLAUDE.md — New pattern, flow, or context that AI assistants need
  • Code comments/JSDoc — Complex logic that needs inline explanation

Visual Documentation

  • Mermaid diagram — Complex flow, state machine, or architecture

💭 Documentation Notes

✅ PR Checklist

  • Related to a Jira issue (create one if not)
  • My code follows style guidelines (eslint / prettier)
  • I have manually tested common end-2-end cases
  • I have reviewed my code
  • I have commented my code, particularly where ambiguous
  • New and existing unit tests pass locally with my changes
  • I have completed the Documentation Checklist above (or explained why N/A)

🚀 Ready to squash-and-merge?:

  • Code is backwards compatible
  • There is not a "Do Not Merge" label on this PR
  • I have thoughtfully considered the security implications of this change.
  • This change does not expose new public facing endpoints that do not have authentication

✨ PR Description

Purpose: Refactor GitHub Actions deployment workflow to consolidate frontend deployments using dynamic environment mapping and centralized configuration.

Main changes:

  • Consolidated two separate frontend deployment jobs (deploy-lca-frontend and deploy-scouts-frontend) into single deploy-frontend job using dynamic environment variables
  • Added centralized environment determination logic mapping target environments to specific deployment configurations (staging/production/scouts)
  • Replaced inline environment conditionals with output variables for cleaner job environment assignment across all deployment jobs

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2026

⚠️ No Changeset found

Latest commit: 0f6d81d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Jan 26, 2026

Deploy Preview for learncarddocs canceled.

Name Link
🔨 Latest commit 0f6d81d
🔍 Latest deploy log https://app.netlify.com/projects/learncarddocs/deploys/6978a36a6c3f800008441165

@netlify
Copy link

netlify bot commented Jan 26, 2026

Deploy Preview for staging-learncardapp failed. Why did it fail? →

Name Link
🔨 Latest commit 0f6d81d
🔍 Latest deploy log https://app.netlify.com/projects/staging-learncardapp/deploys/6978a36a70b4ba00083fe80e

Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

The PR consolidates two frontend deployment workflows into one, using dynamic variables based on target environment. The refactoring generally looks solid, but there's a critical behavior change in the npm publishing dependency and some maintainability concerns with complex conditional logic.

2 issues detected:

🐞 Bug - Adding deploy-frontend to the needs array creates an unnecessary blocking dependency that wasn't present before. 🛠️

Details: The npm publishing job now depends on frontend deployment completion, which changes the workflow behavior. Previously, npm packages could publish independently of frontend deployments. This could significantly delay npm releases if frontend deployment is slow or fails.
File: .github/workflows/deploy.yml (555-555)
🛠️ A suggested code correction is included in the review comments.

🧹 Maintainability - Nested ternary operators with multiple conditions reduce code readability and maintainability. 🛠️

Details: The environment selection uses deeply nested ternary operators that are difficult to read and maintain. With multiple conditions checking event types and input values, the logic is hard to follow and error-prone for future modifications.
File: .github/workflows/deploy.yml (373-373)
🛠️ A suggested code correction is included in the review comments.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

@gitstream-cm
Copy link
Contributor

gitstream-cm bot commented Jan 26, 2026

This PR is missing a Jira ticket reference in the title or description.
Please add a Jira ticket reference to the title or description of this PR.

@gitstream-cm
Copy link
Contributor

gitstream-cm bot commented Jan 26, 2026

🥷 Code experts: TaylorBeeston

TaylorBeeston has most 👩‍💻 activity in the files.
TaylorBeeston has most 🧠 knowledge in the files.

See details

.github/workflows/deploy.yml

Activity based on git-commit:

TaylorBeeston
JAN 826 additions & 754 deletions
DEC 529 additions & 223 deletions
NOV 270 additions & 172 deletions
OCT
SEP
AUG

Knowledge based on git-blame:
TaylorBeeston: 99%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@goblincore goblincore merged commit c9f988e into main Jan 27, 2026
9 of 11 checks passed
@goblincore goblincore deleted the deploy-update branch January 27, 2026 11:37
Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

LGTM

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

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