Skip to content

[MISC] Pin the origin fetch label_advice runs before --owed - #2485

Merged
chandrasekharan-zipstack merged 2 commits into
mainfrom
fix/owed-fetch
Nov 12, 2026
Merged

chandrasekharan-zipstack merged 2 commits into
mainfrom
fix/owed-fetch

Conversation

@chandrasekharan-zipstack

Copy link
Copy Markdown
Contributor

What

  • label_advice.py: the owed() docstring said "needs origin fetched", which read as a step for the caller. main() already fetches origin (main, release branches, tags) before --branch and --owed, and a failed fetch exits 1. The docstring now says so.
  • test_label_advice.py: a test runs --owed through main() on a clone whose origin/release/1.7 ref was deleted. It fails if that fetch is removed.

Why

A developer on a stale clone must not get a stale --owed answer. The fetch was there, but nothing pinned it.

Verify

cd .github/release && python -m unittest discover -p 'test_*.py'. Mutation: disabling the fetch in main() fails the new test. .github/release is byte-identical to the cloud copy.

🤖 Generated with Claude Code

@chandrasekharan-zipstack chandrasekharan-zipstack added the main-only Stays on main: not backported to a release line label Nov 12, 2026

@chandrasekharan-zipstack chandrasekharan-zipstack left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review — round 1 at bf598c0 (review-shallow: gate admitted, 2 files / 25 lines, no disqualifiers)

Verdict — APPROVE WITH NITS

Mode: LITE — single-pass, 19/19 lenses, one reader, no subagents. Eligible: 2 files / 25 lines, no disqualifiers.

Summary — Critical: 0 · High: 0 · Medium: 0 · Low: 1 · Lenses run: 19/19

Findings

  • [Low] [Lens 13] — Removing the fetch makes the new test error, not fail
    • Location: .github/release/test_label_advice.py:257
    • Failure mode: without the fetch, held is never called, so held.call_args is None and .args raises TypeError. The suite still goes red, but as an ERROR that reads like a broken test rather than a missing fetch.
    • Evidence: mutation run (fetch in main() disabled) reported ERROR: test_the_cli_fetches_origin_before_reading_it.
    • Suggested fix: held.assert_called_once() before reading call_args.
    • Confidence: High
    • Verification: VERIFIED — mutated label_advice.py main() fetch to False and rm.git(...), ran python -m unittest test_label_advice.

Lens checklist

  1. Spec & intent — Clean
  2. Architectural fit & precedent — Clean
  3. Correctness & edge cases — Clean
  4. Security — N/A — no auth, input boundary or secret touched; a docstring and a test
  5. Data integrity & migrations — N/A — no data store or migration
  6. Concurrency — N/A — no concurrency
  7. API & contract compatibility — N/A — no wire format or CLI contract change
  8. Reliability & resilience — N/A — no external call added; the test fetches from a local bare repo
  9. Performance & cost — N/A — test-only cost
  10. Observability — N/A — no log or metric change
  11. Operational safety — N/A — no rollout surface
  12. LLM/agent-specific — N/A — no LLM path
  13. Testing — See findings #1
  14. Dependencies & build — N/A — no dependency change
  15. Code quality — Clean
  16. Doc & comment accuracy — Clean
  17. Cross-document rule consistency — Clean
  18. On-prem deployment experience — N/A — no on-prem surface
  19. Scaling & workload lifecycle — N/A — no scaling or lifecycle config

Open questions for the author — none.

Assumptions made — none.

boundary-sweep: trigger not met (no outbound client, endpoint, log line or error path changed)
rule-storage-check: not covered — no markdown in the diff
lens 15: ruff 0.3.4 check and format (pre-commit pin) clean on both changed files
lens 17: git log b526ca787..origin/main exit 0, empty — branch current, branch sweep is the merge result; "origin fetched" restated nowhere else

cost: agents=0 wall=00:33 lenses-examined=7 of 19 files=2 lines=25

Unanchored findings

  • .github/release/test_label_advice.py:257 (outside the diff hunk): [Low] [Lens 13] — Removing the fetch makes this test error, not fail. Without the fetch held is never called, so held.call_args is None and .args raises TypeError. Assert held.assert_called_once() first. VERIFIED by disabling the fetch in main().

@sonarqubecloud

Copy link
Copy Markdown

@chandrasekharan-zipstack chandrasekharan-zipstack left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review — round 2 at 097b3f9d9

Verdict — APPROVE

Mode: LITE — single-pass, 19/19 lenses, one reader, no subagents. Eligible: 2 files / 26 lines, no disqualifiers.

Summary — Critical: 0 · High: 0 · Medium: 0 · Low: 0 · Lenses run: 19/19 (N/A ones listed below with reason).

Prior context fetched — followup-fetch.sh exited 0; since bf598c0d2.

Scope change — NO — one added assertion in a test already reviewed.

boundary-sweep: 0 sinks traced, clean — no outbound client, endpoint, log line or error path changed.
rule-storage-check: not covered — no markdown in the diff.

Prior findings status

  • [Low] (round 1, posted unanchored; its line was cited as 257, the real line is 283) a missing fetch made the test ERROR, not FAIL → RESOLVED — .github/release/test_label_advice.py:283 adds held.assert_called_once() before held.call_args is read. With the fetch in main() mutated out, the test now FAILS with Expected 'mock' to have been called once. Called 0 times.; unmutated, python -m unittest discover -p 'test_*.py' is OK.

Lens checklist

  1. Spec & intent — Clean — the body's test description still matches.
  2. Architectural fit & precedent — Clean — standard unittest.mock assertion, as used elsewhere in the file.
  3. Correctness & edge cases — Clean — the fixture has one live line, so exactly one held call is the expected count.
  4. Security — N/A — test only.
  5. Data integrity & migrations — N/A — none.
  6. Concurrency — N/A — none.
  7. API & contract compatibility — N/A — none.
  8. Reliability & resilience — N/A — none.
  9. Performance & cost — N/A — none.
  10. Observability — N/A — none.
  11. Operational safety — N/A — none.
  12. LLM/agent-specific — N/A — none.
  13. Testing — Clean — the guard is mutation-verified: FAIL, not ERROR, without the fetch.
  14. Dependencies & build — N/A — none.
  15. Code quality — Clean — ruff 0.3.4 format and check pass.
  16. Doc & comment accuracy — Clean — no prose changed.
  17. Cross-document rule consistency — Clean — the same line is in cloud's identical .github/release copy.
  18. On-prem deployment experience — N/A — no on-prem surface.
  19. Scaling & workload lifecycle — N/A — none.

Open questions / assumptions

None.

@chandrasekharan-zipstack
chandrasekharan-zipstack marked this pull request as ready for review November 12, 2026 16:40
@github-actions

Copy link
Copy Markdown
Contributor

Unstract test results

No groups ran in this build.

Critical paths

⚠️ Critical paths not yet covered

  • workflow-execution-fan-out — Multi-file workflow execution fans out to file-processing workers and rejoins. (declared coverage: no groups declared)
💤 Covered, but not exercised in this build
  • auth-login — User can log in and obtain a session cookie. (covered by e2e-login; no result reported in this build)
  • adapter-register-llm — Register and validate an LLM adapter. (covered by integration-backend; no result reported in this build)
  • workflow-author — Create a workflow; its source+destination endpoints materialise and are configurable. (covered by integration-backend; no result reported in this build)
  • co-owner-manage — Add/remove co-owners of a shared resource; enforce the last-owner guard. (covered by integration-backend, e2e-coowners; no result reported in this build)
  • workflow-create-execute — Create a workflow, configure source+destination, execute, poll, fetch result. (covered by e2e-workflow; no result reported in this build)
  • api-deployment-provision — Deploying a workflow as an API mints a usable key and a resolvable endpoint. (covered by integration-backend; no result reported in this build)
  • api-deployment-auth — Unauthenticated or mis-scoped API-deployment calls are rejected before dispatch. (covered by integration-backend; no result reported in this build)
  • api-deployment-run — Deploy a workflow as an API, POST a document, receive structured JSON. (covered by e2e-api-deployment; no result reported in this build)
  • mcp-server-auth — Unauthenticated or mis-scoped hosted-MCP calls are rejected before any tool runs. (covered by integration-backend; no result reported in this build)
  • mcp-platform-auth — The org-scoped MCP endpoint stays behind the platform-API-key middleware; unauthenticated or mis-scoped calls reach no tool. (covered by integration-backend; no result reported in this build)
  • platform-key-whoami — A platform API key resolves its own organisation over the org-less whoami endpoint; the org comes from the key row, not the URL. (covered by integration-backend; no result reported in this build)
  • prompt-studio-author — Create a Prompt Studio project and add a prompt to it. (covered by integration-backend; no result reported in this build)
  • prompt-studio-fetch-response — Prompt Studio: create project, add prompt, run a prompt, get response. (covered by e2e-prompt-studio; no result reported in this build)
  • connector-register-test — Connector credentials are validated against the live system and stored encrypted. (covered by integration-backend; no result reported in this build)
  • pipeline-etl-execute — Run an ETL pipeline from source connector to destination. (covered by e2e-etl; no result reported in this build)
  • usage-aggregate-read — Per-run token usage aggregates correctly and stays scoped to its organization. (covered by integration-backend; no result reported in this build)
  • usage-token-tracking — Per-execution token usage is recorded and retrievable. (covered by e2e-api-deployment; no result reported in this build)
  • callback-result-delivery — Async results are posted back via the callback worker. (covered by e2e-api-deployment; no result reported in this build)

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

via Greptile

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge.

Summary

Clarifies that main() fetches origin refs before owed() reads them.

  • The owed check documents and tests its origin fetch.

Reviews (1) · Last reviewed commit: "test: fail, not error, when the --owed f..." · Reviewed by Greptile

@chandrasekharan-zipstack
chandrasekharan-zipstack merged commit 20fe25d into main Nov 12, 2026
45 checks passed
@chandrasekharan-zipstack
chandrasekharan-zipstack deleted the fix/owed-fetch branch November 12, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

main-only Stays on main: not backported to a release line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant