Skip to content

fix: cap web_execute debug log output - #1343

Merged
1cu merged 1 commit into
mainfrom
fix/truncate-web-execute-debug-log
Oct 14, 2026
Merged

1cu merged 1 commit into
mainfrom
fix/truncate-web-execute-debug-log

Conversation

@1cu

@1cu 1cu commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Description

  • Link to the related issue(s): found in the log attached to [BUG] Download of special_attributes: {} is not working #1333
  • web_execute logged every script and its full result at DEBUG level. Reading Astro island props produced a single log line of ~121,000 characters with the complete ad and user data, which users attach to public issues.

📋 Changes Summary

  • New misc.truncate_for_log(): collapses whitespace to one line and caps the text (default 300 chars) with a … (+N chars) marker.
  • web_execute uses it for both the script and the result in its debug line.
  • Tests for the helper and for the capped web_execute log line.
  • No behavior change outside debug logging; no config or dependency changes.

⚙️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (adds new functionality without breaking existing usage)
  • 💥 Breaking change (changes that might break existing user setups, scripts, or configurations)

✅ Checklist

  • I have reviewed my changes to ensure they meet the project's standards.
  • I have tested my changes and ensured that all tests pass (pdm run test).
  • I have formatted the code (pdm run format).
  • I have verified that linting passes (pdm run lint).
  • I have updated documentation where necessary. (Not needed.)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: Second-Hand-Friends/kleinanzeigen-bot/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ab861950-f1b1-4715-96a5-086497fc4bcd
📥 Commits

Reviewing files that changed from the base of the PR and between 1316730 and 088ef1d.

📒 Files selected for processing: 4
  • src/kleinanzeigen_bot/utils/misc.py
  • src/kleinanzeigen_bot/utils/web_scraping_mixin.py
  • tests/unit/test_utils_misc.py
  • tests/unit/test_web_scraping_mixin.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions github-actions Bot added the bug Something isn't working label Oct 14, 2026
@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.21%. Comparing base (1316730) to head (088ef1d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1343      +/-   ##
==========================================
+ Coverage   92.11%   92.21%   +0.09%     
==========================================
  Files          50       50              
  Lines        7723     7728       +5     
  Branches     1340     1341       +1     
==========================================
+ Hits         7114     7126      +12     
  Misses        400      400              
+ Partials      209      202       -7     
Flag Coverage Δ
integration-tests 24.62% <100.00%> (-0.06%) ⬇️
unit-tests 91.62% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/kleinanzeigen_bot/utils/misc.py 98.18% <100.00%> (+0.08%) ⬆️
src/kleinanzeigen_bot/utils/web_scraping_mixin.py 91.88% <100.00%> (+0.45%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1316730...088ef1d. Read the comment docs.

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

@1cu
1cu merged commit 8614eee into main Oct 14, 2026
27 checks passed
@1cu
1cu deleted the fix/truncate-web-execute-debug-log branch October 14, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

1 participant