Skip to content

Conversation

@PrzemyslawKlys
Copy link
Member

Summary

  • remove the default one million record cap by treating the max record limit as unlimited unless specified
  • add a -MaxRecords parameter to Get-IISParsedLog with documentation for limiting reads when desired
  • cover unlimited and capped parsing paths with new large-file parser tests

Testing

  • dotnet test

Codex Task

Copilot AI review requested due to automatic review settings December 11, 2025 09:57
@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.54%. Comparing base (81274d6) to head (b865e56).

Files with missing lines Patch % Lines
IISParser/ParserEngine.cs 83.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
+ Coverage   86.40%   91.54%   +5.14%     
==========================================
  Files           5        5              
  Lines         206      213       +7     
  Branches       35       38       +3     
==========================================
+ Hits          178      195      +17     
+ Misses         20        8      -12     
- Partials        8       10       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the hardcoded 1 million record limit from the IIS log parser and adds a configurable -MaxRecords parameter to the PowerShell cmdlet. By default, the parser now reads all records unless explicitly limited.

Key changes:

  • Changed default MaxFileRecord2Read from 1,000,000 to int.MaxValue (unlimited)
  • Added -MaxRecords parameter to Get-IISParsedLog cmdlet with validation
  • Added tests covering both unlimited and limited record parsing scenarios

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
IISParser/ParserEngine.cs Updates default max record limit to int.MaxValue and adds logic to handle zero/negative values as unlimited
IISParser.PowerShell/CmdletGetIISParsedLog.cs Adds new MaxRecords parameter with range validation and documentation example
IISParser.Tests/ParserEngineTests.cs Adds tests for unlimited and capped record parsing with large log files

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

MissingRecords = false;
using var fileStream = File.Open(FilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
using var reader = new StreamReader(fileStream);
var maxRecords = MaxFileRecord2Read <= 0 ? int.MaxValue : MaxFileRecord2Read;
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The MaxFileRecord2Read limit is only applied in LongProcess but not in QuickProcess. This means that for log files smaller than 50MB, the MaxRecords parameter will be ignored and all records will be read regardless of the limit set. The QuickProcess method should also respect the MaxFileRecord2Read limit to ensure consistent behavior across all file sizes.

Copilot uses AI. Check for mistakes.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 96 to +99
MissingRecords = false;
using var fileStream = File.Open(FilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
using var reader = new StreamReader(fileStream);
var maxRecords = MaxFileRecord2Read <= 0 ? int.MaxValue : MaxFileRecord2Read;

Choose a reason for hiding this comment

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

P1 Badge MaxRecords ignored for sub‑50MB logs

The new MaxRecords limit is only applied in LongProcess (lines 95‑99), but ParseLog routes files under 50 MB through QuickProcess, which never checks MaxFileRecord2Read. For typical IIS logs (<50 MB), -MaxRecords therefore returns every record instead of stopping after the requested count, so the new example in the cmdlet docs cannot be fulfilled for common log sizes.

Useful? React with 👍 / 👎.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


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

@PrzemyslawKlys PrzemyslawKlys merged commit 468abf0 into master Dec 12, 2025
14 checks passed
@PrzemyslawKlys PrzemyslawKlys deleted the fix-issue-#22-in-iisparser branch December 12, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants