Repository navigation
feat(health): GitLab CI + Bitbucket Pipelines sensors (even out git-host support) - #34
Merged
Merged
Conversation
Adds the httpGet path to HealthDeps (REST-API probes) + two sensors so kit health covers all three git hosts: - gitlab-ci: GitLab /pipelines API (GITLAB_TOKEN); red on latest failed terminal pipeline. - bitbucket-pipelines: Bitbucket /pipelines API (BITBUCKET_TOKEN or username+app-password); red on latest COMPLETED FAILED/ERROR. Both record the host/path checked and report unknown (never false green) on missing token / non-OK response / no remote. Selected by CI-file presence (.gitlab-ci.yml / bitbucket-pipelines.yml). Shared parseGitRemote handles SSH+HTTPS. Also: analyze CI-file detection now sees bitbucket-pipelines.yml (was github + gitlab only). Parsers/auth/remote fixture-tested vs documented schemas; live API smoke pending a real GitLab/Bitbucket project.
|
✅ Docker image built successfully
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
kit healthcover all three git hosts. GitHub Actions already had a sensor; this adds GitLab CI + Bitbucket Pipelines, plus the HTTP-probe path the sentinel design said the first HTTP sensor would introduce.Framework
HealthDeps.httpGet(url, headers)+defaultHealthDeps.httpGet(fetch, 15s timeout, network error → not-ok/status-0 → sensor maps tounknown).HealthCtx.gitlabCi/.bitbucketPipelinesselection signals;cmdHealthcomputes them from.gitlab-ci.yml/bitbucket-pipelines.ymlpresence.Sensors (REST API, not CLI — stable documented schemas)
GET /api/v4/projects/:path/pipelineswithGITLAB_TOKEN; red when the most recent terminal pipelinefailed.GET /2.0/repositories/:ws/:repo/pipelines/withBITBUCKET_TOKEN(orBITBUCKET_USERNAME+BITBUCKET_APP_PASSWORD); red when the latestCOMPLETEDpipeline result isFAILED/ERROR(STOPPED/cancelled is not red).host/paththey checked, and reportunknown(never a falsegreen) on missing token, non-OK response, or no git remote. SharedparseGitRemotehandles SSH + HTTPS (incl. GitLab subgroups).Also (the level-1 consistency gap)
analyze's CI-file detection now recognizesbitbucket-pipelines.yml(it knew.github/workflows+.gitlab-ci.ymlbut missed Bitbucket).Verify
npm run build && npm test→ build clean, 1333 tests, 0 fail (~24 new: remote-parse, both sensors' parse/auth/probe, selection).Honest caveat: the parsers, auth, and remote-parsing are fixture-tested against the documented GitLab/Bitbucket API schemas; the live API wiring isn't smoke-tested here (no real GitLab/Bitbucket project + tokens in this env), unlike the GitHub sensor which was smoke-run against the real repo. First live run on a real project is the remaining check.
🤖 Generated with Claude Code