conduit-repo-client
Shared client for committing files to a Conduit project's configured repository — GitHub (Contents API) or Azure DevOps (Git Items + Pushes API). No clone, no local git. Extracted from Conduit Scripter's plan 069 P2 repo-sync implementation as plan 031 v2's shared package.
Install
pip install conduit-repo-client
Usage
import conduit_repo_client as repo_client
creds = admin_client.get_project_credentials(project_id) # Admin repo_* fields
# Code repo target (e.g. Scripter deployed procedures)
settings = repo_client.repo_settings(creds)
if settings:
result = repo_client.commit_file(
settings, "usp_Transform_CustTable.sql", script_sql,
message="Deploy usp_Transform_CustTable",
author_name=user.name, author_email=user.email,
committer_name="Conduit Scripter", committer_email="scripter@conduitai.net",
)
# result: {"status": "committed" | "unchanged", "commit_sha", "file_url"}
# Wiki target (plan 031 v2 — e.g. Profiler publishing generated documents)
wiki = repo_client.repo_settings(creds, target="wiki")
if wiki:
repo_client.commit_file(
wiki, "Data-Migration/Profiler/Quality-Standards/CustTable.md", markdown,
message="Publish Data Quality Standards — CustTable",
author_name=user.name, author_email=user.email,
)
Key behaviours:
repo_settingsreturnsNonewhen the project has no usable configuration for the target — callers skip publishing/committing silently.- Idempotent: unchanged content is a no-op (
status: "unchanged"), decided by git blob-sha comparison before any write — identical semantics on both providers. - The caller's primary action stands if the commit fails (
RepoCommitError) — never roll back a deploy/publish because the repository was unreachable. - Path defaults: the repo target defaults to the repository root (Scripter
supplies its own
procedures/default); the wiki target always uses the root — consumers pass full page paths. - Wiki resolution: explicit
wiki_urlwins; otherwise, for ADO code repos, the project wiki's backing git repo is inferred (…/{project}/_git/{project}.wiki, default branchwikiMaster). GitHub wikis are NOT reachable via the Contents API — GitHub projects must pointwiki_urlat an ordinary docs repo instead. The same Code (Read & Write) PAT authenticates both targets.
Data-boundary rule (plan 031 v2)
This package is a dumb push client — what is pushable is each consumer's policy decision. Documents containing customer row-level values (e.g. Validator reconciliation/evidence output) must never be published through it.
Development
pip install -e .[dev]
pytest
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file conduit_repo_client-0.1.0.tar.gz.
File metadata
- Download URL: conduit_repo_client-0.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b236ad4bf3e0e6fcfca19e302eff7663a5be986d12f8e107aa7f0a3f8f475d26
|
|
| MD5 |
2af5a8b223cf052bcea8569283adb1be
|
|
| BLAKE2b-256 |
2d5727aed533770b1b05d7915f11b2f1d280867868062bcea8dcf8b7b3f2d143
|
File details
Details for the file conduit_repo_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: conduit_repo_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42f1da7d6e3acfd37b983ac1151c5f54150a5d042ff6d562d5035d34ef21f673
|
|
| MD5 |
5a20a2114c3509fb59c35e25954837d3
|
|
| BLAKE2b-256 |
e4bbaaebacc6ed38d28b11e500db1cdf6148ef98a188633188523bd2afc70ce1
|