Connect Baserow with GitLab

Engineering teams live in GitLab. GitLab handles everything from source code management to CI/CD pipelines and security scanning.

Product and Operation teams live in Baserow.

Integrating Baserow with GitLab is a favorite among engineering teams because both are open-source and API-first. When these tools are disconnected, stakeholders pester engineers for status updates, and engineers waste time manually updating tracking tickets.

Using both gives velocity and visibility:

  • GitLab automates the technical execution (Build, Test, Deploy). Engineers handle Merge Requests and Pipelines.
  • Baserow manages the business visibility (Sprint priorities, Client deliverables, Release Notes, Approvals, Scope, Launch Comms). Product Managers and Release Leads track releases, ensuring that what is being built matches what was promised to customers.

This integration is typically used to automate issue tracking, manage CI/CD data, or provide a user-friendly interface for technical repository data.

Integration Methods

Method A: Low-Code Automation

This is the most common method for syncing data between the two platforms.

  1. Trigger: An event occurs (e.g., “New Row in Baserow” or “New Issue in GitLab”).
  2. Action: The automation tool maps the data and sends it to the other app.
  3. Authentication: You will need a Baserow Database Token and a GitLab Personal Access Token (PAT).

Method B: Native Webhooks

Best for lightweight, one-way notifications without an intermediary tool.

  • From Baserow to GitLab: Configure a Baserow Webhook to ping a GitLab “Trigger Token” URL to start a pipeline.
  • From GitLab to Baserow: Use a GitLab Webhook (System or Project) to send payload data to a Baserow Webhook URL to log events.

Key Use Cases

  • External Issue Tracking: Non-technical stakeholders submit bugs to a Baserow Form, which automatically creates a GitLab Issue.
  • Release Management: Track deployment statuses in Baserow and trigger GitLab CI/CD pipelines when a row is marked “Ready to Deploy.”
  • Audit Logging: Automatically log every successful GitLab pipeline run into a Baserow table for long-term reporting.
  • OAuth 2.0 SSO: Use GitLab to log into your self-hosted Baserow instance.
Area In GitLab In Baserow
Release Management Pipelines deploy code to Staging/Production environments based on tags (e.g., v2.4.0). Release Managers plan the content of v2.4.0, track “Go/No-Go” approvals from Legal/Marketing, and generate the changelog.
Incident Response Developers work on “Incidents” to fix production outages. The SRE team maintains an “Incident Ledger” in Baserow, tracking Mean Time to Resolution (MTTR), impact analysis, and generating post-mortem PDF reports.
Feature Flags Engineers implement feature flags in code to toggle functionality. Product teams control the rollout percentage in Baserow. A webhook syncs the Baserow “Rollout %” field directly to the application config.
Compliance & Audit GitLab stores the commit history and pipeline logs. Baserow stores the “Change Request” forms required by auditors, linking specific GitLab commits to business approvals for SOX/ISO compliance.

Pipeline Loop

The most robust way to connect these tools is by linking a Baserow Row ID to a GitLab Pipeline.

  1. The Trigger: Baserow sends a Webhook containing a Row ID to GitLab.
  2. The Context: GitLab accepts this ID and stores it as a variable for the duration of the pipeline.
  3. The Feedback: When the pipeline finishes (pass or fail), GitLab uses that ID to write the status back to the specific row in Baserow.

This guide defines the Infrastructure Bridge between the two. Instead of replacing your current workflow, we will add a “Listener” to your GitLab pipelines and a “Dispatcher” to your Baserow tables.

Prerequisites

  • GitLab: A project with CI/CD enabled and Maintainer access.
  • Baserow: A Database Token with Write permissions.

Step 1: Configure the Handshake (Authentication)

Both tools need permission to talk to each other.

  1. In Baserow: Go to Settings → Database Tokens. Create a new token with Write permissions. Copy it.
  2. In GitLab: Go to Settings → CI/CD → Variables.
    • Add a new variable: BASEROW_TOKEN.
    • Paste your token as the Value.
    • Check “Mask variable” (to hide it in logs).

Step 2: The Listener (GitLab Configuration)

We will add a “Trigger Job” to your existing .gitlab-ci.yml file. This job only runs when Baserow asks it to. It acts as a wrapper around your existing scripts.

Add this block to your .gitlab-ci.yml:

`baserow_trigger_job:
  stage: deploy
  image: badouralix/curl-jq
  rules:
    # Only run this job if triggered by the API (e.g., via Baserow Webhook)
    - if: $CI_PIPELINE_SOURCE == "trigger"
  script:
    # 1. READ: Capture the Row ID sent by Baserow
    - export ROW_ID=$(cat $TRIGGER_PAYLOAD | jq -r '.items[0].id')
    
    # 2. WRITE: Tell Baserow "I started working"
    # Replace [YOUR_TABLE_ID] with the ID from your URL
    - |
      curl -X PATCH \
        -H "Authorization: Token ${BASEROW_TOKEN}" \
        -H "Content-Type: application/json" \
        -d '{"Status": "In Progress", "GitLab Job ID": "'"$CI_PIPELINE_ID"'"}' \
        "https://api.baserow.io/api/database/rows/table/[YOUR_TABLE_ID]/${ROW_ID}/?user_field_names=true"

    # 3. EXECUTE: Run your existing deployment or test scripts here
    - echo "Running existing workflows..."
    - ./your_deploy_script.sh

    # 4. FINISH: Tell Baserow "I am done"
    - |
      curl -X PATCH \
        -H "Authorization: Token ${BASEROW_TOKEN}" \
        -H "Content-Type: application/json" \
        -d '{"Status": "Done", "Deploy Link": "'"$CI_PIPELINE_URL"'"}' \
        "https://api.baserow.io/api/database/rows/table/[YOUR_TABLE_ID]/${ROW_ID}/?user_field_names=true"`

Check your webhook’s ‘Last Trigger’ in Baserow to see the exact JSON structure.

Understanding the Logic

  • $TRIGGER_PAYLOAD: When Baserow calls GitLab, it sends the row data. GitLab saves this in a temporary file. We use jq to extract the id of the row that triggered the event.
  • curl -X PATCH: This is the universal way to update Baserow. We use the ROW_ID we captured to ensure we update the exact record that requested the build.

Step 3: Baserow Configuration

Now that GitLab is listening, we need to set up Baserow to shout.

  1. Generate a Trigger Token in GitLab:
    • Go to Settings → CI/CD → Pipeline triggers.
    • Add a trigger (e.g., “Baserow”).
    • Copy the generated Webhook URL (e.g., https://gitlab.com/api/...token=TOKEN).
  2. Create the Webhook in Baserow:
    • Go to your Baserow table.
    • Click Webhooks in the table menu.
    • URL: Paste the GitLab Webhook URL.
    • Method: POST.
    • Trigger Event: Choose what starts the process (e.g., “Row Created” or “Row Updated”).

Universal Application

This architecture works regardless of your specific columns. You just need to map the fields in the curl command to your actual column names.

Your Use Case Baserow Trigger GitLab Action
Release Management Row created in “Releases” table. Run deploy_prod.sh and update Baserow status to “Live”.
Report Generation Status changed to “Generate Report”. Run a Python script to build a PDF and upload the link back to Baserow.
User Provisioning “New Employee” row added. Run a script to create accounts and paste the temp password back into Baserow.

FAQ

Can I update multiple columns at once?

Yes. In the curl data (-d), you can include as many field:value pairs as you like, such as {"Status": "Done", "deployed_at": "2024-01-01"}.

How do I handle errors?

Add an after_script to your GitLab job. This runs even if the main script fails, allowing you to send a {"Status": "Failed"} update back to Baserow so your team knows something went wrong.

after_script:
    - |
      if [ "$CI_JOB_STATUS" != "success" ]; then
        curl -X PATCH -H "Authorization: Token ${BASEROW_TOKEN}" \
        -H "Content-Type: application/json" \
        -d '{"Status": "Failed"}' \
        "https://api.baserow.io/api/database/rows/table/[YOUR_TABLE_ID]/${ROW_ID}/?user_field_names=true"
      fi

Summary

Stakeholders; Marketing, Sales, and Leadership; rarely have access to (or understanding of) the complex pipelines and merge requests inside GitLab. Baserow is the structured operational layer, handling release schedules, compliance auditing, and stakeholder reporting.

You have successfully demonstrated the Closed-Loop Automation pattern:

  1. Request: Source sends ID + Data.
  2. Acknowledge: Target updates Source to “In Progress.”
  3. Process: Target runs internal logic.
  4. Resolve: Target updates Source to “Done” or “Failed.”

Still need help? If you’re looking for something else, please feel free to make recommendations or ask us questions; we’re ready to assist you.