KCIDB I/O Library
raw JSON → 141 verified Mon Apr 27 auth: no python
I/O library for KCIDB, the Linux Kernel CI reporting system. Handles schema validation, data loading, submission, and querying against Google Cloud Platform BigQuery. Current version 141 (2025), requires Python >=3.10, major schema v4 with renamed 'revisions' to 'checkouts'.
pip install kcidb-io Common errors
error AttributeError: module 'kcidb' has no attribute 'load' ↓
cause load() is in kcidb.io submodule, not top-level.
fix
Use 'from kcidb.io import load'.
error google.api_core.exceptions.Forbidden: 403 Access denied ↓
cause Client lacks BigQuery permissions on the project/dataset or GOOGLE_APPLICATION_CREDENTIALS not set.
fix
Ensure service account has BigQuery Data Editor role. Set GOOGLE_APPLICATION_CREDENTIALS or provide credentials parameter.
error TypeError: expected dictionary, got str ↓
cause submit() expects a dict, not a JSON string.
fix
Pass a Python dictionary: client.submit({'version': {'major':4, 'minor':0}, 'checkouts': []}).
Warnings
breaking Schema v4 renamed 'revisions' to 'checkouts'. Data using v3 field names will fail validation. ↓
fix Update all data to use 'checkouts' instead of 'revisions'. kcidb-io v141 (and its schema) no longer accepts 'revisions'.
deprecated Environment variable KCIDB_GS_KEYFILE is deprecated. Use GOOGLE_APPLICATION_CREDENTIALS or explicit credentials parameter. ↓
fix Unset KCIDB_GS_KEYFILE and export GOOGLE_APPLICATION_CREDENTIALS='/path/to/key.json'.
gotcha Validation of internal consistency is disabled by default. To enable, set KCIDB_VALIDATE_INTERNAL=1. ↓
fix Export KCIDB_VALIDATE_INTERNAL=1 in environment before importing.
Imports
- Client
from kcidb import Client - load wrong
from kcidb import loadcorrectfrom kcidb.io import load - schema
from kcidb import schema
Quickstart
import os
from kcidb import Client
client = Client(project=os.environ.get('GCP_PROJECT', 'my-project'), dataset='kernelci04', credentials=os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''))
client.submit({'version': {'major': 4, 'minor': 0}, 'checkouts': []})