Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
48e29f7
feat: add implementation and software requirements documents for Debr…
IanMayo Aug 26, 2025
847f6f9
introduce sample REP data
IanMayo Aug 26, 2025
4e66068
introduce APM prompts
IanMayo Aug 26, 2025
6d4d167
initial TAPs
IanMayo Aug 26, 2025
156eb74
feat: add Docker support files including Dockerfile and .dockerignore…
IanMayo Aug 26, 2025
7b3a8b8
feat: update permissions to include additional Docker commands in set…
IanMayo Aug 26, 2025
468850c
feat: update Node.js setup to version 20 and refine Dockerfile comments
IanMayo Aug 26, 2025
e16288e
feat: implement Fly.io infrastructure setup for dynamic PR previews w…
IanMayo Aug 26, 2025
e38ac07
feat: enhance Fly.io deployment scripts and configurations for improv…
IanMayo Aug 26, 2025
9eae03f
feat: implement comprehensive CI/CD pipeline with GitHub Actions for …
IanMayo Aug 26, 2025
93af392
fix: correct Fly CLI command references from 'fly' to 'flyctl' in Git…
IanMayo Aug 26, 2025
d2baf9d
fix: improve Fly.io deployment reliability with better health checks …
IanMayo Aug 26, 2025
a082304
fix: add robust vsce installation with fallback methods to handle npm…
IanMayo Aug 26, 2025
6a9e142
refactor: optimize CI workflow structure to eliminate duplication and…
IanMayo Aug 26, 2025
81fa5bc
fix: resolve Fly.io app accessibility issues with resource and config…
IanMayo Aug 26, 2025
11ad25e
fix: remove unnecessary HTTP service health checks for streamlined co…
IanMayo Aug 26, 2025
457ea49
fix: add flyctl commands to permissions for enhanced deployment manag…
IanMayo Aug 26, 2025
f9a6dfc
fix: enhance PR cleanup workflow with improved error handling and res…
IanMayo Aug 26, 2025
f5933b3
fix: correct postAttachCommand path in devcontainer configuration
IanMayo Aug 27, 2025
706188c
fix: update minimum machines running and remove unnecessary HTTP serv…
IanMayo Aug 27, 2025
3972d83
feat: implement main branch production deployment workflow and config…
IanMayo Aug 27, 2025
9afc088
refactor: replace build-and-test job with reusable build-extension wo…
IanMayo Aug 27, 2025
c056d3f
minor cosmetic change to provide cycle
IanMayo Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@
"Bash(nvm install:*)",
"Bash(nvm use:*)",
"Bash(nvm:*)",
"Bash(node:*)"
"Bash(node:*)",
"Bash(curl:*)",
"Bash(docker stop:*)",
"Bash(docker rm:*)",
"Bash(flyctl apps:*)",
"Bash(flyctl status:*)",
"Bash(flyctl:*)"
]
},
"outputStyle": "default"
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"postAttachCommand": "../.devcontainer/install-extension.sh",
"postAttachCommand": ".devcontainer/install-extension.sh",
"customizations": {
"vscode": {
"settings": {
Expand Down
50 changes: 50 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Git files
.git
.gitignore

# Node modules (will be installed fresh in container)
node_modules/

# Development files
.devcontainer/
.vscode/

# Documentation that's not needed in container
docs/
README.md

# Prompt files not needed in production
prompts/

# OS files
.DS_Store
Thumbs.db

# Log files
*.log
npm-debug.log*

# Build artifacts that will be regenerated
out/
*.vsix

# Lock files (package-lock.json will be copied, but not yarn.lock if present)
yarn.lock

# Test files
test/
tests/
*.test.js
*.test.ts

# GitHub workflows and CI files
.github/
*.yml
*.yaml

# Scripts directory
scripts/

# Temporary files
tmp/
temp/
109 changes: 48 additions & 61 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
name: Build Extension
name: Build Extension (Reusable)

on:
push:
branches: [ main, test-dev ]
pull_request:
branches: [ main ]
workflow_call:
inputs:
ref:
description: 'Git ref to checkout'
required: false
type: string
default: ''
artifact_retention_days:
description: 'Days to retain the artifact'
required: false
type: number
default: 7
outputs:
artifact_name:
description: 'Name of the uploaded artifact'
value: ${{ jobs.build.outputs.artifact_name }}

jobs:
build:
runs-on: ubuntu-latest
outputs:
artifact_name: debrief-vsix

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -25,63 +43,32 @@ jobs:
- name: Compile TypeScript
run: npm run compile

- name: Install vsce
run: |
# Install vsce with fallback to local installation
npm install -g @vscode/vsce || npm install @vscode/vsce

- name: Package extension
run: npx @vscode/vsce package --out extension.vsix
run: |
# Package the extension
if which vsce > /dev/null 2>&1; then
vsce package --out extension.vsix
else
npx vsce package --out extension.vsix
fi

# Verify package was created
if [ -f extension.vsix ]; then
echo "✅ Extension packaged successfully"
ls -la *.vsix
else
echo "❌ Extension packaging failed"
exit 1
fi

- name: Upload extension artifact
uses: actions/upload-artifact@v4
with:
name: extension-vsix
path: "extension.vsix"
retention-days: 30

- name: Post codespace link comment
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const repoUrl = context.repo.owner + '/' + context.repo.repo;
const branch = context.payload.pull_request.head.ref;
const codespaceUrl = `https://codespaces.new/${repoUrl}?quickstart=1&ref=${branch}`;

// Delete existing extension build comments
const comments = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});

const botComments = comments.data.filter(comment =>
comment.user.login === 'github-actions[bot]' &&
(comment.body.includes('Extension built successfully!') ||
comment.body.includes('Open in GitHub Codespaces') ||
comment.body.includes('codespace'))
);

for (const comment of botComments) {
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id
});
console.log(`Deleted comment ${comment.id}`);
}

// Post new comment
const comment = `🚀 **Extension built successfully!**

The VS Code extension has been packaged and is ready for testing.

**Try it in a codespace:**
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](${codespaceUrl})

The extension will be automatically installed when the codespace starts up.`;

const newComment = await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});

console.log(`Posted new comment ${newComment.data.id}`);
name: debrief-vsix
path: extension.vsix
retention-days: ${{ inputs.artifact_retention_days }}
155 changes: 155 additions & 0 deletions .github/workflows/main-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Main Branch Production Deployment

on:
push:
branches: [main]
workflow_dispatch:
inputs:
force_deploy:
description: 'Force deployment even if no changes detected'
required: false
default: false
type: boolean

concurrency:
group: main-production-deploy
cancel-in-progress: true

jobs:
build-extension:
uses: ./.github/workflows/build-extension.yml
with:
artifact_retention_days: 7

deploy-production:
needs: build-extension
runs-on: ubuntu-latest

steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Download extension artifact
uses: actions/download-artifact@v4
with:
name: debrief-vsix
path: .

- name: Setup Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@master

- name: Verify Fly CLI installation
run: |
echo "PATH: $PATH"
which flyctl
flyctl version

- name: Configure production deployment
id: config
run: |
APP_NAME="main-futuredebrief"
PRODUCTION_URL="https://${APP_NAME}.fly.dev"

echo "app_name=${APP_NAME}" >> $GITHUB_OUTPUT
echo "production_url=${PRODUCTION_URL}" >> $GITHUB_OUTPUT

# Use production configuration
cp fly-production.toml fly.toml

echo "Production deployment configuration:"
cat fly.toml

- name: Deploy to Fly.io Production
id: deploy
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
run: |
APP_NAME="${{ steps.config.outputs.app_name }}"

# Check if app exists, create if it doesn't
if ! flyctl apps list | grep -q "^${APP_NAME}"; then
echo "Creating new production app: ${APP_NAME}"
flyctl apps create "${APP_NAME}" --org personal
else
echo "Production app ${APP_NAME} exists, updating..."
fi

# Deploy the application
echo "Deploying to production: ${APP_NAME}..."
echo "Starting deployment at $(date)"

# Deploy with timeout protection
timeout 600 flyctl deploy --app "${APP_NAME}" --dockerfile ./Dockerfile \
--build-arg GITHUB_SHA="${{ github.sha }}" \
--build-arg BRANCH="main" \
--wait-timeout 300 \
--strategy immediate \
--verbose || {
echo "Deployment timed out or failed after 10 minutes"
echo "Checking app status..."
flyctl status --app "${APP_NAME}" || true
exit 1
}

echo "Deployment completed at $(date)"

# Check deployment status
echo "Checking production deployment status..."
flyctl status --app "${APP_NAME}"

# Check recent logs for any startup issues
echo "Checking recent logs..."
flyctl logs --app "${APP_NAME}" --limit 50 || true

# Give the app time to fully start
echo "Waiting for app to fully initialize..."
sleep 45

# Verify the app is responding
PRODUCTION_URL="https://${APP_NAME}.fly.dev"
echo "Testing production availability at ${PRODUCTION_URL}..."

# Test with extended timeout for code-server startup
if timeout 120 bash -c "until curl -f -s -m 30 ${PRODUCTION_URL} > /dev/null; do echo 'Waiting for response...'; sleep 10; done"; then
echo "✅ Production app is responding at ${PRODUCTION_URL}"
echo "deployment_status=success" >> $GITHUB_OUTPUT
else
echo "⚠️ Production app deployed but not responding at ${PRODUCTION_URL}"
echo "Checking final app status and logs..."
flyctl status --app "${APP_NAME}" || true
flyctl logs --app "${APP_NAME}" --limit 20 || true
echo "deployment_status=partial" >> $GITHUB_OUTPUT
fi

- name: Create deployment summary
if: steps.deploy.outputs.deployment_status == 'success' || steps.deploy.outputs.deployment_status == 'partial'
run: |
echo "## 🚀 Production Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**🌐 Production URL:** ${{ steps.config.outputs.production_url }}" >> $GITHUB_STEP_SUMMARY
echo "**📦 Build:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "**🕒 Deployed:** $(date -u)" >> $GITHUB_STEP_SUMMARY
echo "**📋 Status:** ${{ steps.deploy.outputs.deployment_status == 'success' && '✅ Healthy' || '⚠️ Partial' }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**🔧 What's included:**" >> $GITHUB_STEP_SUMMARY
echo "- VS Code (code-server) environment" >> $GITHUB_STEP_SUMMARY
echo "- Debrief extension pre-installed" >> $GITHUB_STEP_SUMMARY
echo "- Sample workspace with test files" >> $GITHUB_STEP_SUMMARY
echo "- Always-available production instance" >> $GITHUB_STEP_SUMMARY

- name: Handle deployment failure
if: failure()
run: |
echo "## ❌ Production Deployment Failed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**🔧 Troubleshooting:**" >> $GITHUB_STEP_SUMMARY
echo "- Check the [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for detailed error information" >> $GITHUB_STEP_SUMMARY
echo "- Verify Fly.io account status and billing" >> $GITHUB_STEP_SUMMARY
echo "- Check Fly.io dashboard for app status" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**📋 Details:**" >> $GITHUB_STEP_SUMMARY
echo "- **Build:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Run ID:** \`${{ github.run_id }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Time:** $(date -u)" >> $GITHUB_STEP_SUMMARY
Loading