Skip to content

refactor(msteams): consolidate Graph upload test fixtures - #118268

Merged
steipete merged 1 commit into
mainfrom
codex/goal100k-msteams-wave20
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/goal100k-msteams-wave20

Conversation

@steipete

@steipete steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Microsoft Teams Graph-upload tests repeated route, authentication, upload, and timeout setup across nearly every case. That repetition obscured the behavior each case protects and made fixture maintenance needlessly error-prone.

This is a maintainer-requested code-cleanup lane toward the repository-wide LOC-reduction goal.

Why This Change Was Made

The suite now builds its Graph responses, fixed and aborting routes, upload calls, and private-recipient setup through small canonical test helpers. Production code and behavior are unchanged; all 21 test declarations and the full ordered assertion trace remain identical.

User Impact

No user-visible impact. This test-only refactor removes 180 net lines while retaining coverage for Graph authentication, filename conflict handling, upload limits, response bounds, sharing scopes, and abort deadlines.

Evidence

  • Diff: +167/-347, net -180 test LOC; production delta 0.
  • Focused Blacksmith Testbox: extensions/msteams/src/graph-upload.test.ts — 21/21 passed.
  • Full Microsoft Teams suite: 89 files, 1,371 tests passed.
  • Remote pnpm check:changed: passed.
  • git diff --check and oxfmt --check: passed.
  • Static parity trace: 21 titles and 49 ordered matcher chains preserved; SHA-256 02ea76aff2cb50581392048031d580230355c26ad38e8f0be3c235c9bb30253c before and after.
  • AutoReview on exact head: clean, no accepted/actionable findings.
  • Final central overlap census: 0 exact open-PR matches for the changed file.
  • Contract verification: Microsoft Graph upload or replace file contents, driveItem conflict behavior, createLink, and list chat members.
  • AI-assisted implementation and review; no transcript was added because transcript inclusion requires explicit approval.

@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams size: L maintainer Maintainer-authored PR labels Aug 2, 2026
@steipete
steipete marked this pull request as ready for review August 2, 2026 22:30
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 6:36 PM ET / 22:36 UTC.

ClawSweeper review

What this changes

This PR consolidates repeated Microsoft Graph mock routes, token setup, and upload invocation code in the Microsoft Teams Graph-upload test suite without changing production code.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 2 items remain

Keep this PR open for normal maintainer review. Current main still has the pre-refactor 800-line Graph-upload test file, while this branch consolidates only its fixtures into 620 lines; the tested production upload path and its callers are unchanged. The patch is a sound cleanup on source review, but the supplied evidence is test/CI-only and several exact-head checks were still running.

Priority: P3
Reviewed head: 91b119cd30919a7db272f779e05773d7e1fe4f21

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is a focused, source-reviewed test cleanup with retained named coverage, but its provided evidence is mock/test-only rather than independently inspectable real behavior proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body provides focused/full test and CI claims, but no independently inspectable after-change runtime proof; add redacted real setup evidence if maintainers require the external-PR proof gate, then update the PR body for automatic re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body provides focused/full test and CI claims, but no independently inspectable after-change runtime proof; add redacted real setup evidence if maintainers require the external-PR proof gate, then update the PR body for automatic re-review.
Evidence reviewed 6 items Current-main comparison: Current main and the PR base resolve to the same test blob (9c7a310…), while the PR head resolves to c177197…. The refactor is therefore not already implemented on main.
Test-boundary review: The branch changes only the Graph-upload test file. Its shared helpers route upload, member-lookup, and sharing-link requests while production behavior remains in the untouched upload module.
Coverage-name parity: The base and branch each contain 21 named test declarations, and their ordered test titles are identical.
Findings None None.
Security None None.

How this fits together

Microsoft Teams group-chat and channel file sends call the SharePoint upload flow, which acquires a Graph token, uploads content, optionally resolves members, and creates a sharing link. The changed test file supplies mocked Graph responses and asserts those upload, timeout, and sharing behaviors.

flowchart LR
  A[Teams attachment send] --> B[SharePoint upload flow]
  B --> C[Graph token and upload request]
  C --> D[Member lookup and sharing link]
  E[Graph-upload test fixtures] --> F[Mocked Graph responses]
  F --> G[Upload and timeout assertions]
  G --> B
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body provides focused/full test and CI claims, but no independently inspectable after-change runtime proof; add redacted real setup evidence if maintainers require the external-PR proof gate, then update the PR body for automatic re-review.
  • Resolve merge risk (P1) - The PR body supplies focused-suite and CI claims, but its after-change proof is mock/test-only; the exact-head check snapshot also still showed several changed-surface jobs in progress.
Agent review details

Security

None.

PR surface

Tests -180. Total -180 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 167 347 -180
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 167 347 -180

Review metrics

Metric Value Why it matters
Named test coverage 21 before, 21 after The helper extraction preserves the suite's named behavioral cases rather than removing coverage.

Stored data model

Persistent data-model change detected: serialized state: extensions/msteams/src/graph-upload.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Merge after the exact-head test/CI evidence is complete and a maintainer accepts the test-only proof posture; retain the local helpers because they consolidate repeated setup without changing the SharePoint upload contract.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Merge after the exact-head test/CI evidence is complete and a maintainer accepts the test-only proof posture; retain the local helpers because they consolidate repeated setup without changing the SharePoint upload contract.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR is a test-only refactor, not a report of broken runtime behavior. Source comparison does show a high-confidence review path because current main retains the pre-refactor test file.

Is this the best way to solve the issue?

Yes. The branch removes repeated test setup at the fixture layer while preserving all 21 named cases and leaving the Graph-upload implementation and its Teams callers untouched; duplicating helpers per case would retain the maintenance burden.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 474c4e671e9f.

Labels

Label changes:

  • add P3: This is a production-neutral test-maintenance cleanup with no reported user-facing regression.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides focused/full test and CI claims, but no independently inspectable after-change runtime proof; add redacted real setup evidence if maintainers require the external-PR proof gate, then update the PR body for automatic re-review.

Label justifications:

  • P3: This is a production-neutral test-maintenance cleanup with no reported user-facing regression.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides focused/full test and CI claims, but no independently inspectable after-change runtime proof; add redacted real setup evidence if maintainers require the external-PR proof gate, then update the PR body for automatic re-review.

Evidence

What I checked:

Likely related people:

  • Santiago: Current-main blame attributes the Graph-upload test fixture baseline to commit a2ffa48. (role: introduced current test baseline; confidence: medium; commits: a2ffa4850d6c; files: extensions/msteams/src/graph-upload.test.ts)
  • Alix-007: Recent commits added the timeout and response-bounding behavior whose regression coverage this refactor preserves. (role: recent Microsoft Teams upload-path contributor; confidence: high; commits: 292e8c3e72e0, 0f775fa25e41; files: extensions/msteams/src/graph-upload.ts, extensions/msteams/src/request-timeout.ts)
  • steipete: Recent history includes Microsoft Teams test tightening and refactor work, and the current branch commit continues that test-maintenance thread. (role: recent test-area contributor; confidence: medium; commits: 02587cac37de, 9c2dc92dd8fc; files: extensions/msteams/src/graph-upload.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the remaining exact-head checks complete.
  • If the proof gate is applied to this test-only PR, add a redacted runtime or focused validation transcript to the PR body.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 1556038 into main Aug 2, 2026
154 of 160 checks passed
@steipete
steipete deleted the codex/goal100k-msteams-wave20 branch August 2, 2026 23:15
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant