Skip to content

fix: split long PR comments into multiple parts to avoid GitHub API limit#2633

Open
raman1236 wants to merge 2015 commits intodiggerhq:mainfrom
raman1236:fix/split-long-github-comments
Open

fix: split long PR comments into multiple parts to avoid GitHub API limit#2633
raman1236 wants to merge 2015 commits intodiggerhq:mainfrom
raman1236:fix/split-long-github-comments

Conversation

@raman1236
Copy link
Copy Markdown

Description

Fixes #1645 — GitHub enforces a 65535 character limit on issue/PR comment bodies. When terraform plan output is large (common with infrastructure-heavy repos), the entire comment post fails with exit code 5, leaving users with no plan output at all.

Problem

Users with large infrastructure see this error:

ERROR 422 Validation Failed [{Resource:IssueComment Field:body Code:custom Message:body is too long (maximum is 65536 characters)}]

The job crashes and no plan output is posted to the PR.

Solution

Modified GithubService.PublishComment() to automatically split comments exceeding 65000 characters into multiple parts:

  1. Each part is prefixed with **Part X/Y** header for clarity
  2. Splitting tries to break at newline boundaries to preserve markdown readability
  3. If no good newline is found in the second half, falls back to a hard split at the limit
  4. Short comments (under the limit) are posted as-is with zero overhead

Changes

  • libs/ci/github/github.go: Added splitComment() helper and updated PublishComment() to split long comments
  • libs/ci/github/github_test.go: Added 3 unit tests covering short, long, and exact-limit cases

Testing

=== RUN   TestSplitComment_ShortComment
--- PASS
=== RUN   TestSplitComment_LongComment
--- PASS  (verifies no content loss, all parts within limit)
=== RUN   TestSplitComment_ExactLimit
--- PASS

motatoes and others added 30 commits September 30, 2025 16:22
Add wizard for server URL,  no env vars needed
…es--develop--components--taco/cli

chore(develop): release taco/cli 0.1.8
…es--develop--components--taco/statesman

chore(develop): release taco/statesman 0.1.9
* fix build

* add missing files

* chore: bump version
…iggerhq#2281)

The experimental functions in `golang.org/x/exp/maps` are now available
in the standard library in Go 1.21.

Reference: https://go.dev/doc/go1.21#maps

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
…hq#2279)

Reference: GHSA-mh63-6h87-95cp

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
…(no-op) (diggerhq#2277)

* chore: pin all action dependencies to commit hash (no-op)

* standardize on double quotes
Remove the default auth basic method. This should be set using extraEnv
* draft prs lock and unlock fixing

* check explicitly for opened event

* ensure that the digger unlock success message is posted
* WIP apprunner guide

* feat: aws fargate cloudfront guide

* fix: remove debug changes

* feat: add examples

* remove other 127 references

---------

Co-authored-by: Igor Zalutski <izalutski@gmail.com>
Create The_OpenTaco_Project_Is_Now_Public.md
jterceiro and others added 29 commits January 22, 2026 09:28
This change adds a rebranding announcement to the main project README.

**Changes:**
- Adds a highlighted section at the top of the README announcing the rebranding from Digger to OpenTaco
- The rebranding start date is set for November 7th, 2025
- Clarifies that the company remains Digger, but the project is now called OpenTaco
- Explains the project evolution: from being an improvement over Atlantis to being the complete solution for running Terraform/OpenTofu in production
- Mentions that marketing materials will be gradually updated

This update informs users and contributors about the rebranding while maintaining project continuity.
* fix: handle missing digger config files gracefully

* test: update tests for graceful missing config handling

* fix: add nil pointer safety checks

- Added nil checks in GitHub payload processing to prevent panics
- Added helper functions getStringValue and getWorkflowCommands for safe access
- Updated integration test JSON to include missing sender and repository fields

* Update libs/digger_config/digger_config.go

return immediately instead of doing more work with project generation

Co-authored-by: Mohamed Habib <moe.habib9@gmail.com>

---------

Co-authored-by: Mohamed Habib <moe.habib9@gmail.com>
…q#2548)

This change implements automatic success for the digger/apply check when
all plan jobs complete with zero infrastructure changes, eliminating the
need for manual intervention in no-change scenarios.

Changes:
- Create both digger/plan and digger/apply checks when PR opens with plan jobs
- The apply check starts in "queued" state with message indicating it will
  auto-succeed if no changes are detected
- After plan batch completes successfully, detect if all jobs have zero changes
  (ResourcesCreated = 0, ResourcesUpdated = 0, ResourcesDeleted = 0)
- If all jobs have zero changes, automatically update apply check to "completed"
  with "success" conclusion
- Add GetCheckRunsForCommit() method to query check runs for a commit SHA

Benefits:
- Improved UX: Users see both checks immediately when PR opens
- Automation: No manual action needed for zero-change plans
- Clear communication: Check messages explain the automatic behavior
- No breaking changes: Existing behavior for plans with changes unchanged

Co-authored-by: substrate-bot <bot@substrate.run>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* Auto-succeed digger/apply check when plan shows zero changes

This change implements automatic success for the digger/apply check when
all plan jobs complete with zero infrastructure changes, eliminating the
need for manual intervention in no-change scenarios.

Changes:
- Create both digger/plan and digger/apply checks when PR opens with plan jobs
- The apply check starts in "queued" state with message indicating it will
  auto-succeed if no changes are detected
- After plan batch completes successfully, detect if all jobs have zero changes
  (ResourcesCreated = 0, ResourcesUpdated = 0, ResourcesDeleted = 0)
- If all jobs have zero changes, automatically update apply check to "completed"
  with "success" conclusion
- Add GetCheckRunsForCommit() method to query check runs for a commit SHA

Benefits:
- Improved UX: Users see both checks immediately when PR opens
- Automation: No manual action needed for zero-change plans
- Clear communication: Check messages explain the automatic behavior
- No breaking changes: Existing behavior for plans with changes unchanged

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: add digger:force label to bypass impacted projects limit

Add support for the 'digger:force' label on pull requests to bypass
the ImpactedProjectsPerChange limit. This allows users to intentionally
proceed with plan/apply operations on PRs that impact more projects than
the configured limit.

Changes:
- Check for 'digger:force' label in both PR and comment event handlers
- Update error messages to inform users about the bypass option
- Add warning logs when limit is bypassed for audit purposes
- Add slices import to github_comment.go for label checking

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: substrate-bot <bot@substrate.run>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Allow a list of AppIDs whoe comments will not be ignored
Allow comments from all bot accounts with the digger:allowbot PR label

Refs diggerhq#2553
* Add llms.txt for LLM-friendly documentation discovery

Provides a structured index of all 100 documentation pages with titles,
URLs, and brief descriptions organized by section, enabling LLMs to
efficiently navigate and reference the OpenTaco/Digger documentation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add MCP endpoint for AI agents to introduction page

Points AI coding agents (Claude Code, Cursor, etc.) to the OpenTaco
MCP documentation server for semantic search across the knowledge base.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
)

When a user signs up, there's a race condition where the webhook that
creates the user's organization may not have processed yet. This results
in the JWT not having an org_id claim, causing WorkOS API calls to fail
with "organization_id must be a string".

This change adds retry logic to requireAuth() that:
- Detects when organizationId is missing from the session
- Refreshes the session up to 3 times with 1s delay between attempts
- Gives the webhook time to process and assign the organization
- Throws a clear error if org is still missing after retries

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* docs: update reference and include terragrunt

* feat: dgctl schema

---------

Co-authored-by: Mohamed Habib <moe.habib9@gmail.com>
…, fix: handle drift job status processing in orchestrator (diggerhq#2569)

* feat: docker compose for full hosting set up

* feat: use postgres for statesman in docker compose

* fix: sidecar health check endpoint

* chore: move E2B API key to .env file

* fix: update DIGGER_DRIFT_REPORTER_HOSTNAME

* Add all necessary env vars to docker compose file

* Fix: duplicatre drift state machine logic to orchestrator

* handle legacy webhook route

* add postgres for token service, add compose profiles
* feat: add opentaco-platform-reference chart

* update helm release and test workflows

* handle statesman object storage secret in platform-reference

* handle separate public vs internal urls, add taco-sidecar

* standardize image conditionals for token-service to match other charts

* fix helm unittest, enable workload identity in taco-orchestrator

* fix broken unit tests

* remove mysql mssql and sqlite from token service to simplify / standardize

* set publicURL, signing secret, and enable x forwarding for statesman

* match cloudsql credential volume to internal chart

* update docker compose with new env vars

* add cronjob for drift execution and notification triggers

* bump chart versions

* use oci reference for taco-sidecar chart
* fix: build helm chart dependencies if they exist

* remove paths filter to ensure workflow runs

* release only drift and sidecar

* Revert temporary trigger modifications.
* chore: improve drift page layout/copy

* update drift ui
* refactor onboarding flow

* remove opentofu specific subheading

* move setup video loom

* Full onboarding pass

* docs: self-hosting docs refresh (diggerhq#2587)

* config + docker compose docs

* add note about self hosting persistance services
* refactor onboarding flow

* remove opentofu specific subheading

* move setup video loom

* Full onboarding pass

* config + docker compose docs

* add note about self hosting persistance services

* railway self-hosting docs

* kubernetes self hosting docs

* local dev docs + general cleanup

* improve github app setup docs

* clean up pass

* use ghcr helm chart repos

---------

Co-authored-by: “Sid <sid@devopsdirective.com>
…diggerhq#2609)

* docs: update color scheme and add custom styles for typography and navbar

* fix: default to light mode

---------

Co-authored-by: Jubril Oyetunji <cyberdev01@protonmail.com>
…imit

GitHub enforces a 65535 character limit on issue/PR comment bodies.
When terraform plan output is large, the entire comment post fails
with exit code 5, leaving users with no output at all.

This change splits comments exceeding 65000 characters into multiple
parts, each prefixed with 'Part X/Y'. The splitting tries to break
at newline boundaries to preserve readability.

Added splitComment helper function with unit tests.

Fixes diggerhq#1645
@tanguyantoine
Copy link
Copy Markdown

this would be awesome, is this implemented?

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.