Logilica Documentation
HomepageDemoBlogContact
  • About Logilica
    • Overview
  • Getting Started
    • Onboarding Data
    • Onboarding Users
    • Setting up Teams
  • Integration
    • Connecting Tools
    • Uploading Custom Data
  • Metrics & Reports
    • Introduction
      • Navigation
      • Dashboards
      • Data Exploration
    • Epics Delivery Tracker
    • Planning
      • Ticket Lead Time
      • Ticket Velocity
      • Ticket Overload
      • Sprint Health
      • Ticket Activities / Risks
    • Code
      • Code Cycle Time
      • Coding Velocity
      • Review Process
      • Developer Health
      • Code Activities / Risks
    • Build
    • Team Management
      • Teams Overview
      • Team Pulse
      • Activity Lens
    • Reports
    • Customization
    • Glossary
  • Configuration
    • User Management
    • Managing Contributors
    • Menu Management
    • Release Detection
    • Targets & Thresholds
    • DORA Configuration
  • Advanced
    • API Token Management
    • Import API
      • API Overview
      • Uploading Planning Data
      • Uploading CI Build Data
        • CDEvents Integration
      • Uploading Test Data
      • Uploading Team Data (beta)
      • Repositories
    • Export API
    • DataStudio
      • Data Models
        • CI Build
        • CI Build Stage
        • Contributor
        • Coverage Commit
        • Coverage File
        • Coverage Label
        • Coverage Test Result
        • Jira Component
        • Jira Epic
        • Jira Hierarchy Issues
        • Jira Issue Hierarchy Link
        • Jira Issue
        • Jira Issue
        • Jira Label
        • Jira Project
        • Jira Release
        • Jira Sprint
        • Project
        • Pull Request
        • Pull Request
        • Release
        • Team
      • Advanced Transformations
    • Integrations: Data Mapping
      • GitHub Projects Support
  • SSO Integration
    • Keycloak SSO
  • Subprocessors
  • Changelog
Powered by GitBook
On this page
  1. Advanced
  2. Import API
  3. Uploading CI Build Data

CDEvents Integration

Uploading CI Builds to Logilica using CDEvents

PreviousUploading CI Build DataNextUploading Test Data

Last updated 1 month ago

CDEvents (Continuous Delivery Events) is a standardized event format for event-driven communication in CI/CD and DevOps systems. Designed to work with platforms like Tekton, Jenkins, ArgoCD, Flux, and other modern DevOps frameworks.

For further details on CDEvents, refer to the official .

Importing CDEvents Build Data

Before using this API, ensure that your CI/CD tooling is configured to emit CDEvents.

To ensure the accuracy of data in Logilica, CDEvents data should adhere to the following guide:

  1. Import a repository to Logilica and fetch the ID through the API or UI. You use this ID in subsequent calls to the Logilica Import API for CDEvents Data.

  2. Send CDEvents to the API. The API expects events in chronological order.

In Logilica, a CI build data entry is constructed across the ingestion of multiple CDEvents events. The creation of the complete CI build entry is triggered when an event with a type of dev.cdevents.pipelinerun.finished is received. Partial CI build entry records are not shown in the Logilica UI. The context.id field is used across the multiple CDEvent events to create one CI build entry in Logilica.

Mapping of CDEvents to Logilica CI Build

The following table outlines how CDEvents are mapped to the attributes of . Each event contributes specific data that is aggregated to form a complete build record

Logilica CI Build
CDEvent Type
CDEvent Field

name

pipelinerun

pipelineName

url

pipelinerun

outcome

startedAt

pipelinerun

timestamp and type includes 'running'

createdAt

pipelinerun

timestamp and type includes ''queued'

completedAt

pipelinerun

timestamp and type includes ''completed'

stages

build

id, timestamp

repoUrl

repository

url

commit

change

id

triggeredBy

customData

pullRequestUrls

customData

In addition, Logilica's CDEvents integration supports the additional fields of triggeredBy and pullRequestUrls through the use of custom data field, specified in a JSON string format (refer to cURL example below).

Using custom data requires the CDEvents to have customDataContentType: "application/json"

Upload Example Using cURL

In the following, we provide an example of how to push your CDEvents data into Logilica for storage and built-in analytics.

The cURL POST command has been provided below. Note, that the POST command uses example data, including the API token lgca_UeRxFs_3RYRJEJtdYp7j7Wa6DirG5NjiYslsb and the example workspace myworkspace. The command URL also includes a placeholder for the repoID to associate the uploaded CD Events with.

curl -L \
  --request POST \
  --url 'https://logilica.io/api/import/v1/cd_events/<repoID>/create' \
  --header 'X-lgca-token: lgca_UeRxFs_3RYRJEJtdYp7j7Wa6DirG5NjiYslsb' \
  --header 'x-lgca-domain: myworkspace' \
  --header 'Content-Type: application/json' \
  --data '{  
    "context": {
        "version": "0.1.2",
        "id": "event-123",
        "source": "/event/source/123",
        "type": "dev.cdevents.pipelinerun.finished",
        "timestamp": "2025-03-05T10:00:00Z"
    },
    "subject": {
        "id": "pipeline-123",
        "source": "/event/source/123",
        "type": "pipelineRun",
        "content": {
            "id": "pipeline-123",
            "source": "/event/source/123"",
            "type": "dev.cdevents.build.finished",
            "pipelineName": "example-pipeline",
            "url": "https://ci.example.com/pipeline/67890",
            "outcome": "success"
        }
    },
    "customData": "{\"triggeredBy\": \"John Doe\", \"pullRequestUrls\": [\"https://github.com/org/pull/123"]}",
    "customDataContentType": "application/json"
}'

API Schema for Importing CDEvents

Create a CDEvent

Important: Ensure the repository you build from is already onboarded in Logilica. The can be used to retrieve the repoId for the endpoint.

Repositories API
CDEvents Specification
CI builds in Logilica
  • Importing CDEvents Build Data
  • Mapping of CDEvents to Logilica CI Build
  • Upload Example Using cURL
  • API Schema for Importing CDEvents
  • Create a CDEvent
  • POSTcd_events/{repoID}/create
post

Create or update a CD event

Path parameters
repoIDstringRequired
Body
customDatastringOptional
customDataContentTypestringOptional
Responses
200
Success
application/json
400
Data given doesn't match schema. Return value will be ZodError with validation message
401
Unauthorized
404
ProjectID not found
application/json
500
Failed to process request
application/json
post
POST /api/import/v1/cd_events/{repoID}/create HTTP/1.1
Host: logilica.io
Content-Type: application/json
Accept: */*
Content-Length: 460

{
  "context": {
    "id": "text",
    "type": "text",
    "source": "text",
    "timestamp": "text",
    "version": "text",
    "schemaUri": "text",
    "chainId": "text",
    "links": [
      {
        "linkType": "text",
        "linkKind": "text",
        "target": {
          "contextId": "text"
        },
        "from": {
          "contextId": "text"
        }
      }
    ]
  },
  "subject": {
    "id": "text",
    "content": {
      "id": "text",
      "source": "text",
      "type": "text",
      "pipelineName": "text",
      "url": "text",
      "outcome": "text",
      "errors": "text"
    },
    "source": "text",
    "type": "text"
  },
  "customData": "text",
  "customDataContentType": "text"
}
{
  "message": "text"
}