Skip to content

feat(preset): add PATCH method to Outlook preset for Graph API updates#1478

Merged
jyaunches merged 1 commit into
NVIDIA:mainfrom
stevenobiajulu:feat/outlook-preset-patch-method
Apr 23, 2026
Merged

feat(preset): add PATCH method to Outlook preset for Graph API updates#1478
jyaunches merged 1 commit into
NVIDIA:mainfrom
stevenobiajulu:feat/outlook-preset-patch-method

Conversation

@stevenobiajulu

@stevenobiajulu stevenobiajulu commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Add PATCH method support to the graph.microsoft.com endpoint in the Outlook network policy preset.

Microsoft Graph API uses PATCH for standard email and calendar operations — marking messages as read, flagging for follow-up, and updating drafts. The current preset only allows GET and POST, which blocks these workflows inside sandboxes.

Fixes #1477

Changes

  • nemoclaw-blueprint/policies/presets/outlook.yaml: Add allow: { method: PATCH, path: "/**" } to graph.microsoft.com (1 line)
  • test/policies.test.js: Add regression test asserting PATCH is allowed on graph.microsoft.com in the Outlook preset (8 lines)

Scope

  • Only graph.microsoft.com — the other endpoints in the preset do not need PATCH
  • No PUT (Graph API uses PATCH, not PUT, for updates)
  • No wildcards — explicit method rule follows the principle of least privilege

Testing

  • All 964 tests pass (npx vitest run)
  • New test fails against the unmodified preset, passes after the fix

Summary by CodeRabbit

  • New Features
    • Network policy now permits HTTP PATCH requests to the Microsoft Graph endpoint, enabling additional operations against that service.
  • Tests
    • Added test coverage to verify PATCH request support for the Outlook preset.

Signed-off-by: Steven Obiajulu [email protected]

@coderabbitai

coderabbitai Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 169a5809-3f68-47a7-8ae5-6772d344af1d

📥 Commits

Reviewing files that changed from the base of the PR and between 66cfc54 and aaf6141.

📒 Files selected for processing (1)
  • test/policies.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/policies.test.ts

📝 Walkthrough

Walkthrough

Added an explicit HTTP PATCH allow rule to the Outlook preset for the graph.microsoft.com endpoint and a unit test that asserts the PATCH rule is present.

Changes

Cohort / File(s) Summary
Policy Rule Addition
nemoclaw-blueprint/policies/presets/outlook.yaml
Added - allow: { method: PATCH, path: "/**" } to the graph.microsoft.com rules.
Test Verification
test/policies.test.ts
Added a Vitest assertion verifying the Outlook preset contains a rule with method: PATCH for host: graph.microsoft.com.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibble at rules with a curious twitch,
A PATCH hops in — a tiny, perfect stitch.
Messages updated, flags take flight,
Sandbox rabbits dance through the night. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding PATCH method support to the Outlook preset for Graph API operations.
Linked Issues check ✅ Passed All coding requirements from issue #1477 are met: PATCH method added to graph.microsoft.com endpoint, no PUT or other methods included, path set to "/**", and regression test added.
Out of Scope Changes check ✅ Passed All changes are directly in scope: PATCH rule added only to graph.microsoft.com endpoint and regression test added; no modifications to other endpoints or unrelated code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@wscurran

wscurran commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

✨ Thanks for submitting this fix, which proposes a way to add PATCH method support to the Outlook network policy preset for Microsoft Graph API operations.


Possibly related open issues:

@cv

cv commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

I attempted to port this branch across the JS→TS migration and merge the latest main, but it still needs manual follow-up.

Please start with:

git fetch origin
git merge origin/main
npx tsx scripts/ts-migration-assist.ts --base origin/main --write
npm run build:cli
npm run typecheck:cli
npm run lint
npm test

@cv

cv commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

I retried the automated JS→TS migration port, but this branch still needs manual follow-up after merging main.

Please start with:

git fetch origin
git merge origin/main
npx tsx scripts/ts-migration-assist.ts --base origin/main --write
npm run build:cli
npm run typecheck:cli
npm run lint
npm test

@stevenobiajulu

Copy link
Copy Markdown
Contributor Author

Friendly ping — approval came through on the 15th but CI hasn't run. Could a maintainer kick off the workflows when you get a chance? Thanks!

@wscurran

Copy link
Copy Markdown
Contributor

Sorry for the delay on this one — thanks for the ping and for your patience. Could you resolve the current merge conflicts and complete the TS migration (the npx tsx scripts/ts-migrate step cv flagged above)? Once that's done we'll get a full review and get this merged.

Microsoft Graph API uses PATCH for standard email and calendar operations:
marking messages as read, flagging for follow-up, and updating drafts.
The Outlook preset currently only allows GET and POST on
graph.microsoft.com, blocking these workflows inside sandboxes.

Add PATCH rule to graph.microsoft.com and a regression test.

Fixes NVIDIA#1477

Signed-off-by: Steven Obiajulu <[email protected]>
@jyaunches jyaunches force-pushed the feat/outlook-preset-patch-method branch from aaf6141 to 2ad58e7 Compare April 23, 2026 19:38
@copy-pr-bot

copy-pr-bot Bot commented Apr 23, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@jyaunches jyaunches merged commit 02dff1e into NVIDIA:main Apr 23, 2026
@wscurran wscurran added area: integrations Third-party service integration behavior area: policy Network policy, egress rules, presets, or sandbox policy feature PR adds or expands user-visible functionality and removed enhancement: feature labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: integrations Third-party service integration behavior area: policy Network policy, egress rules, presets, or sandbox policy feature PR adds or expands user-visible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(preset): add PATCH method to Outlook preset for Graph API updates

4 participants