Skip to content

Commit 9bab8e9

Browse files
Update CodeBoarding dependency to 0.13.5 (#70)
* Update CodeBoarding dependency to 0.13.5 * fix: stream engine progress logs in actions Amp-Thread-ID: https://ampcode.com/threads/T-019fcbb1-bdf5-76be-8cab-1a4b798b49cd Co-authored-by: Amp <amp@ampcode.com> --------- Co-authored-by: Amp <amp@ampcode.com>
1 parent 2f33d13 commit 9bab8e9

5 files changed

Lines changed: 37 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Review mode does not need `contents: write`: PR-specific generated files are sto
306306
| `mode` | both | `review` | `review` posts the PR architecture-diff comment; `sync` analyzes on push and commits the architecture (`analysis.json` + rendered docs) to `target_branch`, keeping it versioned and current. |
307307
| `github_token` | both | `${{ github.token }}` | Token for GitHub API calls; in review mode it posts or updates the PR comment. |
308308
| `push_token` | sync | `${{ github.token }}` | Token for sync-mode delivery. The workflow token can push when the workflow grants `permissions: contents: write`. Separate from `github_token` so commenting can use a GitHub App token while the push uses the workflow token. In `sync_strategy: pull_request` it also opens/updates the rolling PR, so it must additionally carry `pull-requests: write`. |
309-
| `codeboarding_version` | both | `0.13.4` | CodeBoarding PyPI package version used as the analysis engine. Pin for reproducibility. |
309+
| `codeboarding_version` | both | `0.13.5` | CodeBoarding PyPI package version used as the analysis engine. Pin for reproducibility. |
310310
| `depth_level` | both | empty (`2` for cold starts) | Analysis depth for first analysis and `force_full` rebuilds. Max depends on tier: **3** on the free hosted tier, **10** with a CodeBoarding license or your own `llm_api_key`. Once `.codeboarding/analysis.json` exists, its `metadata.depth_level` is the source of truth: sync runs incremental at the baseline depth, and review analyzes the PR head at the committed baseline depth so the diff is apples-to-apples (clamped to the tier max). |
311311
| `render_depth` | review | `1` | Display depth for the PR diagram. Keep `1` for a clean top-level view. |
312312
| `diagram_direction` | review | `LR` | Mermaid direction: `LR`, `TD`, `TB`, `RL`, or `BT`. |
@@ -362,7 +362,7 @@ Full local pipeline:
362362

363363
```bash
364364
export OPENROUTER_API_KEY=sk-or-...
365-
python -m pip install codeboarding==0.13.4
365+
python -m pip install codeboarding==0.13.5
366366
codeboarding-setup --auto-install-npm
367367
scripts/run_local.sh --repo /path/to/repo --base <base-ref> --head <head-ref>
368368
```

‎action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ inputs:
3434
codeboarding_version:
3535
description: 'CodeBoarding PyPI package version used as the analysis engine. Pin for reproducibility; set to a newer released version to opt into newer engine releases.'
3636
required: false
37-
default: '0.13.4'
37+
default: '0.13.5'
3838
depth_level:
3939
description: 'Analysis depth for cold-start or force_full rebuilds. Max depends on tier: 3 on the free hosted tier, 10 with a CodeBoarding license or your own llm_api_key. Once .codeboarding/analysis.json exists, its metadata.depth_level is the source of truth: sync runs incremental at the baseline depth, and review analyzes the PR head at the committed baseline depth so the diff is apples-to-apples (clamped to the tier max). Empty (default): 2 for cold starts.'
4040
required: false

‎scripts/engine_adapter.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,15 @@
7878
from diagram_analysis import RunContext, RunPaths
7979
from diagram_analysis.exceptions import IncrementalCacheMissingError
8080
from diagram_analysis.io_utils import write_fingerprint
81+
from logging_config import setup_logging
8182
from static_analyzer import get_static_analysis
8283
from static_analyzer.analysis_cache import StaticAnalysisCache
8384
from static_analyzer.cluster_helpers import build_all_cluster_results
8485
except Exception: # engine package not installed (metadata-only subcommands don't need it)
8586
BaselineUnavailableError = IncrementalCacheMissingError = _MissingEngine = type("_MissingEngine", (Exception,), {})
8687
run_full = run_incremental = render_docs = None
8788
RunContext = RunPaths = None
89+
setup_logging = None
8890
get_static_analysis = StaticAnalysisCache = build_all_cluster_results = None
8991
hash_repo_source_files = write_fingerprint = None
9092

@@ -718,6 +720,7 @@ def main(argv=None) -> int:
718720
os.environ.setdefault("CODEBOARDING_SOURCE", source)
719721
if args.cmd in _ENGINE_COMMANDS:
720722
_require_engine(args.cmd)
723+
setup_logging(default_level=os.getenv("CODEBOARDING_LOG_LEVEL", "INFO"))
721724
try:
722725
if args.cmd == "base":
723726
run_base(args.repo, args.out, args.name, args.run_id, args.depth, args.source_sha)

‎tests/test_engine_adapter.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def model_dump(self, **kwargs):
9191
da.exceptions = exc
9292
_preload("diagram_analysis.analysis_json", UnifiedAnalysisJson=_InitialUnifiedAnalysisJson)
9393
_preload("diagram_analysis.io_utils", write_fingerprint=lambda *a, **k: None)
94+
_preload("logging_config", setup_logging=lambda **kwargs: None)
9495
_preload("agents.content_hash", hash_repo_source_files=lambda *a, **k: {})
9596
_preload("agents")
9697
_preload("codeboarding_workflows.rendering", render_docs=lambda *args, **kwargs: None)
@@ -113,6 +114,7 @@ def model_dump(self, **kwargs):
113114
"diagram_analysis.analysis_json",
114115
"diagram_analysis.exceptions",
115116
"diagram_analysis.io_utils",
117+
"logging_config",
116118
"health",
117119
"health.models",
118120
"health.runner",
@@ -219,6 +221,33 @@ def test_main_parses_depth_as_int(self):
219221
)
220222
self.assertEqual(rf.calls[0]["depth_level"], 2)
221223

224+
def test_main_enables_engine_console_logging(self):
225+
self._install()
226+
setup_logging = _Rec()
227+
with (
228+
patch.object(engine_adapter, "setup_logging", setup_logging),
229+
patch.dict(os.environ, {"CODEBOARDING_LOG_LEVEL": "DEBUG"}),
230+
):
231+
engine_adapter.main(
232+
[
233+
"base",
234+
"--repo",
235+
"/repo",
236+
"--out",
237+
"/out",
238+
"--name",
239+
"myrepo",
240+
"--run-id",
241+
"rid-base",
242+
"--depth",
243+
"2",
244+
"--source-sha",
245+
"abc123",
246+
]
247+
)
248+
249+
self.assertEqual(setup_logging.calls, [{"default_level": "DEBUG"}])
250+
222251
def test_main_sets_github_action_source(self):
223252
rf = _Rec()
224253
self._install(run_full=rf)

‎tests/test_sync_subcommands.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def model_dump(self, **kwargs):
8989
da.exceptions = exc
9090
_preload("diagram_analysis.analysis_json", UnifiedAnalysisJson=_InitialUnifiedAnalysisJson)
9191
_preload("diagram_analysis.io_utils", write_fingerprint=lambda *a, **k: None)
92+
_preload("logging_config", setup_logging=lambda **kwargs: None)
9293
_preload("agents.content_hash", hash_repo_source_files=lambda *a, **k: {})
9394
_preload("agents")
9495
_preload("health.models", Severity=_InitialSeverity)
@@ -111,6 +112,7 @@ def model_dump(self, **kwargs):
111112
"diagram_analysis.analysis_json",
112113
"diagram_analysis.exceptions",
113114
"diagram_analysis.io_utils",
115+
"logging_config",
114116
"static_analyzer",
115117
"static_analyzer.analysis_cache",
116118
"static_analyzer.cluster_helpers",

0 commit comments

Comments
 (0)