Skip to content

Commit

Permalink
Make a fix for local process checking for platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Nov 20, 2018
1 parent 51a7b2d commit 1b38827
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
- Adds `html_url` to the PR JSON declaration - [@orta][]
- Adds a way for a sub-process to tell danger-js that it wants a copy of the DSL. This is a potential fix for when you
have a process that might not be ready to grab the DSL instantly from danger-js. The subprocess can print the message
`danger://send-dsl` to stdout and danger-js will re-send the DSL via STDIN. - [@orta][]

These two are to try and figure out [danger/swift#108](https://github.com/danger/swift/issues/108).
`danger://send-dsl` to stdout and danger-js will re-send the DSL via STDIN.
[danger/swift#108](https://github.com/danger/swift/issues/108). - [@orta][]
- Allows a FakeCI to get a FakePlatform, should fix [#767](https://github.com/danger/danger-js/issues/767) - [@orta][]

# 6.1.4

Expand Down
1 change: 1 addition & 0 deletions source/ci_source/providers/Fake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class FakeCI implements CISource {
get isCI(): boolean {
return ensureEnvKeysExist(this.env, ["DANGER_FAKE_CI"]) || ensureEnvKeysExist(this.env, ["DANGER_LOCAL_NO_CI"])
}

get isPR(): boolean {
return true
}
Expand Down
2 changes: 1 addition & 1 deletion source/ci_source/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import { Travis } from "./Travis"
import { VSTS } from "./VSTS"

const providers = [
FakeCI,
GitHubActions,
Travis,
Circle,
Semaphore,
Nevercode,
Jenkins,
FakeCI,
Surf,
DockerCloud,
Codeship,
Expand Down
6 changes: 6 additions & 0 deletions source/platforms/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { DangerResults } from "../dsl/DangerResults"
import { ExecutorOptions } from "../runner/Executor"
import { DangerRunner } from "../runner/runners/runner"
import chalk from "chalk"
import { FakePlatform } from "./FakePlatform"

/** A type that represents the downloaded metadata about a code review session */
export type Metadata = any
Expand Down Expand Up @@ -87,6 +88,11 @@ export interface PlatformCommunicator {
* @returns {Platform} returns a platform if it can be supported
*/
export function getPlatformForEnv(env: Env, source: CISource, requireAuth = true): Platform {
// Support automatically returning a fake platform if you pass a Fake CI
if (source.name === "Fake Testing CI") {
return new FakePlatform()
}

// BitBucket Server
const bbsHost = env["DANGER_BITBUCKETSERVER_HOST"]
if (bbsHost) {
Expand Down

0 comments on commit 1b38827

Please sign in to comment.