Skip to content

Sync Upsun skill with latest configuration guidance (a38676782c33)#22

Closed
ganeshdipdumbare wants to merge 1 commit intomainfrom
auto/sync-upsun-skill-a38676782c33-3651585
Closed

Sync Upsun skill with latest configuration guidance (a38676782c33)#22
ganeshdipdumbare wants to merge 1 commit intomainfrom
auto/sync-upsun-skill-a38676782c33-3651585

Conversation

@ganeshdipdumbare
Copy link
Copy Markdown
Contributor

Automated sync of the Upsun skill with configuration guidance in the internal platformsh/ai repository.

Signature: a38676782c33

Rationale (from the generator): 28 reference file(s) generated/updated (0 NO_UPDATES/errors); core: Add cross-links to all per-language/framework reference files and clarify composable image note; keep existing core concepts and examples intact.

Provenance — each output is regenerated from the listed source(s):

Output (in upsun/ai) Sourced from (in platformsh/ai)
plugins/upsun/skills/upsun/references/config.md prompts/genconf/text/00-instructions.md.jinja, prompts/genconf/text/01-reference.md.jinja, prompts/genconf/text/02-composable-image.md.jinja, prompts/genconf/text/03-registry.md.jinja, prompts/genconf/text/04-source-info.md.jinja, prompts/genconf/text/06-retrieved.md.jinja, prompts/genconf/text/correction.md.jinja
plugins/upsun/skills/upsun/references/config/directus.md guides/per-result/directus.md.jinja
plugins/upsun/skills/upsun/references/config/django.md guides/per-result/django.md.jinja
plugins/upsun/skills/upsun/references/config/drupal.md guides/per-result/drupal.md.jinja
plugins/upsun/skills/upsun/references/config/echo.md guides/per-result/echo.md.jinja
plugins/upsun/skills/upsun/references/config/express.md guides/per-result/express.md.jinja
plugins/upsun/skills/upsun/references/config/flask.md guides/per-result/flask.md.jinja
plugins/upsun/skills/upsun/references/config/gatsby.md guides/per-result/gatsby.md.jinja
plugins/upsun/skills/upsun/references/config/gin.md guides/per-result/gin.md.jinja
plugins/upsun/skills/upsun/references/config/go.md guides/per-group/go.md.jinja
plugins/upsun/skills/upsun/references/config/hugo.md guides/per-result/hugo.md.jinja
plugins/upsun/skills/upsun/references/config/jekyll.md guides/per-result/jekyll.md.jinja
plugins/upsun/skills/upsun/references/config/js.md guides/per-group/js.md.jinja
plugins/upsun/skills/upsun/references/config/laravel.md guides/per-result/laravel.md.jinja
plugins/upsun/skills/upsun/references/config/nextjs.md guides/per-result/nextjs.md.jinja
plugins/upsun/skills/upsun/references/config/nuxt.md guides/per-result/nuxt.md.jinja
plugins/upsun/skills/upsun/references/config/php.md guides/per-group/php.md.jinja
plugins/upsun/skills/upsun/references/config/python.md guides/per-group/python.md.jinja
plugins/upsun/skills/upsun/references/config/rails.md guides/per-result/rails.md.jinja
plugins/upsun/skills/upsun/references/config/reactjs.md guides/per-result/reactjs.md.jinja
plugins/upsun/skills/upsun/references/config/ruby.md guides/per-group/ruby.md.jinja
plugins/upsun/skills/upsun/references/config/sinatra.md guides/per-result/sinatra.md.jinja
plugins/upsun/skills/upsun/references/config/static.md guides/per-group/static.md.jinja
plugins/upsun/skills/upsun/references/config/strapi.md guides/per-result/strapi.md.jinja
plugins/upsun/skills/upsun/references/config/sylius.md guides/per-result/sylius.md.jinja
plugins/upsun/skills/upsun/references/config/symfony.md guides/per-result/symfony.md.jinja
plugins/upsun/skills/upsun/references/config/vite.md guides/per-result/vite.md.jinja
plugins/upsun/skills/upsun/references/config/vuejs.md guides/per-result/vuejs.md.jinja
plugins/upsun/skills/upsun/references/config/wordpress.md guides/per-result/wordpress.md.jinja

Source locations in platformsh/ai:

  • prompts/genconf/text/*.md.jinja — cross-cutting templates (feed SKILL.md + references/config.md).
  • guides/per-group/<lang>.md.jinja — per-language references.
  • guides/per-result/<framework>.md.jinja — per-framework references.

This PR was opened automatically. Please review for voice and accuracy before merging — the generator may occasionally over-reach. If the changes aren't wanted, close the PR; a subsequent run will open a FRESH PR on a new branch (the closed PR stays closed). A new PR will also be opened automatically when the source guidance changes or when upstream drifts.

Copilot AI review requested due to automatic review settings April 21, 2026 13:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Automated sync updating the Upsun skill’s configuration reference docs to match the internal guidance source, adding cross-links and introducing/refreshing per-language/framework reference pages under references/config/.

Changes:

  • Expanded references/config.md with composable image guidance and links to per-language/framework reference files.
  • Added 28 new per-language/framework reference files under references/config/ (Node/Vite/Vue/React/Next/Nuxt, PHP frameworks, Python frameworks, Go frameworks, Ruby frameworks, CMS tools, and static-site generators).

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
plugins/upsun/skills/upsun/references/config.md Core configuration reference updates (hooks, .environment, composable images, and links to per-framework docs).
plugins/upsun/skills/upsun/references/config/directus.md Directus Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/django.md Django Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/drupal.md Drupal Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/echo.md Echo (Go) Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/express.md Express Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/flask.md Flask Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/gatsby.md Gatsby Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/gin.md Gin (Go) Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/go.md General Go Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/hugo.md Hugo Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/jekyll.md Jekyll Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/js.md General Node.js Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/laravel.md Laravel Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/nextjs.md Next.js Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/nuxt.md Nuxt Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/php.md General PHP Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/python.md General Python Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/rails.md Rails Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/reactjs.md React (static) Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/ruby.md General Ruby Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/sinatra.md Sinatra Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/static.md Static sites Upsun configuration reference (incl. composable images).
plugins/upsun/skills/upsun/references/config/strapi.md Strapi Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/sylius.md Sylius Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/symfony.md Symfony Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/vite.md Vite Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/vuejs.md Vue.js Upsun configuration reference.
plugins/upsun/skills/upsun/references/config/wordpress.md WordPress Upsun configuration reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +32 to +38
NODE_ENV=production
DATABASE_CLIENT=postgres
APP_KEYS=$PLATFORM_PROJECT_ENTROPY
API_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY
ADMIN_JWT_SECRET=$PLATFORM_PROJECT_ENTROPY
TRANSFER_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY
JWT_SECRET=$PLATFORM_PROJECT_ENTROPY
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The .environment file is described as a shell script sourced at runtime; lines like NODE_ENV=production won’t be exported to the app process unless they use export .... Update the heredoc to emit export statements (or otherwise ensure these variables are in the process environment).

Suggested change
NODE_ENV=production
DATABASE_CLIENT=postgres
APP_KEYS=$PLATFORM_PROJECT_ENTROPY
API_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY
ADMIN_JWT_SECRET=$PLATFORM_PROJECT_ENTROPY
TRANSFER_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY
JWT_SECRET=$PLATFORM_PROJECT_ENTROPY
export NODE_ENV=production
export DATABASE_CLIENT=postgres
export APP_KEYS=$PLATFORM_PROJECT_ENTROPY
export API_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY
export ADMIN_JWT_SECRET=$PLATFORM_PROJECT_ENTROPY
export TRANSFER_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY
export JWT_SECRET=$PLATFORM_PROJECT_ENTROPY

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +29
build: |
set -ex
npm ci --omit=dev
npm run build

Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

Using npm ci --omit=dev and then running npm run build will fail for many Vue/Vite projects because build tooling (e.g., Vite) is typically in devDependencies and will be omitted. Install dev dependencies for the build step (e.g., npm ci), and optionally prune dev deps after the build if you need to reduce runtime footprint.

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +33
hooks:
build: |
set -ex
npm ci --omit=dev
npm run build

Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

Using npm ci --omit=dev and then running npm run build will fail for typical Vite apps because Vite is usually a devDependency. Install dev dependencies for the build, and prune afterwards only if needed.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +30
hooks:
build: |
set -ex
# Use a production install and build the static site
npm install --omit=dev
npm run build

Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

npm install --omit=dev followed by npm run build is likely to omit Gatsby itself (often a devDependency) and break builds. Prefer installing dev dependencies during build (e.g., npm ci) and prune afterwards only if you need to shrink runtime.

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +36
cat > .environment <<EOF
CACHE_ENABLED=true
CACHE_STORE=redis
REDIS_HOST=$REDIS_HOST
REDIS_PORT=$REDIS_PORT
RATE_LIMITER_ENABLED=true
RATE_LIMITER_STORE=redis
RATE_LIMITER_REDIS_HOST=$REDIS_HOST
RATE_LIMITER_REDIS_PORT=$REDIS_PORT
KEY=$PLATFORM_PROJECT_ENTROPY
SECRET=$PLATFORM_PROJECT_ENTROPY
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The build hook writes .environment using an unquoted heredoc, so $REDIS_HOST/$REDIS_PORT will be expanded during the build phase (when relationship variables are not available) and end up empty at runtime. Write these lines in a way that defers expansion to runtime (e.g., quote the heredoc delimiter or escape $), and ensure variables meant for the app process are exported in .environment.

Suggested change
cat > .environment <<EOF
CACHE_ENABLED=true
CACHE_STORE=redis
REDIS_HOST=$REDIS_HOST
REDIS_PORT=$REDIS_PORT
RATE_LIMITER_ENABLED=true
RATE_LIMITER_STORE=redis
RATE_LIMITER_REDIS_HOST=$REDIS_HOST
RATE_LIMITER_REDIS_PORT=$REDIS_PORT
KEY=$PLATFORM_PROJECT_ENTROPY
SECRET=$PLATFORM_PROJECT_ENTROPY
cat > .environment <<'EOF'
export CACHE_ENABLED=true
export CACHE_STORE=redis
export REDIS_HOST=$REDIS_HOST
export REDIS_PORT=$REDIS_PORT
export RATE_LIMITER_ENABLED=true
export RATE_LIMITER_STORE=redis
export RATE_LIMITER_REDIS_HOST=$REDIS_HOST
export RATE_LIMITER_REDIS_PORT=$REDIS_PORT
export KEY=$PLATFORM_PROJECT_ENTROPY
export SECRET=$PLATFORM_PROJECT_ENTROPY

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +63
## Managed services (common)

Example minimal service definitions (image tags use current registry versions):

```yaml
services:
- name: postgres
image: postgres:16
env:
POSTGRES_USER: app
POSTGRES_PASSWORD: secret
POSTGRES_DB: app_db

- name: redis
image: redis:7.4
```
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The “Managed services” snippet uses a Docker/compose-style image: format, which doesn’t match Upsun’s services: <name>: { type: ... } configuration. Since this file is an Upsun config reference, consider rewriting that section using Upsun service definitions and relationship env var conventions to avoid confusion.

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +46
export ADMIN_EMAIL='admin@example.com'
export ADMIN_PASSWORD='password'
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

This example bootstraps Directus with hard-coded admin credentials (admin@example.com / password). Even as guidance, this is likely to be copy-pasted into production and creates an immediate account-takeover risk. Prefer reading admin email/password from Upsun variables/secrets (or omit the bootstrap credential values and instruct the user to set them explicitly).

Suggested change
export ADMIN_EMAIL='admin@example.com'
export ADMIN_PASSWORD='password'
: "${ADMIN_EMAIL:?Set ADMIN_EMAIL as an Upsun environment variable or secret before first deploy}"
: "${ADMIN_PASSWORD:?Set ADMIN_PASSWORD as an Upsun environment variable or secret before first deploy}"
export ADMIN_EMAIL ADMIN_PASSWORD

Copilot uses AI. Check for mistakes.
fi

# Configure Django settings for Upsun
export settings_dir=$(basename "$(dirname "$(find . -Maxdepth 4 -path './.*' -prune -o -name settings.py -print | head -n1)")")
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

find uses -Maxdepth here, but the POSIX/GNU option is -maxdepth (lowercase). As written, settings_dir will be empty and the settings auto-configuration block won’t run.

Suggested change
export settings_dir=$(basename "$(dirname "$(find . -Maxdepth 4 -path './.*' -prune -o -name settings.py -print | head -n1)")")
export settings_dir=$(basename "$(dirname "$(find . -maxdepth 4 -path './.*' -prune -o -name settings.py -print | head -n1)")")

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +34
echo >> "$settings_dir"/settings.py "\n# Upsun configuration"
echo >> "$settings_dir"/settings.py 'ALLOWED_HOSTS = ["*"]'
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The build hook appends ALLOWED_HOSTS = ["*"] to settings.py, which disables host header validation and is unsafe for production. Prefer deriving the allowed host(s) from the primary route at runtime, or setting a narrow default and instructing users to configure it explicitly.

Suggested change
echo >> "$settings_dir"/settings.py "\n# Upsun configuration"
echo >> "$settings_dir"/settings.py 'ALLOWED_HOSTS = ["*"]'
cat >> "$settings_dir"/settings.py <<'EOF'
# Upsun configuration
import base64
import json
import os
def _upsun_allowed_hosts():
routes = os.environ.get("PLATFORM_ROUTES")
if not routes:
return ["localhost", "127.0.0.1", "[::1]"]
try:
decoded = base64.b64decode(routes).decode("utf-8")
route_map = json.loads(decoded)
except Exception:
return ["localhost", "127.0.0.1", "[::1]"]
hosts = []
for url in route_map.keys():
try:
host = url.split("://", 1)[1].split("/", 1)[0]
if host:
hosts.append(host)
except Exception:
continue
return hosts or ["localhost", "127.0.0.1", "[::1]"]
ALLOWED_HOSTS = _upsun_allowed_hosts()
EOF

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +75
/wp/wp-content/cache:
root: web/wp/wp-content/cache
scripts: false
allow: false
/wp/wp-content/uploads:
root: web/app/uploads
scripts: false
allow: false
rules:
'(?<!\-lock)\.(?i:jpe?g|gif|png|svg|bmp|ico|css|js(?:on)?|eot|ttf|woff|woff2|pdf|docx?|xlsx?|pp[st]x?|psd|odt|key|mp[2-5g]|m4[av]|og[gv]|wav|mov|wm[av]|avi|3g[p2])$':
allow: true
expires: 1w

mounts:
web/app/wp-content/cache:
source: tmp
web/app/uploads:
source: storage
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The WordPress cache location root (web/wp/wp-content/cache) doesn’t match the cache mount path (web/app/wp-content/cache). As written, the cache directory served/blocked by the web location won’t be the same directory that’s writable/mounted. Align the web.locations roots with the mounts paths for the chosen variant (Bedrock vs standard) to avoid runtime write failures and misconfigured access rules.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants