danger / danger/swift

Running yarn danger local yields error

Open
#297 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
1.1k
Forks
152
Avg merge
9h 54m
Merged PRs (30d)
2

Description

# Report

## What did you do?

ℹ Please replace this with what you did.
`yarn danger local`

## What did you expect to happen?

Run on docker image (via bitbucket pipelines) and complete successfully.

## What happened instead?

```
root@893d1e34f18f:/app# yarn danger local
yarn run v1.19.1
$ /app/node_modules/.bin/danger local
events.js:187
throw er; // Unhandled 'error' event
^

Error: spawn git ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:262:19)
at onErrorNT (internal/child_process.js:464:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:12)
at onErrorNT (internal/child_process.js:464:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn git',
path: 'git',
spawnargs: [ 'diff', 'master...HEAD' ]
}
error Command failed with exit code 1.
```

## Your Environment
Bitbucket pipelines. Running latest version of Danger.

```ruby
import DangerSwiftCoverage
Coverage.spmCoverage(minimumCoverage: 50)
```
The bitbucket-pipeline contains:
```yml
# This is a sample build configuration for Other.
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
options:
docker: true

definitions:
services:
docker:
memory: 2048
swift:
image: swift:latest
memory: 128

steps:
- step: &step-test
name: Swift Unit Testing
image: swift
script:
- swift build
- api_token="$API_KEY" swift test
- step: &step-lint
name: Swift Lint
image: dantoml/swiftlint:latest
script:
- swiftlint autocorrect
- swiftlint lint
- step: &step-coverage
name: Danger Coverage
image: node:slim
caches:
- node
script:
- yarn add danger
- yarn danger ci

pipelines:
default:
- parallel:
- step: *step-test
- step: *step-lint
- step: *step-coverage
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Danger Coverage step in the shown Bitbucket pipeline and reproduce the command in the node:slim image, checking the reported spawn git ENOENT entry. Done means the Danger command completes successfully in the pipeline without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, git, node.js, swift
Domain
ci-cd, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.