Danger component regression: v3.15 Jsonnet conversion re-added minimal-clone causing "path does not exist" errors

Emma Kelly
2026-04-03T14:47:04Z

## Summary

The v3.15 Jsonnet conversion of the danger component regressed the fix from !1224 that disabled minimal-clone for danger jobs.

## Problem

The danger gem cannot work with shallow clones (`GIT_DEPTH=1`) because it creates and deletes temporary branches (`danger_base`, `danger_head`) which causes git state issues with shallow repositories. This results in the error:

```
bundler: failed to load command: danger (/usr/local/bundle/bin/danger)
/builds/gitlab-com/gl-infra/gitlab-dedicated/amp: path does not exist (ArgumentError)
```

## Root Cause

In !1224 (released in v3.1.2), the `extends: .common_ci_tasks_minimal_clone` was removed from the danger job template to fix this exact issue.

However, the v3.15 Jsonnet conversion (!1379) re-added the minimal-clone extension:

```yaml
# danger.yml in v3.15.1
extends:
- .common_ci_tasks_minimal_clone
```

The fix in !1399 ("add missing minimal-clone include to danger component") actually made it worse by ensuring the include was present, but the real fix should be to NOT use minimal-clone at all for danger.

## Expected Behavior

The danger component should NOT extend `.common_ci_tasks_minimal_clone` (same as before v3.15).

## Workaround

Projects can override the `GIT_DEPTH` variable in their `.gitlab-ci.yml`:

```yaml
danger-review:
variables:
GIT_DEPTH: 20
```

## References

- Original fix: !1224
- Jsonnet conversion that regressed this: !1379
- Example failing job: https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/amp/-/jobs/13776192200