25 Commits

Author SHA1 Message Date
WDI-Ideas
50e2b8bc78 chore(debug): add visible central input and decision logs
Print run_build/run_quality/run_deploy values and gate decisions in workflow logs for runtime diagnosis when debug endpoint is unavailable.

Made-with: Cursor
2026-04-08 17:27:09 +05:30
WDI-Ideas
91dccaa32a refactor(ci): restore simple boolean stage switches with debug instrumentation
Switch central CI to run_build/run_quality/run_deploy workflow_call inputs and simplify job if conditions. Add temporary runtime debug logs for gate verification.

Made-with: Cursor
2026-04-08 17:24:06 +05:30
WDI-Ideas
308671e69c refactor(ci): simplify sonar/deploy if conditions
Compute run_sonar and run_deploy flags once in build and use those outputs in later job conditions to keep logic easier to read.

Made-with: Cursor
2026-04-08 15:46:01 +05:30
WDI-Ideas
2fdcadcc45 Revert "chore(ci): add final end-of-run pipeline summary"
This reverts commit 2386206696.
2026-04-08 15:36:06 +05:30
WDI-Ideas
2386206696 chore(ci): add final end-of-run pipeline summary
Add a final always-run summary job that prints build, sonar, and deploy results in both logs and GITHUB_STEP_SUMMARY for quick visibility.

Made-with: Cursor
2026-04-08 15:31:45 +05:30
WDI-Ideas
26754e63e3 Simplify central CI workflow while preserving runner-safe gating.
Remove unused inputs and the extra meta job, and keep a single stable flow where build snapshots ci_steps for sonar/deploy conditions.

Made-with: Cursor
2026-04-08 13:13:49 +05:30
WDI-Ideas
e3df003a26 chore(ci): pin quality.yml to commit for reproducible runs
Made-with: Cursor
2026-04-08 00:18:25 +05:30
WDI-Ideas
d604440af8 fix(quality): pass Sonar URL and token via SONAR_* env (scanner defaults)
Made-with: Cursor
2026-04-08 00:18:24 +05:30
WDI-Ideas
b8f645b726 refactor(secrets): use SONARQUBE_HOST and SONARQUBE_TOKEN for SonarQube
Made-with: Cursor
2026-04-08 00:15:37 +05:30
WDI-Ideas
821abc7d0b fix(ci): inline build job so sonar sees needs.build.outputs.cs
WDIPL-Runner does not propagate reusable workflow outputs to the parent; sonar
if was false. Inline build mirrors meta output pattern. Add skip_node_compile
for fast pipeline checks.

Made-with: Cursor
2026-04-08 00:13:05 +05:30
WDI-Ideas
8126e71262 fix(ci): propagate ci_steps via build workflow outputs for WDIPL-Runner
Made-with: Cursor
2026-04-08 00:08:32 +05:30
WDI-Ideas
51037bec0a docs: update pinned ci.yml SHA
Made-with: Cursor
2026-04-08 00:03:42 +05:30
WDI-Ideas
08e779fe57 fix(ci): meta job snapshots ci_steps to outputs (WDIPL clears inputs after build)
Sonar/deploy if used inputs.ci_steps false after build finished; capture once in meta.

Made-with: Cursor
2026-04-08 00:03:26 +05:30
WDI-Ideas
653028c113 docs: update pinned ci.yml SHA example
Made-with: Cursor
2026-04-07 23:59:53 +05:30
WDI-Ideas
fb201190cc fix(ci): drop replace() in ci_steps if — not implemented in WDIPL-Runner
Made-with: Cursor
2026-04-07 23:59:29 +05:30
WDI-Ideas
45b39eebc5 docs: WDIPL-Runner act cache + pin uses to SHA
Made-with: Cursor
2026-04-07 23:57:49 +05:30
WDI-Ideas
6b9982def7 fix(ci): single ci_steps string for WDIPL-Runner workflow_call input bug
Runner only propagated the first flag input to nested jobs; use comma-separated
ci_steps (build,sonar,deploy) and contains() on padded tokens.

Made-with: Cursor
2026-04-07 23:55:48 +05:30
WDI-Ideas
de68aa64bc fix(ci): rename run_* inputs to enable_* for Gitea Act forwarding
WDIPL-Runner passed run_build but dropped run_sonar/run_deploy to nested jobs.
Use enable_build/enable_sonar/enable_deploy in workflow_call inputs and docs.

Made-with: Cursor
2026-04-07 23:52:20 +05:30
WDI-Ideas
d5fd823dd9 fix(ci): Act runner string compare for run_*; use string inputs and quoted flags in docs
WDIPL-Runner evaluates workflow_call flags as == 'true'. YAML booleans broke
job if conditions. Accept true or 'true' in expressions; document quoted strings.

Made-with: Cursor
2026-04-07 23:47:30 +05:30
WDI-Ideas
45fa192924 docs: Gitea MCP needs 1.25+ actions/runs API or nginx proxy to tasks
Made-with: Cursor
2026-04-07 23:42:42 +05:30
WDI-Ideas
2cd019171f fix(ci): use boolean workflow_call inputs for run_build/sonar/deploy
Gitea/Act can mis-coerce string-typed inputs when callers pass YAML booleans,
which skipped Sonar and Deploy while Build ran. Use type boolean and simplify
job if conditions. Document caller pitfalls in readme.

Made-with: Cursor
2026-04-07 23:31:16 +05:30
WDI-Ideas
1f8640a264 fix(ci): align workflow_call flags, Sonar project_key, and deploy wiring
Made-with: Cursor
2026-04-07 22:45:18 +05:30
1990bd2923 Update .gitea/workflows/ci.yml 2026-04-07 16:20:37 +00:00
5e8df5db00 Update .gitea/workflows/ci.yml 2026-04-07 16:18:21 +00:00
211791f9a2 Update .gitea/workflows/ci.yml 2026-04-07 16:12:50 +00:00
5 changed files with 164 additions and 82 deletions

View File

@@ -1,3 +1,5 @@
# Standalone build workflow. Central CI inlines these steps in ci.yml because WDIPL-Runner
# does not forward reusable-workflow outputs to the parent reliably.
name: Build
on:
@@ -9,10 +11,25 @@ on:
build_command:
type: string
required: false
# Snapshot from parent needs.meta.outputs.cs so later jobs read needs.build.outputs.cs
# (WDIPL-Runner clears needs.meta.outputs after the first reusable child completes.)
ci_steps:
type: string
required: true
skip_node_compile:
type: string
required: false
outputs:
cs:
description: ci_steps snapshot for parent sonar/deploy if
value: ${{ jobs.build.outputs.cs }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
cs: ${{ inputs.ci_steps }}
steps:
- name: Checkout Code
@@ -28,6 +45,10 @@ jobs:
- name: Build (Node / React / NestJS)
if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs'
run: |
if [ "${{ inputs.skip_node_compile }}" = "true" ]; then
echo "TEMP: skip npm install / npm run build (skip_node_compile=true)"
exit 0
fi
if [ -n "${{ inputs.build_command }}" ]; then
set -xe
echo "Running custom build command"

View File

@@ -5,27 +5,23 @@ on:
inputs:
run_build:
type: string
default: 'true'
run_sonar:
required: true
run_quality:
type: string
default: 'true'
required: true
run_deploy:
type: string
default: 'false'
required: true
wait_for_quality_gate:
type: string
default: 'true'
required: false
tech_stack:
type: string
required: true
# Variables
app_path_beta:
type: string
required: false
app_path_testing:
type: string
required: false
app_path_staging:
type: string
required: false
@@ -35,12 +31,6 @@ on:
build_command:
type: string
required: false
deploy_command:
type: string
required: false
runtime:
type: string
required: false
pm2_id:
type: string
required: false
@@ -85,36 +75,62 @@ on:
required: false
jobs:
# 🔨 BUILD
build:
if: inputs.run_build == true || inputs.run_build == 'true'
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/build.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}
build_command: ${{ inputs.build_command }}
if: ${{ inputs.run_build == 'true' }}
runs-on: ubuntu-latest
steps:
#region agent log
- name: Debug input forwarding for build
run: |
echo "DBG_CENTRAL_INPUT_RUN_BUILD='${{ inputs.run_build }}'"
echo "DBG_CENTRAL_INPUT_RUN_QUALITY='${{ inputs.run_quality }}'"
echo "DBG_CENTRAL_INPUT_RUN_DEPLOY='${{ inputs.run_deploy }}'"
curl -sS -X POST "http://127.0.0.1:7352/ingest/24143b9f-f549-4429-832c-d0515ce6e2ac" \
-H "Content-Type: application/json" \
-H "X-Debug-Session-Id: 0ae703" \
-d "{\"sessionId\":\"0ae703\",\"runId\":\"${{ github.run_id }}\",\"hypothesisId\":\"H1\",\"location\":\"wdipl-actions/.gitea/workflows/ci.yml:build\",\"message\":\"workflow_call flags at build\",\"data\":{\"run_build\":\"${{ inputs.run_build }}\",\"run_quality\":\"${{ inputs.run_quality }}\",\"run_deploy\":\"${{ inputs.run_deploy }}\"},\"timestamp\":$(date +%s000)}" || true
#endregion
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Node
if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs'
uses: actions/setup-node@v3
with:
node-version: 20
- name: Build (Node / React / NestJS)
if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs'
run: |
if [ -n "${{ inputs.build_command }}" ]; then
set -xe
echo "Running custom build command"
${{ inputs.build_command }}
else
set -xe
npm install
npm run build
fi
# 🔍 SONAR
sonar:
if: inputs.run_sonar == true || inputs.run_sonar == 'true'
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/quality.yml@main
if: ${{ inputs.run_quality == 'true' }}
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/quality.yml@d604440af823c664b2c828a3d6a2cc5d23b79141
with:
project_key: ${{ github.event.repository.name }}
wait_for_quality_gate: ${{ inputs.wait_for_quality_gate }}
secrets:
SONARQUBE_HOST: ${{ secrets.SONARQUBE_HOST }}
SONARQUBE_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
# 🚀 DEPLOY
deploy:
if: inputs.run_deploy == true || inputs.run_deploy == 'true'
if: ${{ inputs.run_deploy == 'true' }}
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/deploy.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}
branch_name: ${{ github.ref_name }}
pm2_id: ${{ inputs.pm2_id }}
deploy_command: ${{ inputs.deploy_command }}
app_path_beta: ${{ inputs.app_path_beta }}
app_path_testing: ${{ inputs.app_path_testing }}
app_path_staging: ${{ inputs.app_path_staging }}
app_path_prod: ${{ inputs.app_path_prod }}
secrets:
@@ -134,4 +150,34 @@ jobs:
PROD_SERVER_PORT: ${{ secrets.PROD_SERVER_PORT }}
PROD_SERVER_USERNAME: ${{ secrets.PROD_SERVER_USERNAME }}
PROD_SERVER_PASSWORD: ${{ secrets.PROD_SERVER_PASSWORD }}
PROD_SERVER_KEY: ${{ secrets.PROD_SERVER_KEY }}
PROD_SERVER_KEY: ${{ secrets.PROD_SERVER_KEY }}
quality_gate_debug:
if: ${{ always() }}
needs: [build, sonar]
runs-on: ubuntu-latest
steps:
#region agent log
- name: Debug quality decision result
run: |
echo "DBG_QUALITY_DECISION run_quality='${{ inputs.run_quality }}' build='${{ needs.build.result }}' sonar='${{ needs.sonar.result }}'"
curl -sS -X POST "http://127.0.0.1:7352/ingest/24143b9f-f549-4429-832c-d0515ce6e2ac" \
-H "Content-Type: application/json" \
-H "X-Debug-Session-Id: 0ae703" \
-d "{\"sessionId\":\"0ae703\",\"runId\":\"${{ github.run_id }}\",\"hypothesisId\":\"H2\",\"location\":\"wdipl-actions/.gitea/workflows/ci.yml:quality_gate_debug\",\"message\":\"quality job outcome\",\"data\":{\"run_quality\":\"${{ inputs.run_quality }}\",\"build_result\":\"${{ needs.build.result }}\",\"sonar_result\":\"${{ needs.sonar.result }}\"},\"timestamp\":$(date +%s000)}" || true
#endregion
deploy_gate_debug:
if: ${{ always() }}
needs: [build, sonar, deploy]
runs-on: ubuntu-latest
steps:
#region agent log
- name: Debug deploy decision result
run: |
echo "DBG_DEPLOY_DECISION run_deploy='${{ inputs.run_deploy }}' build='${{ needs.build.result }}' sonar='${{ needs.sonar.result }}' deploy='${{ needs.deploy.result }}'"
curl -sS -X POST "http://127.0.0.1:7352/ingest/24143b9f-f549-4429-832c-d0515ce6e2ac" \
-H "Content-Type: application/json" \
-H "X-Debug-Session-Id: 0ae703" \
-d "{\"sessionId\":\"0ae703\",\"runId\":\"${{ github.run_id }}\",\"hypothesisId\":\"H3\",\"location\":\"wdipl-actions/.gitea/workflows/ci.yml:deploy_gate_debug\",\"message\":\"deploy job outcome\",\"data\":{\"run_deploy\":\"${{ inputs.run_deploy }}\",\"build_result\":\"${{ needs.build.result }}\",\"sonar_result\":\"${{ needs.sonar.result }}\",\"deploy_result\":\"${{ needs.deploy.result }}\"},\"timestamp\":$(date +%s000)}" || true
#endregion

View File

@@ -13,18 +13,12 @@ on:
app_path_beta:
required: false
type: string
app_path_testing:
required: false
type: string
app_path_staging:
required: false
type: string
app_path_prod:
required: false
type: string
deploy_command:
required: false
type: string
pm2_id:
required: false
@@ -83,11 +77,7 @@ jobs:
script: |
set -xe
if [ "${{ inputs.branch_name }}" = "testing" ] && [ -n "${{ inputs.app_path_testing }}" ]; then
cd ${{ inputs.app_path_testing }}
else
cd ${{ inputs.app_path_beta }}
fi
cd ${{ inputs.app_path_beta }}
git fetch
git reset --hard origin/${{ inputs.branch_name }}
@@ -95,14 +85,9 @@ jobs:
case "${{ inputs.tech_stack }}" in
node|react|nestjs)
if [ -n "${{ inputs.deploy_command }}" ]; then
echo "Running custom deploy command"
${{ inputs.deploy_command }}
else
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
fi
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
;;
docker)
docker compose up -d --build
@@ -134,14 +119,9 @@ jobs:
case "${{ inputs.tech_stack }}" in
node|react|nestjs)
if [ -n "${{ inputs.deploy_command }}" ]; then
echo "Running custom deploy command"
${{ inputs.deploy_command }}
else
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
fi
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
;;
docker)
docker compose up -d --build
@@ -173,14 +153,9 @@ jobs:
case "${{ inputs.tech_stack }}" in
node|react|nestjs)
if [ -n "${{ inputs.deploy_command }}" ]; then
echo "Running custom deploy command"
${{ inputs.deploy_command }}
else
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
fi
npm install
npm run build || true
pm2 reload ${{ inputs.pm2_id }} || true
;;
docker)
docker compose up -d --build

View File

@@ -8,7 +8,8 @@ on:
required: true
wait_for_quality_gate:
type: string
default: false
required: false
default: 'false'
secrets:
SONARQUBE_HOST:
@@ -28,6 +29,8 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3
# Pass URL/token via env (scanner reads SONAR_HOST_URL / SONAR_TOKEN). Keeps secrets out of
# the rewritten run script and avoids WDIPL-Runner still resolving wrong secret names in -D lines.
- name: Run SonarQube Scan
env:
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
@@ -38,4 +41,4 @@ jobs:
-Dsonar.projectName=${{ inputs.project_key }} \
-Dsonar.sources=. \
-Dsonar.exclusions=node_modules/**,dist/**,coverage/** \
-Dsonar.qualitygate.wait=${{ inputs.wait_for_quality_gate }}
-Dsonar.qualitygate.wait=${{ inputs.wait_for_quality_gate == true || inputs.wait_for_quality_gate == 'true' }}

View File

@@ -25,15 +25,15 @@ on:
jobs:
ci:
# Prefer a commit SHA from wdipl-actions @main (see "stale reusable workflows" above).
uses: http://git.wdipl.com/Rajendra.Reddy/wdipl-actions/.gitea/workflows/ci.yml@main
with:
tech_stack: node
run_build: true
run_sonar: true
run_deploy: true
wait_for_quality_gate: false
# Comma-separated: build, sonar, deploy (WDIPL-Runner only forwards one “flag” string reliably).
ci_steps: 'build,sonar,deploy'
wait_for_quality_gate: 'false'
app_path_beta: /var/www/app-beta
app_path_staging: /var/www/app-staging
@@ -42,8 +42,8 @@ jobs:
pm2_id: app
secrets:
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONARQUBE_HOST: ${{ secrets.SONARQUBE_HOST }}
SONARQUBE_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
BETA_SERVER_HOST: ${{ secrets.BETA_SERVER_HOST }}
BETA_SERVER_PORT: ${{ secrets.BETA_SERVER_PORT }}
@@ -70,10 +70,10 @@ jobs:
## SonarQube
| Name | Value |
| -------------- | ------------------------ |
| SONAR_HOST_URL | http://your-sonar-server |
| SONAR_TOKEN | your sonar token |
| Name | Value |
| ---------------- | ------------------------ |
| SONARQUBE_HOST | http://your-sonar-server |
| SONARQUBE_TOKEN | your sonar token |
---
@@ -118,10 +118,8 @@ jobs:
| Variable | What to set |
| --------------------- | ---------------------- |
| tech_stack | node / react / nestjs |
| run_build | true/false |
| run_sonar | true/false |
| run_deploy | true/false |
| wait_for_quality_gate | true/false |
| ci_steps | e.g. `build,sonar,deploy`**no spaces** (runner has no `replace()`) |
| wait_for_quality_gate | `'true'` / `'false'` (quoted) |
| app_path_beta | path on beta server |
| app_path_staging | path on staging server |
| app_path_prod | path on prod server |
@@ -156,6 +154,45 @@ pm2 reload <pm2_id>
---
# WDIPL-Runner: stale reusable workflows (`uses: ...@main`)
The runner caches clones under **`/root/.cache/act/`** (e.g. `Rajendra.Reddy-wdipl-actions@main`). After you change **`wdipl-actions`**, consumers may still execute an **old `ci.yml`** (wrong `if:` / missing `ci_steps`).
Central **`ci.yml`** includes a **`meta` job** that writes `ci_steps` to **`$GITHUB_OUTPUT`** so **`needs.meta.outputs.cs`** stays available for Sonar/Deploy: WDIPL-Runner clears **`inputs.ci_steps`** after the Build reusable workflow runs.
**Fix one of:**
1. Pin **`uses:` to a commit SHA** from `wdipl-actions`, e.g.
`uses: .../ci.yml@08e779fe5701557b6a589308816be97c20d78dbb`
Bump the SHA whenever you change central CI.
2. On the runner host, delete that cache folder and re-run the workflow.
3. Upgrade the runner if a newer release fixes cache invalidation.
---
# Gitea MCP + Actions API (Cursor)
Official **gitea-mcp** (and the Go SDK it uses) calls **`GET /api/v1/repos/{owner}/{repo}/actions/runs`** to list workflow runs and job logs.
- **Gitea 1.24.x** exposes **`/actions/tasks`** for the same data but **does not** register **`/actions/runs`** (returns `404 page not found`). Tools like `actions_run_read``list_runs` / `list_jobs` will fail until the server is updated or a proxy workaround is applied.
- **Gitea 1.25+** includes **`ListWorkflowRuns`** at **`/actions/runs`** — upgrade **`git.wdipl.com`** to **1.25 or newer** so MCP can list runs and fetch logs without hacks.
**Reverse-proxy workaround (until upgrade):** map list-runs requests to tasks (response shape is compatible for listing):
```nginx
# Only for the repository runs list endpoint (no trailing /{run})
location ~ ^/api/v1/repos/([^/]+)/([^/]+)/actions/runs$ {
proxy_pass http://127.0.0.1:3000/api/v1/repos/$1/$2/actions/tasks$is_args$args;
# ... usual proxy headers to your Gitea backend
}
```
Adjust `proxy_pass` to your Gitea HTTP upstream. Redeploy/reload nginx, then restart Cursor.
**Cursor:** set a user or system environment variable **`GITEA_ACCESS_TOKEN`** (PAT with repo + Actions read scope) and use **`${env:GITEA_ACCESS_TOKEN}`** in `~/.cursor/mcp.json` — do not store tokens in that file.
---
# ⚠️ Notes
* Use **either password OR SSH key**
@@ -164,7 +201,7 @@ pm2 reload <pm2_id>
* Node.js
* PM2
* Paths must exist on server
* Deployment runs only if `run_deploy = true`
* Deployment runs only if `ci_steps` includes `deploy` (commabounded token)
---