Skip to content

Feature request: API endpoint to commit LookML file changes #1665

Description

@roanny

Summary

The Looker API provides endpoints to create, update, and delete LookML project files (POST/PUT/DELETE /projects/{id}/files), but there is no endpoint to commit those changes to the git branch. Changes made via the API remain as uncommitted working tree modifications.

This creates a gap in the programmatic LookML development lifecycle: tools can create and modify files, but cannot commit them without human intervention via the Looker IDE.

Current behavior

Operation API Endpoint Result
Create file POST /projects/{id}/files File saved to working tree (uncommitted)
Update file PUT /projects/{id}/files File updated in working tree (uncommitted)
Delete file DELETE /projects/{id}/files File removed from working tree (uncommitted)
Commit changes None No API equivalent
Deploy to production POST /projects/{id}/deploy_to_production Pushes existing commits only — does not commit pending changes

Evidence

Using looker-sdk v26.4.0 (Python):

import looker_sdk

sdk = looker_sdk.init40()
sdk.update_session(looker_sdk.models40.WriteApiSession(workspace_id="dev"))

# Get branch ref before file creation
branch_before = sdk.git_branch("my_project")
print(f"ref before: {branch_before.ref}")  # e.g., abc123

# Create a file via undocumented API (same as Looker IDE uses internally)
# POST /4.0/projects/my_project/files with body {"path": "views/test.view.lkml", "content": "..."}

# Check file git status
files = sdk.all_project_files("my_project")
for f in files:
    if "test" in f.path:
        print(f"git_status: {f.git_status}")
        # Output: git_status: GitStatus(action='add', text='New file')

# Branch ref is unchanged — no commit was made
branch_after = sdk.git_branch("my_project")
print(f"ref after: {branch_after.ref}")  # same abc123 — unchanged

Impact on branch switching

Because changes are uncommitted, they are workspace-scoped, not branch-scoped. When switching branches via PUT /projects/{id}/git_branch, uncommitted changes travel with the user to the new branch (unlike the IDE which blocks the switch). This makes it impossible to work on parallel feature branches via the API — changes from one branch contaminate the other.

Requested endpoint

A POST /projects/{project_id}/git/commit (or similar) that:

  1. Commits all pending changes on the current dev branch
  2. Accepts an optional message parameter for the commit message
  3. Optionally pushes to the remote (or this could be a separate step)

This would complete the programmatic LookML development lifecycle:
dev_modecreate/update_project_filevalidate_projectgit/commitdeploy_to_production

Use case

MCP Toolbox for Looker (googleapis/genai-toolbox) and custom MCP servers use the file management APIs to let AI agents generate LookML code. Without a commit endpoint, the generated code requires manual intervention via the IDE to reach production, breaking the automated pipeline.

Environment

  • SDK: looker-sdk 26.4.0 (Python)
  • API version: 4.0
  • Looker instance: Google Cloud core 26.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions