Skip to content

Pipeline dashboard#249

Open
JacobCoffee wants to merge 27 commits into
cabotage:mainfrom
JacobCoffee:pipeline-dashboard
Open

Pipeline dashboard#249
JacobCoffee wants to merge 27 commits into
cabotage:mainfrom
JacobCoffee:pipeline-dashboard

Conversation

@JacobCoffee

@JacobCoffee JacobCoffee commented Mar 14, 2026

Copy link
Copy Markdown
Member

Description

Enables the Pipeline tab

  • adds prometheus exporter to celeyr
  • adds some db columns to track other data
image

Closes #247

@JacobCoffee JacobCoffee mentioned this pull request Mar 14, 2026
@JacobCoffee JacobCoffee requested a review from ewdurbin March 14, 2026 22:01
Comment thread cabotage/celery/tasks/build.py Outdated
Comment thread cabotage/celery/metrics.py Outdated
@ewdurbin

Copy link
Copy Markdown
Contributor

Hmmmmm, most of these stats should be accessible via querying the database via .created, .updated, and .built/.error for images and .complete/.error without any additional telemetry.

Can we start there, then consider telemetry later?

JacobCoffee and others added 10 commits March 28, 2026 12:10
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Run black formatter on deploy.py, views.py, migration
- Add nosec B608 to f-string SQL with hardcoded table names
- Fix migration chain: down_revision -> e5f9a2c7d834

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Narrow _REGISTRY type with an early return guard instead of assert
(which bandit flags as B101).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JacobCoffee

Copy link
Copy Markdown
Member Author

splitting push gateway and metrics stuff

JacobCoffee and others added 2 commits March 28, 2026 12:25
The pipeline dashboard derives all stats from existing DB columns
(created, updated, built, error, complete). The prometheus_client
pushgateway integration can be added later when needed.

Removes: cabotage/celery/metrics.py, all record_*_metrics() calls,
PUSHGATEWAY_URL config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JacobCoffee

Copy link
Copy Markdown
Member Author

Pushgateway telemetry split out to #319 for later pickup.

@JacobCoffee

Copy link
Copy Markdown
Member Author
image mucho better

Comment thread cabotage/server/models/projects.py
JacobCoffee and others added 6 commits March 28, 2026 13:18
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Spreads images/releases/deployments across 72h with varied build
durations so the pipeline dashboard shows meaningful charts and stats.
Also fixes seed login message (port 8000, correct credentials).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SQLAlchemy's Timestamp mixin overwrites `updated` on commit.
Defer timestamp assignments to raw UPDATE statements after the
final commit so pipeline dashboard shows realistic durations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JacobCoffee and others added 2 commits March 28, 2026 13:18
Spreads deploys across 90 days so 7d/30d/90d range filters
show different data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread cabotage/celery/tasks/deploy.py Outdated
Comment thread cabotage/celery/tasks/deploy.py Outdated
Comment thread pyproject.toml
JacobCoffee and others added 2 commits March 28, 2026 13:27
Reverts TESTING guards in render_process_container and
render_podspec, and removes REGISTRY_PULL_K8S/TESTING config
that were local dev workarounds, not pipeline features.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JacobCoffee JacobCoffee requested review from ewdurbin and removed request for ewdurbin March 28, 2026 18:30
@JacobCoffee

Copy link
Copy Markdown
Member Author

@ewdurbin i think this is a lil bit smaller and nicer now, only using the db stuff we have. doing a final passthrough check on the py code but could use your review for a merge

JacobCoffee and others added 2 commits March 28, 2026 13:34
The deferred _timestamp_fixups machinery was unnecessary — SQLAlchemy's
`default=` only fires when no value is provided, so setting created/updated
directly after flush() works fine.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JacobCoffee

JacobCoffee commented Mar 28, 2026

Copy link
Copy Markdown
Member Author

Code Review — Pipeline Dashboard

Cross-check review via Codex (gpt-5.4, xhigh effort).

Must Fix

# Severity File Issue
1 High views.py:6989 "Total" runtime computes deployment.updated - image.created which includes idle gaps between stages. Should sum image.duration + release.duration + deploy.duration instead.
2 High build.py:1660 image.completed_at = datetime.datetime.utcnow() is a no-op — no mapped completed_at column exists on the Image model. This is a transient Python attribute that gets discarded. Remove it.
3 High pipeline.html:510, views.py:6950 Range selector (7d/30d/90d) does not filter "Recent Runs". loadRuns() never sends range param, and the backend endpoint has no range filter.
4 Medium pipeline.html:483, views.py:6809 Stage-average badges are mathematically wrong — averaging per-day averages gives a one-run day the same weight as a hundred-run day. Compute overall averages server-side.
5 Medium views.py:6956-6957 offset/limit query params will 500 on non-integer input. Use request.args.get("offset", 0, type=int).

Should Fix

# Severity File Issue
6 Low pipeline.html:444-447 Throughput bars (Success/Failure) overlap on days with both — same bar path/alignment, no stacking. One series hides the other.
7 Low pyproject.toml:82 Bandit exclusion of entire cabotage/scripts dir is too broad. Use inline # nosec B608 on the specific line instead.
8 Low pipeline.html:36, 135 Dead CSS: .pipe-kpi-sub is unused, .u-legend override is redundant since legend.show = false is already set.
9 Low projects.py:879, 1492 trigger_type on Release and Image models is dead code — only Deployment.trigger_type is consumed by the UI.

Confirmed OK

  • SQL queries are injection-safe: user-controlled values are bound params, interpolated identifiers come from hardcoded choices only.
  • No TESTING guards or mimir/loki-conf workarounds remain in the pipeline code.
  • duration_seconds properties are a reasonable approach given the "use existing DB columns" decision, with the caveat that updated is mutable (noted above).

@JacobCoffee

JacobCoffee commented Mar 28, 2026

Copy link
Copy Markdown
Member Author

7 Low pyproject.toml:82 Bandit exclusion of entire cabotage/scripts dir is too broad. Use inline # nosec B608 on the specific line instead.

i think itd be better to move scripts up a level outside of the real cabotage module code in another PR

JacobCoffee and others added 3 commits March 28, 2026 13:44
Removes the broken defer/fixup mechanism. Instead, backdates
all pipeline timestamps via raw SQL after the final ORM commit,
bypassing SQLAlchemy's onupdate handlers. 15 runs across 90 days.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Instrument Celery

2 participants