Commit Graph
183 Commits
Author SHA1 Message Date
evangelostsak d2906a9f63 fix(web-app-penpot): clear Playwright failures on role success 2026-06-06 08:22:12 +02:00
evangelostsak 7168af76ff fix(web-app-penpot): use JVM_OPTS to point to custom truststore with CA cert 2026-06-06 08:22:12 +02:00
evangelostsak 09239316f3 fix(web-app-penpot): import CA cert into JVM default cacerts so OIDC TLS works 2026-06-06 08:22:12 +02:00
evangelostsak f2f5f6276f fix(web-app-penpot): render PENPOT_SMTP_TLS as lowercase boolean 2026-06-06 08:22:12 +02:00
evangelostsak f36387a0b6 fix(web-app-penpot): remove environment passthrough that overrides env_file values
Backend/exporter/frontend services were listing environment variables
without values (e.g. - PENPOT_DATABASE_PASSWORD) which causes Docker
Compose to pass through from host environment. Since these aren't set
on the host, they become null and override the env_file values.

Fixed by removing environment sections - env_file already contains all
needed variables with correct values.
2026-06-06 08:22:12 +02:00
evangelostsak f1cf4a227a fix(web-app-penpot): use proper YAML multiline format for backend command
Changed from single-line array format to multiline YAML block style
for better readability and to avoid potential parsing issues with
complex shell commands containing comments and special characters.

The container-based SSL certificate import approach is correct since
keytool only exists inside the Java container, not on the host.
2026-06-06 08:22:11 +02:00
evangelostsak 751fc7225c fix(web-app-penpot): remove backend healthcheck, let Playwright handle readiness
- Removed backend healthcheck that was blocking stack startup
- Backend depends_on redis (healthy), frontend waits for backend (started)
- Playwright test.beforeAll() already polls backend API for up to 16 minutes
- This matches pattern from commit 332ef7833 (other roles without healthchecks)
- Avoids Docker Compose blocking on backend health determination
- Simpler, more reliable: let application-level tests handle readiness
2026-06-06 08:22:11 +02:00
evangelostsak 1784a6fef8 fix(web-app-penpot): use bash TCP socket for healthcheck instead of wget/curl
- Changed from wget/curl (not available in penpotapp/backend image) to bash TCP socket
- Uses: exec 3<>/dev/tcp/localhost/6060 with HTTP GET request
- Pure bash built-in, guaranteed to work since backend command uses /bin/bash
- Matches pattern used by other roles (e.g., sys-svc-container/templates/healthcheck/tcp.yml.j2)
2026-06-06 08:22:11 +02:00
evangelostsak a35ce714dd fix(web-app-penpot): use robust healthcheck with wget/curl fallback and longer start period
- Change healthcheck to try wget first, then curl as fallback (more compatible)
- Increase start_period from 120s to 300s (5 minutes) for Java backend startup
- Backend needs time for: SSL cert import, DB migrations, JVM warmup
- Total healthcheck timeout: 5min start + (10 retries * 30s interval) = ~10min max
2026-06-06 08:22:11 +02:00
evangelostsak d06d632440 fix(web-app-penpot): add backend healthcheck and fix service dependencies
- Add healthcheck to backend service (curl http://localhost:6060/)
  * interval: 30s, timeout: 10s, retries: 10, start_period: 120s
  * This ensures backend is truly ready before tests run
- Update depends_on to use health conditions instead of just service_started
  * frontend waits for backend to be healthy
  * backend and exporter wait for redis to be healthy
- Add unsafe-eval to script-src-elem and script-src-attr in CSP config
  * Ensures CSP2 fallback merge includes unsafe-eval for Penpot's eval() usage

Fixes #204 - Resolves 502 Bad Gateway errors during Playwright tests by ensuring proper container startup ordering
2026-06-06 08:22:11 +02:00
evangelostsak 9d41d0472b fix(web-app-penpot): increase beforeAll timeout to 16 minutes
The test.beforeAll() hook polls backend API for up to 15 minutes to wait
for Java backend startup. However, Playwright's default beforeAll timeout
is only 5 minutes (300s), causing 'beforeAll hook timeout exceeded' error.

Add test.setTimeout(960000) at start of beforeAll hook to set 16-minute
timeout (15min wait + 1min buffer), allowing sufficient time for backend
readiness check to complete in CI environment.

Fixes CI run 25076502349 failure where CSP test failed with:
'beforeAll hook timeout of 300000ms exceeded'

Ref: #204
2026-06-06 08:22:11 +02:00
evangelostsak 88c942d65b fix(web-app-penpot): add backend readiness check in Playwright tests
- Backend startup can take 10-15 minutes (Java, SSL certs, DB migrations)
- Without wait, tests hit Bad Gateway error from frontend
- Poll /api/rpc/command/get-profile endpoint before tests run
- Accept 200/401/403 status codes (all mean backend is responding)
- 15-minute timeout with 5-second retry interval
- Replaces Ansible uri_retry with Playwright-based wait
2026-06-06 08:22:11 +02:00
evangelostsak 347611b20f fix(web-app-penpot): wait for login container instead of body
Penpot frontend briefly shows black screen during JavaScript initialization.
Wait for actual login UI elements (main_ui_auth_login, auth, login classes)
instead of just body element to ensure frontend fully loaded before tests.

Increases timeout to 120s to handle slow CI initialization.
2026-06-06 08:22:11 +02:00
evangelostsak 3a9c4efb68 fix(web-app-penpot): remove uri_retry waits - let Playwright handle timing
Removed both frontend and backend uri_retry waits from main.yml.
Penpot has no post-deploy Ansible configuration tasks, so these waits
serve no purpose and cause CI failures (502 Bad Gateway after 15min).

Pattern analysis of 10+ other roles shows uri_retry is only used when
post-deploy Ansible tasks need to configure the application (e.g., Gitea,
Odoo). Roles without such tasks (Taiga, Discourse, Matrix, Mattermost, etc.)
have no waits and rely on Playwright's generous built-in timeouts (60-120s).

Local test results: 4/4 Playwright tests passed in 1.3m
- CSP test: 3.7s
- Admin OIDC login/logout: 29.4s
- Biber OIDC login/logout: 18.8s
- Project creation: 24.0s

Fixes CI deployment timeout that occurred in runs 25045210187,
25053926236, and 25060875762 where backend API check failed with
502 after 181 retries (15 minutes).
2026-06-06 08:22:11 +02:00
evangelostsak d073a82a21 Replace fixed pause with active backend API polling
After analyzing CI runs 25045210187 and 25053926236:
- Even with 180s pause, SPA still showing loading screen (3 img tags)
- Frontend HTTP 200 doesn't guarantee backend is ready
- CI artifacts show backend takes longer to initialize

Solution: Actively poll backend API endpoint until it responds.
Using /api/main/methods/get-profile with uri_retry, accepting
200/401/403 status codes (auth errors mean API is up).

Max wait: 180 retries × 5s = 15 minutes
2026-06-06 08:22:11 +02:00
evangelostsak daf1f443bd Increase SPA initialization pause from 90s to 180s for CI
After analyzing CI artifacts from run 25045210187:
- Admin test: SPA still showing loading screen (3 img tags)
- Biber test: SPA loaded but backend returned Bad Gateway

90s was insufficient for both SPA initialization and backend
readiness in CI's resource-constrained environment. Increasing to
180s to provide adequate buffer for full stack initialization.
2026-06-06 08:22:11 +02:00
evangelostsak 9b264bb981 feat(web-app-penpot): customize SSO button text and add SPA initialization pause
Changes:
1. SSO Button Customization:
   - Set PENPOT_OIDC_NAME to 'SSO with Infinito.nexus' (replaces 'OpenID')
   - Pass variable to frontend and backend containers
   - Update Playwright tests to recognize new button text

2. SPA Initialization Fix:
   - Add 90s pause after frontend HTTP check passes
   - Root cause: Nginx responds immediately but Penpot SPA needs time to:
     * Load JavaScript bundles
     * Initialize ClojureScript/React app
     * Render OIDC login button
   - CI error: 'No OIDC login button found' - button not rendered yet
   - Tests were starting before SPA fully initialized
   - Solution: Give CI environment time for resource-constrained initialization

Verified:
- Local deployment: 17 minutes
- All 4 Playwright tests passing (1.1m)
2026-06-06 08:22:11 +02:00
evangelostsak 4912aa79e7 fix(web-app-penpot): add 90s pause for SPA initialization
Root cause: Frontend HTTP 200 != JavaScript app ready
- Nginx responds immediately but Penpot SPA needs time to:
  * Load JavaScript bundles
  * Initialize ClojureScript/React app
  * Render OIDC login button
- CI error: 'No OIDC login button found' - button not rendered yet
- Tests were starting before SPA fully initialized

Solution: Add 90s pause after frontend HTTP check passes
- Gives CI environment time for resource-constrained initialization
- Addresses actual failure: button missing, not container readiness
2026-06-06 08:22:11 +02:00
evangelostsak 66ad32b835 fix(web-app-penpot): use docker exec to check backend health (port not published to host) 2026-06-06 08:22:11 +02:00
evangelostsak a8c82a6649 fix(web-app-penpot): add lifecycle: beta to enable CI discovery 2026-06-06 08:22:11 +02:00
evangelostsak dd8e861e63 fix(web-app-penpot): remove unused variables PENPOT_CONFIG_DIRECTORY, PENPOT_INSTANCE_DIRECTORY, PENPOT_DATABASE_VOLUME 2026-06-06 08:22:11 +02:00
evangelostsak e5d533d230 fix(README): update maintainer information and website link 2026-06-06 08:22:11 +02:00
evangelostsak 87a3ca6cf3 feat(penpot): add main.yml for Penpot configuration including OIDC, LDAP, and Docker settings 2026-06-06 08:22:11 +02:00
evangelostsak 788a9d0c7a feat(penpot): add administrator user configuration in main.yml 2026-06-06 08:22:11 +02:00
evangelostsak 9df5913b36 feat(penpot): add playwright.env.j2 template for Playwright configuration 2026-06-06 08:22:11 +02:00
evangelostsak 696bf2eec7 feat(penpot): add env.j2 template for Penpot configuration including OIDC and LDAP settings 2026-06-06 08:22:11 +02:00
evangelostsak f09f081876 feat(penpot): add Docker Compose configuration for frontend, backend, exporter, and Redis services 2026-06-06 08:22:10 +02:00
evangelostsak 7ef199a89c feat(penpot): add main.yml for web-app-penpot tasks and deployment 2026-06-06 08:22:10 +02:00
evangelostsak d35852f8be feat(penpot): add main.yml for Penpot deployment metadata 2026-06-06 08:22:10 +02:00
evangelostsak ed2918cadf feat(penpot): add Playwright tests for OIDC login, logout, and project creation 2026-06-06 08:22:10 +02:00
evangelostsak 902f1aba2a feat(penpot): add custom JavaScript file for Penpot frontend integration 2026-06-06 08:22:10 +02:00
evangelostsak 561deda310 feat(penpot): add main configuration file for web-app-penpot services 2026-06-06 08:22:10 +02:00
evangelostsak 71921a6fb6 feat(penpot): add README documentation for Penpot deployment and features 2026-06-06 08:22:10 +02:00