Skip to content

feat: add TeamCity CI/CD provider (pull + webhook, 96 unit tests)#6170

Open
chengyixu wants to merge 1 commit intokeephq:mainfrom
chengyixu:feat/teamcity-provider
Open

feat: add TeamCity CI/CD provider (pull + webhook, 96 unit tests)#6170
chengyixu wants to merge 1 commit intokeephq:mainfrom
chengyixu:feat/teamcity-provider

Conversation

@chengyixu
Copy link
Copy Markdown

Summary

Implements the TeamCity provider requested in #4444.

TeamCity is a widely-used JetBrains CI/CD server used by thousands of engineering teams. This provider brings failed builds into Keep as alerts for unified incident correlation.

Two integration modes

Pull mode — Keep polls TeamCity's REST API (/app/rest/builds) for failed (FAILURE) and cancelled (CANCELED) builds. Up to 150 recent builds are fetched per cycle and surfaced as alerts.

Webhook (push) mode — TeamCity build events can be forwarded to Keep via:

Auth config

Field Required Description
deployment_url Yes TeamCity server URL (e.g. http://tc:8111)
access_token One of Personal Access Token (Profile → Access Tokens, TC 2019.1+)
username + password One of HTTP Basic auth for older deployments
verify_ssl No Disable for self-signed certs (default: true)

Severity + status mapping

Build status Keep severity Keep status
FAILURE High FIRING
ERROR Critical FIRING
CANCELED Warning FIRING
UNKNOWN Info FIRING
SUCCESS Low RESOLVED

Test coverage (96 tests)

  • Auth config validation: token path, username/password path, missing auth, bad URL
  • _headers() and _auth() helpers
  • validate_scopes: both scopes pass, API error returns error string
  • _build_to_alert_dto: 11 status variants, 9 severity variants, name construction (project/build/number), description with status text + branch, identity fields (buildId, buildNumber, buildTypeId, buildName, projectName, branchName, url), label extraction, triggered-by, non-dict handling
  • _parse_tc_datetime: TeamCity compact format (20240615T142300+0000), ISO string, Unix epoch, None/empty/bad inputs
  • Timestamp fields: startDate → startedAt, finishDate → lastReceived
  • _format_alert: single build, list of builds, empty list, mixed valid/invalid, status preserved
  • _get_alerts: failed builds, cancelled builds, combined results, API error, non-list response, alert severity and source
  • Provider metadata: display name, categories, tags, scopes, fingerprint fields, status/severity map coverage

Closes #4444

/claim #4444

Implements the TeamCity provider requested in keephq#4444.

JetBrains TeamCity is a widely-used CI/CD server. Keep integrates via
two modes:

**Pull mode** — Keep polls TeamCity's REST API for failed (FAILURE) and
cancelled (CANCELED) builds and surfaces them as alerts for unified
incident correlation. Fetches up to 150 recent builds per cycle.

**Webhook (push) mode** — TeamCity build events are forwarded to Keep
via the Tcwebhooks plugin or a custom build step curl command.

Auth supports Personal Access Tokens (TeamCity 2019.1+) and HTTP Basic
auth (username + password).

Severity: FAILURE → High, ERROR → Critical, CANCELLED → Warning,
SUCCESS → Low.  Status: FAILURE/ERROR/CANCELLED → FIRING, SUCCESS → RESOLVED.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

@chengyixu is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 29, 2026
@dosubot dosubot bot added Feature A new feature Provider Providers related issues labels Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Bounty claim Feature A new feature Provider Providers related issues size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🔌 Provider]: Teamcity

1 participant