Skip to content

fix(ci): repair Agent Sync Hardening, Thingsdata, and Visual Summary workflows - #24

Open
Traky12 wants to merge 3 commits into
mainfrom
traky12-reparar-prs-ci-casto
Open

Traky12 wants to merge 3 commits into
mainfrom
traky12-reparar-prs-ci-casto

Conversation

@Traky12

@Traky12 Traky12 commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Root causes found and fixed

1. Agent Sync Hardening CI — failing on every scheduled run (hourly)
scripts/metrics-sync.sh computes castuo_agent_drift_detection from git status --porcelain. The workflow invokes it as bash scripts/metrics-sync.sh > metrics.prom, so the shell creates the (empty) metrics.prom file in the repo root before the script body runs. That untracked file was then detected as drift by the script itself, so castuo_agent_drift_detection was always 1 and the "Checklist Sabionda" gate always failed.
Fix: use git status --porcelain --untracked-files=no so only changes to tracked files count as drift.

2. Validate Thingsdata IoT Integration — Integration Tests job failing
The mosquitto service healthcheck ran mosquitto_sub -C 1 -W 1, which waits to receive one message on castuo/health. Nothing ever publishes to that topic during service startup, so the command always timed out (exit 27) and Docker marked the container unhealthy, failing the job before any tests ran. Reproduced locally with docker run.
Fix: use mosquitto_pub instead, which only validates the broker accepts a publish and returns immediately.

3. Generate Visual Summary — failing since branch protection was tightened
The workflow tried git push origin HEAD:main directly. main now requires PRs, signed commits, and status checks, so GitHub rejected the push with GH013: Repository rule violations.
Fix: commit to a dedicated chore/visual-summary-<run> branch and open a PR via gh pr create instead of pushing to main directly.

Verification

  • python -c "import yaml; yaml.safe_load(...)" on both edited workflow files — valid YAML.
  • bash -n scripts/metrics-sync.sh — valid syntax.
  • Reproduced the drift bug locally (bash scripts/metrics-sync.sh > metrics.prom inside the repo flips drift to 1); confirmed the fix keeps drift at 0.
  • Reproduced the mosquitto healthcheck failure locally with docker run/docker exec; confirmed mosquitto_pub succeeds immediately while mosquitto_sub -C 1 reliably times out and confirmed the new healthcheck settles to healthy.

Also repaired (separate from this PR)

All 8 open Dependabot PRs (#1, #2, #4, #6, #7, #8, #9, #10) were showing CONFLICTING merge status due to CHANGELOG.md drift against main. Rebased each branch onto current main, keeping main's CHANGELOG.md and discarding the stale auto-generated changelog-preview commit, and force-pushed. All are now MERGEABLE.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

…workflows

- metrics-sync.sh: exclude untracked files from git status when computing
  castuo_agent_drift_detection. The workflow's own 'metrics-sync.sh > metrics.prom'
  redirect created an untracked file in the repo root before the script body ran,
  making drift always report 1 and fail the Sabionda gate every run.
- thingsdata-integration.yml: replace the mosquitto healthcheck (mosquitto_sub -C 1,
  which waits for a message nobody publishes and always times out) with
  mosquitto_pub, which only validates the broker accepts connections.
- generate-visual-summary.yml: stop pushing directly to protected main (rejected
  with GH013 - PR required / signed commits required); open a PR from a
  dedicated branch instead.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 4, 2026 11:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚦 48h Operativity: UNKNOWN

  • TRL9 Gate: UNKNOWN
  • Workflow result: failure
  • Report file: not-generated
  • Gate source: artifacts/operativity/trl9/go-nogo-status.md

Copilot AI review requested due to automatic review settings September 4, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🔍 Resumen de checks del PR #24

Workflow: E2E - Pull Request to Main
Conclusión: success
Run: https://github.com/Traky12/Cast-o/actions/runs/33870021844

  • ✅ Pasados: 15
  • ❌ Fallidos: 4
  • ⏭️ Omitidos/Neutral: 3

Detalle de checks

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🔍 Resumen de checks del PR #24

Workflow: Validate All
Conclusión: failure
Run: https://github.com/Traky12/Cast-o/actions/runs/33870021838

  • ✅ Pasados: 17
  • ❌ Fallidos: 5
  • ⏭️ Omitidos/Neutral: 3

Detalle de checks

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚨 Fallo en workflow

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