Skip to content

Conversation

@joshuamkite-nfb
Copy link
Contributor

@joshuamkite-nfb joshuamkite-nfb commented Dec 16, 2025

Problem

Digger was sporadically showing git cloning errors in repositories that don't have Digger configured:

  • "Error loading digger config: error loading digger.yml: error cloning and loading config: git command failed: exit status 128"
  • "gnutls_handshake() failed: The TLS connection was non-properly terminated"

Root Cause

These issue appear to occur when the background projects refresh service and GitHub Actions process repositories without digger.yml files:

  1. Background projects refresh service clones repositories from the organization
  2. Repositories without digger.yml files get processed with generateProjects=true
  3. Empty configuration triggers terragrunt parsing if terragrunt files exist in those repositories
  4. Terragrunt parsing attempts to clone remote repositories referenced in terragrunt configurations
  5. Network/TLS issues cause git cloning failures

The generateProjects=true parameter is hardcoded in multiple places, e.g.:

Solution

Modified LoadDiggerConfigYaml function to handle missing configuration files gracefully by returning an empty configuration instead of an error when no config file is found.

Changes

  • libs/digger_config/digger_config.go: Changed error handling to return empty configuration when no config file exists
  • libs/digger_config/converters.go: Added nil check in copyWorkflowConfiguration to prevent panic when workflow config is nil
  • libs/ci/github/github.go: Added nil pointer safety checks for GitHub payload processing with helper functions getStringValue and getWorkflowCommands
  • libs/digger_config/digger_config_test.go: Updated existing test and added new test to verify graceful handling
  • cli/pkg/integration/integration_test.go: Fixed test JSON to include required sender and repository fields

Testing

  • All existing tests continue to pass (verified with full test suite: go test -v)
  • New tests verify that missing config files are handled gracefully both with and without project generation
  • Existing test coverage ensures repositories with Digger configuration continue to work as expected

Impact

  • Repositories without Digger configuration no longer show git cloning errors
  • Maintains full backward compatibility for configured repositories
  • Improves reliability of background projects refresh service and GitHub Actions
  • Reduces noise in logs and error reporting

🧠 AI Usage Details:

Used Claude (Anthropic's AI assistant) for:

  • Code analysis and debugging asssitance to identify the root cause
  • Root cause investigation and tracing through multiple components
  • Implementation of the fix and test updates
  • Code review and ensuring consistency with project style
  • All code was reviewed and verified manually

- 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
@joshuamkite-nfb
Copy link
Contributor Author

Looks like secrets.DEPOT_TOKEN is expired/invalid for the Docker based tests 🤷🏻‍♂️

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.

1 participant