Skip to content

#2079 Introduce GraphRequestTimeoutSeconds to fix -IncludeLongRunningTests issue - #2098

Open
blindzero wants to merge 30 commits into
maester365:mainfrom
blindzero:fix/2079-longrunning-clienttimeoutparameter
Open

#2079 Introduce GraphRequestTimeoutSeconds to fix -IncludeLongRunningTests issue#2098
blindzero wants to merge 30 commits into
maester365:mainfrom
blindzero:fix/2079-longrunning-clienttimeoutparameter

Conversation

@blindzero

@blindzero blindzero commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📑 Description

When including -IncludeLongRunningTests some tests may have trouble with default 300 secs. timeout for Graph requests (e.g. MT.1086).
For this case I introduced a GraphRequestTimeoutSeconds parameter

  • set in Custom/maester-config.json file (incl. in default template)
  • overridden / defined per Invoke-Maester -GraphRequestTimeoutSeconds parameter
  • Allows 1 - 3600 as value

Closes #2079

✅ Checks

  • My pull request adheres to the code style of this project.
  • My code requires changes to the documentation.
  • I have updated the documentation as required.
  • The build and unit tests pass after running /powershell/tests/pester.ps1 locally (EIDSCA generator is failing but not within scope of this PR)

ℹ️ Additional Information

  • added dedicated tests for GraphRequestTimeoutSeconds parameter behaviour in Invoke-Maester.Tests.ps1
  • added doc reference from FAQ on issue with timeout to config/overview documentation of the parameter
  • Command reference will be generated automatically, no manual change.

Summary by CodeRabbit

  • New Features

    • Added configurable Microsoft Graph request timeouts, with command-line overrides and persistent configuration support.
    • Timeout values can be set from 1 to 3,600 seconds, with explicit command-line settings taking precedence.
  • Bug Fixes

    • Improved handling and validation of invalid timeout configuration values.
  • Documentation

    • Added configuration guidance and FAQ content for resolving Microsoft Graph timeout failures.
  • Tests

    • Added coverage for timeout configuration, precedence, defaults, and validation.

blindzero and others added 26 commits May 9, 2026 14:20
… avoid false positives with MD double newline fix
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…local dev testings without risk of committing to repo
@blindzero
blindzero requested review from a team as code owners August 4, 2026 16:03
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Invoke-Maester supports configurable Microsoft Graph request timeouts. Explicit parameters override global configuration. Values are validated, applied through Set-MgRequestContext, tested, and documented.

Changes

Graph request timeout

Layer / File(s) Summary
Timeout parameter and resolution
powershell/public/Invoke-Maester.ps1, powershell/tests/functions/Invoke-Maester.Tests.ps1
Adds the validated GraphRequestTimeoutSeconds parameter. Resolves explicit and global values, applies the timeout, and tests precedence, omission, and invalid values.
Configuration and documentation
tests/maester-config.json, .gitignore, website/docs/configuration/overview.md, website/docs/faq.md
Adds a test configuration value, ignores custom test configuration, and documents timeout configuration and troubleshooting.

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

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant InvokeMaester
  participant MaesterConfig
  participant GraphRequestContext
  Caller->>InvokeMaester: Invoke-Maester -GraphRequestTimeoutSeconds
  InvokeMaester->>MaesterConfig: Load GlobalSettings
  InvokeMaester->>InvokeMaester: Resolve explicit parameter or global setting
  InvokeMaester->>GraphRequestContext: Set-MgRequestContext(timeout)
Loading

Suggested reviewers: merill

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue [#2079] by providing configurable Graph request timeouts for long-running tests.
Out of Scope Changes check ✅ Passed The code, tests, configuration, documentation, and ignore rule are all related to the timeout feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly identifies the new GraphRequestTimeoutSeconds feature and its purpose for long-running tests.
Description check ✅ Passed The description explains the change, configuration options, issue reference, documentation updates, tests, and check results.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@website/docs/configuration/overview.md`:
- Line 92: Update the GraphRequestTimeoutSeconds entry in the configuration
table to use complete sentences and explicitly document that accepted values
range from 1 to 3600 seconds, while retaining the existing override guidance for
Invoke-Maester.
🪄 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: CHILL

Plan: Pro Plus

Run ID: e50ad7dc-ad97-4122-b2a6-f177bdb60e9d

📥 Commits

Reviewing files that changed from the base of the PR and between f18dd1c and 0c1e7a8.

📒 Files selected for processing (6)
  • .gitignore
  • powershell/public/Invoke-Maester.ps1
  • powershell/tests/functions/Invoke-Maester.Tests.ps1
  • tests/maester-config.json
  • website/docs/configuration/overview.md
  • website/docs/faq.md

Comment thread website/docs/configuration/overview.md Outdated
@SamErde
SamErde requested a lite review from Copilot August 4, 2026 18:25
Comment thread powershell/public/Invoke-Maester.ps1 Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a configurable Microsoft Graph request timeout to address failures in long-running Maester tests that can exceed the Graph SDK’s default 300s timeout, with support for config-based defaults and an Invoke-Maester CLI override.

Changes:

  • Introduces -GraphRequestTimeoutSeconds on Invoke-Maester and applies it via Set-MgRequestContext -ClientTimeout.
  • Adds GlobalSettings.GraphRequestTimeoutSeconds (default 300) to the main tests/maester-config.json, with override behavior covered by new unit tests.
  • Updates website documentation (FAQ + configuration overview) and ignores tests/Custom/maester-config.json to prevent committing org-specific overrides.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
website/docs/faq.md Documents how to resolve Graph timeout failures using the new parameter or custom config.
website/docs/configuration/overview.md Lists GraphRequestTimeoutSeconds as an available global setting.
tests/maester-config.json Adds the new setting to the default config template with a default of 300 seconds.
powershell/tests/functions/Invoke-Maester.Tests.ps1 Adds unit tests covering precedence and validation behavior for the timeout setting.
powershell/public/Invoke-Maester.ps1 Implements the new parameter and resolves/validates config + parameter precedence before running tests.
.gitignore Prevents committing tests/Custom/maester-config.json (user/org-specific overrides).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/docs/configuration/overview.md Outdated
Comment thread powershell/public/Invoke-Maester.ps1 Outdated
Comment thread powershell/public/Invoke-Maester.ps1
blindzero and others added 3 commits August 5, 2026 16:24
…onds Parameter

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…pmessage

Co-authored-by: Sam Erde <20478745+SamErde@users.noreply.github.com>
@blindzero blindzero changed the title #2079 Introduct GraphRequestTimeoutSeconds to fix -IncludeLongRunningTests issue #2079 Introduce GraphRequestTimeoutSeconds to fix -IncludeLongRunningTests issue Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🪲 httpclient.timeout error for Longrunning Tests (e.g. MT.1086)

3 participants