Skip to content

GitHub API v3 breaking change #33

Open
@LemonSpike

Description

@LemonSpike

I've followed the getting started guide and have successfully integrated DangerSwiftCoverage on TeamCity CI:

Dangerfile.swift

import Danger
import DangerSwiftCoverage
import Foundation

print("Generating code coverage...")
Coverage.xcodeBuildCoverage(.xcresultBundle("Build/BenchSocialNetwork-DEV.xcresult"),
                            minimumCoverage: 50,
                            excludedTargets: ["BenchSocialNetworkTests.xctest", "BenchSocialNetworkUITests.xctest"])

Command: swift run danger-swift ci

Generating code coverage...
  xcrun xccov view --report --json Build/BenchSocialNetwork-DEV.xcresult > /var/folders/jd/pzvvs8196p5cj_0j56bscv280000gp/T/file

Failing the build, there is 1 fail.
  Request failed [422]: https://api.github.com/repos/<org>/<repo>/pulls/3/reviews
  Response: {
    "message": "Unprocessable Entity",
    "errors": [
      "Pull request review thread position is invalid and Pull request review thread diff hunk can't be blank"
    ],
    "documentation_url": "https://docs.github.com/rest/reference/pulls#create-a-review-for-a-pull-request
  }

I believe this is a breaking change with the way the plugin sends requests to GitHub, since the coverage generation gave an exit code of 0.

Hope you can advise / fix asap, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions