Test: version bump for backward compat test
This commit is contained in:
commit
f3b841c7a4
|
|
@ -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/
|
||||||
|
|
||||||
|
|
@ -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"]
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -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",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user