Skip to content

[repo-assist] Dispose sitemap file stream after deserialization - #1451

Merged
BenjaminMichaelis merged 1 commit into
mainfrom
repo-assist/improve-dispose-sitemap-stream-7563b232e6eec5a1
Oct 3, 2026
Merged

BenjaminMichaelis merged 1 commit into
mainfrom
repo-assist/improve-dispose-sitemap-stream-7563b232e6eec5a1

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🤖 This PR was created by Repo Assist, an automated AI assistant.

Closes no issue; this is a focused maintenance improvement.

Summary

Dispose the FileStream opened while loading Chapters/sitemap.json in SiteMappingService.

Root cause

The constructor passed File.OpenRead(path) directly to JsonSerializer.Deserialize, leaving the stream undisposed after deserialization and retaining a file handle for the lifetime of the process.

Fix rationale

The stream is now held in a using declaration, so it is disposed immediately after deserialization while preserving the existing SiteMappings behavior. The unused import in the same file was removed.

Test Status

  • dotnet restore --ignore-failed-sources — passed.
  • dotnet build --configuration Release --no-restore — passed.
  • dotnet test --configuration Release --no-build — 174 passed; 2 unrelated external-service integration tests failed (CaptchaService_Verify_Success and KnownBreachedPassword_IsDetected) because their remote services were unavailable.
  • git diff --check — passed.

No breaking changes or new dependencies.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • api.hcaptcha.com
  • api.pwnedpasswords.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.hcaptcha.com"
    - "api.pwnedpasswords.com"

See Network Configuration for more information.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@4bc8419fad05e6b032741cbfd189986700bcf71c

Dispose the sitemap file stream after deserialization to avoid leaking a file handle.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@github-actions github-actions Bot 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.

Threat detection produced a warning for this pull request output.

These changes need to be scrutinized before merge and only merged after a careful manual review.

@BenjaminMichaelis
BenjaminMichaelis marked this pull request as ready for review October 3, 2026 01:02
@BenjaminMichaelis
BenjaminMichaelis merged commit c2e50a1 into main Oct 3, 2026
21 checks passed
@BenjaminMichaelis
BenjaminMichaelis deleted the repo-assist/improve-dispose-sitemap-stream-7563b232e6eec5a1 branch October 3, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant