Skip to content

fix(pipeline): correct dispatch correlation and log rendering - #197

Merged
aparragithub merged 4 commits into
mainfrom
fix/cli-pipeline-corrections
Aug 9, 2026
Merged

fix(pipeline): correct dispatch correlation and log rendering#197
aparragithub merged 4 commits into
mainfrom
fix/cli-pipeline-corrections

Conversation

@aparragithub

@aparragithub aparragithub commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes #196

Summary

  • remove unsupported published-layer and Python-requirement prompts from forge configure
  • correlate workflow dispatches using the exact run ID returned by GitHub API version 2026-03-10
  • render downloaded GitHub log ZIP archives safely and deterministically in memory

Changes

Area Change
Configure CLI Stop authoring settings that runtime code does not consume
GitHub pipeline transport Pin the versioned dispatch contract and return its exact workflow_run_id
GitHub log transport Validate and render ZIP entries without filesystem extraction
Tests Add behavior-focused regression coverage

Test plan

  • uv run pytest — 1922 passed, 46 deselected
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run mypy
  • uv run lint-imports
  • git diff --check

Contributor checklist

  • Linked approved issue
  • Conventional commit used
  • Behavior-focused tests included
  • Documentation impact reviewed
  • No AI attribution trailers

Summary by CodeRabbit

  • New Features
    • Workflow runs now return their dispatched run ID immediately, improving run tracking.
    • Added safer workflow log extraction with checks for oversized, malformed, encrypted, or unsafe ZIP archives.
  • Bug Fixes
    • Improved reliability when retrieving workflow results and logs.
    • Added GitHub API compatibility improvements for workflow requests.
  • CLI
    • Layer collection now treats all added layers as Git layers.
    • Removed obsolete prompts for published layers and client Python requirements paths.

@aparragithub aparragithub added the bug Something isn't working label Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aparragithub, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4ad1bb48-0119-4ee7-8ad3-e859b63d8694

📥 Commits

Reviewing files that changed from the base of the PR and between a9e21f6 and 2682cd8.

📒 Files selected for processing (2)
  • src/odoo_forge_pipeline_github/transport.py
  • tests/pipeline_github/test_rest_transport.py
📝 Walkthrough

Walkthrough

The CLI no longer creates unsupported manifest fields. GitHub workflow dispatch now returns and uses the exact dispatched run ID. ZIP log downloads receive validation, size limits, path-safety checks, and deterministic rendering.

Changes

Configuration and GitHub workflow behavior

Layer / File(s) Summary
Remove unsupported manifest prompts
src/odoo_forge_cli/commands/manifest.py, tests/cli/test_configure.py
Configuration collects Git layers and client.addons_path without published-layer or Python-requirements prompts.
Propagate dispatched workflow IDs
src/odoo_forge_pipeline_github/transport.py, src/odoo_forge_pipeline_github/provider.py, tests/pipeline_github/*
Workflow dispatch validates and returns the API run ID. The provider returns that ID directly and no longer performs a newest-run lookup.
Validate and render ZIP logs
src/odoo_forge_pipeline_github/transport.py, tests/pipeline_github/test_rest_transport.py
ZIP logs are checked for archive, entry-count, size, encryption, and path-safety limits, then rendered in deterministic filename order.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActionsPipelineProvider
  participant GitHubActionsTransport
  participant GitHubActionsRESTAPI
  GitHubActionsPipelineProvider->>GitHubActionsTransport: dispatch_workflow(ref, inputs)
  GitHubActionsTransport->>GitHubActionsRESTAPI: POST workflow dispatch
  GitHubActionsRESTAPI-->>GitHubActionsTransport: workflow_run_id
  GitHubActionsTransport-->>GitHubActionsPipelineProvider: run ID
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary pipeline fixes for dispatch correlation and log rendering.
Linked Issues check ✅ Passed The changes satisfy issue #196 by removing unsupported prompts, propagating exact run IDs, safely rendering logs, and adding regression tests.
Out of Scope Changes check ✅ Passed The CLI, transport, provider, and test changes directly support the requirements in issue #196.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cli-pipeline-corrections

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/odoo_forge_pipeline_github/transport.py`:
- Around line 66-69: Update the response parsing exception handler in REST
transport to include UnicodeDecodeError alongside the existing JSON, key, and
type exceptions, normalizing invalid UTF-8 to the same RuntimeError. In
tests/pipeline_github/test_rest_transport.py lines 68-76, add b"\xff" to the
malformed-response test cases and verify it produces the existing RuntimeError.

In `@tests/pipeline_github/test_rest_transport.py`:
- Line 43: Update the affected tests to stop invoking or monkeypatching
GitHubActionsRestTransport._request. Mock urllib.request.urlopen at the HTTP
boundary instead, then exercise the public dispatch_workflow and get_run_logs
methods and assert their observable behavior without accessing private transport
attributes.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7c206dab-3ac6-4e0a-85ba-3f514d09cdc6

📥 Commits

Reviewing files that changed from the base of the PR and between 8523e2d and 74bd6dd.

📒 Files selected for processing (10)
  • src/odoo_forge_cli/commands/manifest.py
  • src/odoo_forge_pipeline_github/provider.py
  • src/odoo_forge_pipeline_github/transport.py
  • tests/cli/test_configure.py
  • tests/pipeline_github/fakes.py
  • tests/pipeline_github/test_hermetic.py
  • tests/pipeline_github/test_neutrality.py
  • tests/pipeline_github/test_rest_transport.py
  • tests/pipeline_github/test_transport_protocol.py
  • tests/pipeline_github/test_trigger.py

Comment thread src/odoo_forge_pipeline_github/transport.py
Comment thread tests/pipeline_github/test_rest_transport.py Outdated
coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/odoo_forge_pipeline_github/transport.py (1)

98-101: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Normalize ZIP-entry read failures.

Catch zipfile.BadZipFile, EOFError, NotImplementedError, and zlib.error around archive.read(entry). Preserve the RuntimeError values raised by size and path checks. Add a regression test for a corrupted compressed entry.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/odoo_forge_pipeline_github/transport.py` around lines 98 - 101, Update
the archive-reading flow around archive.read(entry) to catch zipfile.BadZipFile,
EOFError, NotImplementedError, and zlib.error and normalize them as the existing
invalid-log-archive RuntimeError. Keep the RuntimeError exceptions raised by the
size and path checks unchanged, and add a regression test covering a corrupted
compressed entry.

Source: MCP tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/pipeline_github/test_rest_transport.py`:
- Around line 52-60: Add an assertion in
test_dispatch_returns_the_exact_workflow_run_id to require len(requests) == 1,
preserving the existing request method, payload, and returned workflow ID
assertions.

---

Outside diff comments:
In `@src/odoo_forge_pipeline_github/transport.py`:
- Around line 98-101: Update the archive-reading flow around archive.read(entry)
to catch zipfile.BadZipFile, EOFError, NotImplementedError, and zlib.error and
normalize them as the existing invalid-log-archive RuntimeError. Keep the
RuntimeError exceptions raised by the size and path checks unchanged, and add a
regression test covering a corrupted compressed entry.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 90274849-dff5-42b4-a466-54fb68e0c220

📥 Commits

Reviewing files that changed from the base of the PR and between 74bd6dd and 2a91f64.

📒 Files selected for processing (2)
  • src/odoo_forge_pipeline_github/transport.py
  • tests/pipeline_github/test_rest_transport.py

Comment thread tests/pipeline_github/test_rest_transport.py
@aparragithub
aparragithub dismissed coderabbitai[bot]’s stale review August 9, 2026 16:09

Both requested changes were addressed in commit 2a91f64; focused validation and all required checks pass.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/odoo_forge_pipeline_github/transport.py (1)

85-106: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Normalize archive-construction errors.

zipfile.ZipFile(...) can raise UnicodeDecodeError before archive.infolist() runs. Catch it in the outer handler so get_run_logs raises RuntimeError("invalid log archive"). Add a regression test through public get_run_logs. NotImplementedError is already handled during entry reads.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/odoo_forge_pipeline_github/transport.py` around lines 85 - 106, Update
the outer exception handler around ZipFile construction in get_run_logs to also
catch UnicodeDecodeError and normalize it to RuntimeError("invalid log
archive"), preserving the existing entry-read handling. Add a regression test
through the public get_run_logs API using an archive that triggers
UnicodeDecodeError during construction and assert the normalized RuntimeError.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/odoo_forge_pipeline_github/transport.py`:
- Around line 85-106: Update the outer exception handler around ZipFile
construction in get_run_logs to also catch UnicodeDecodeError and normalize it
to RuntimeError("invalid log archive"), preserving the existing entry-read
handling. Add a regression test through the public get_run_logs API using an
archive that triggers UnicodeDecodeError during construction and assert the
normalized RuntimeError.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1eb07bc2-d9bd-4cd6-abc1-cf87bc777051

📥 Commits

Reviewing files that changed from the base of the PR and between 2a91f64 and a9e21f6.

📒 Files selected for processing (2)
  • src/odoo_forge_pipeline_github/transport.py
  • tests/pipeline_github/test_rest_transport.py

@aparragithub
aparragithub dismissed coderabbitai[bot]’s stale review August 9, 2026 16:22

All requested changes were addressed in commits a9e21f6 and 2682cd8; focused validation and required checks pass.

@aparragithub
aparragithub merged commit 94d5539 into main Aug 9, 2026
5 checks passed
@aparragithub
aparragithub deleted the fix/cli-pipeline-corrections branch August 9, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Correct misleading configure and GitHub pipeline behavior

1 participant