From f3b841c7a430ab55721c8cfbc9468163324c75d2 Mon Sep 17 00:00:00 2001 From: lalitmohank Date: Tue, 6 Jan 2026 20:02:05 +0530 Subject: [PATCH] Test: version bump for backward compat test --- .gitignore | 26 ++++++++++++++++++++++++++ Dockerfile | 23 +++++++++++++++++++++++ README.md | 40 ++++++++++++++++++++++++++++++++++++++++ boltic.yaml | 28 ++++++++++++++++++++++++++++ handler.js | 38 ++++++++++++++++++++++++++++++++++++++ package.json | 16 ++++++++++++++++ 6 files changed, 171 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 boltic.yaml create mode 100644 handler.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..feb3d5d --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +# Dependencies +node_modules/ + +# Logs +*.log +npm-debug.log* + +# Environment files +.env +.env.local +.env.*.local + +# IDE +.idea/ +.vscode/ +*.swp +*.swo + +# OS +.DS_Store +Thumbs.db + +# Build artifacts +dist/ +build/ + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2214497 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Dockerfile for test-git-fcz5-handler +FROM node:20-alpine + +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install dependencies (if any) +RUN npm install --production 2>/dev/null || true + +# Copy application code +COPY . . + +# Set environment variables +ENV NODE_ENV=production + +# Expose port (default serverless port) +EXPOSE 8080 + +# Start command will be managed by the serverless runtime +CMD ["node", "handler.js"] + diff --git a/README.md b/README.md new file mode 100644 index 0000000..8cf5dca --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# test-git-fcz5-handler + +## Purpose +Test serverless app for **backward compatibility testing** of conductor's new `serverlessConfig` feature. + +## boltic.yaml Format +This app uses the **OLD format** (no `serverlessConfig` section). + +## Test Scenario + +### Before Deploying New Conductor Code: +1. Create this serverless app +2. Push this code to git +3. Wait for successful build & deploy +4. **From UI, configure:** + - Scaling: Min=2, Max=5, AutoStop=false + - Env: `UI_TEST_VAR=from-ui`, `API_KEY=secret123` + - PortMap: Port=9000 (if needed) +5. Note down all settings + +### After Deploying New Conductor Code: +1. Make a small code change (e.g., update version in handler.js) +2. Push to git +3. Wait for build & deploy +4. **Verify:** + - All UI settings should be PRESERVED + - Scaling should still be Min=2, Max=5 + - Env vars should still have UI_TEST_VAR and API_KEY + - No `serverlessConfig` = No overrides applied + +## Expected Result +✅ All UI-configured settings remain unchanged after push. + +## Files +- `boltic.yaml` - OLD format config (no serverlessConfig) +- `handler.js` - Node.js handler function +- `package.json` - Node.js project config +- `Dockerfile` - Build configuration +- `.gitignore` - Git ignore rules + diff --git a/boltic.yaml b/boltic.yaml new file mode 100644 index 0000000..58501c3 --- /dev/null +++ b/boltic.yaml @@ -0,0 +1,28 @@ +# Test Git Serverless - OLD FORMAT (no serverlessConfig) +# For backward compatibility testing + +app: "test-git-fcz5-handler" +region: "asia-south1" +handler: "handler.handler" +language: "nodejs/20" + +settings: + nodejs: + common_js: false + +build: + builtin: dockerfile + ignorefile: .gitignore + no_cache: false + args: + NODE_ENV: "production" + BUILD_VERSION: "1.0.0" + TEST_CONFIG: "backward-compat-test" + +# NOTE: NO serverlessConfig section here! +# This is intentional for backward compatibility testing. +# After deploying new conductor code, this app should: +# 1. Build successfully +# 2. Keep all UI-configured settings (Env, Scaling, PortMap) +# 3. Not have any config overrides applied + diff --git a/handler.js b/handler.js new file mode 100644 index 0000000..aea6db3 --- /dev/null +++ b/handler.js @@ -0,0 +1,38 @@ +/** + * Test Git Serverless Handler + * For backward compatibility testing + */ + +exports.handler = async (event, context) => { + console.log("Handler invoked - Version 1.0"); + console.log("Event:", JSON.stringify(event, null, 2)); + + // Get environment variables (these should come from UI settings) + const envVars = { + NODE_ENV: process.env.NODE_ENV || "not-set", + BOLT_APPLICATION_NAME: process.env.BOLT_APPLICATION_NAME || "not-set", + BOLT_APPLICATION_SLUG: process.env.BOLT_APPLICATION_SLUG || "not-set", + // Add any custom env vars set from UI here for testing + UI_TEST_VAR: process.env.UI_TEST_VAR || "not-set", + API_KEY: process.env.API_KEY || "not-set", + }; + + return { + statusCode: 200, + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + message: "Hello from test-git-fcz5-handler!", + version: "1.0.0", + timestamp: new Date().toISOString(), + environment: envVars, + testInfo: { + purpose: "Backward compatibility test", + bolticYamlFormat: "OLD (no serverlessConfig)", + expectedBehavior: "UI settings should be preserved after push", + }, + }), + }; +}; + diff --git a/package.json b/package.json new file mode 100644 index 0000000..bf617a4 --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "test-git-fcz5-handler", + "version": "1.0.0", + "description": "Test serverless for backward compatibility testing", + "main": "handler.js", + "scripts": { + "test": "echo \"Test passed\"" + }, + "keywords": ["serverless", "test", "backward-compatibility"], + "author": "Boltic", + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } +} +