Skip to content

feat: Split oversized VCS comments into multiple chunks#505

Open
vovinacci wants to merge 2 commits into
zapier:mainfrom
vovinacci:feat/comment-splitting
Open

feat: Split oversized VCS comments into multiple chunks#505
vovinacci wants to merge 2 commits into
zapier:mainfrom
vovinacci:feat/comment-splitting

Conversation

@vovinacci

@vovinacci vovinacci commented Apr 1, 2026

Copy link
Copy Markdown

Reports that exceed the VCS comment size limit (GitHub 64 KB, GitLab 1 MB) are now split into multiple comments using a three-tier structural strategy: whole-app, per-check, and per-line splitting. Every chunk is valid, self-contained markdown with balanced HTML tags - no post-hoc tag repair needed. Each chunk carries a numbered header with the kubechecks identifier so multi-instance deployments and TidyOutdatedComments correctly manage comment groups.

  • Add KUBECHECKS_MAX_COMMENTS_PER_CHECK config (default 0/unlimited)
  • Add MaxCommentLength() to VCS Client interface
  • Refactor BuildComment to return []string via structural splitting and SplitIntoChunks
  • Rewrite UpdateMessage to delete placeholder and post chunks
  • Add exponential backoff/retry for multi-chunk posting
  • Replace silent truncation in PostMessage with hard error
  • Regenerate mocks and docs

Resolves #504

Reports that exceed the VCS comment size limit (GitHub 64 KB, GitLab
1 MB) are now split into multiple comments at app-level boundaries,
with byte-level fallback and markdown repair for oversized single
sections. Each chunk carries a numbered header with the kubechecks
identifier so multi-instance deployments and TidyOutdatedComments
correctly manage comment groups.

- Add KUBECHECKS_MAX_COMMENTS_PER_CHECK config (default 0/unlimited)
- Add MaxCommentLength() to VCS Client interface
- Refactor BuildComment to return []string via new SplitIntoChunks
- Rewrite UpdateMessage to delete placeholder and post chunks
- Add exponential backoff/retry for multi-chunk posting
- Replace silent truncation in PostMessage with hard error
- Regenerate mocks and docs

Signed-off-by: Volodymyr Shcherbinin (vovin) <vovin@lurk.kyiv.ua>
@andridzi

andridzi commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

already tested, works perfectly!

@vovinacci

Copy link
Copy Markdown
Author

@djeebus @Greyeye Small heads-up to review once you have some spare time.
Works for me and @andridzi like a charm.

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.

Split comments instead of truncating when exceeding VCS comment size limits

2 participants