Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/images/help/desktop/local-config-email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/local-config-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/mac-email-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/mac-name-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/mac-save-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/mac-select-default-branch-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/repository-settings-remote.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/repository-settings-save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/select-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/use-local-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/windows-email-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/windows-name-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/windows-save-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ In a file or pull request, you can also use the {% octicon "kebab-horizontal" ar
{% if blame-ignore-revs %}

## Ignore commits in the blame view
{% note %}

**Note:** Ignoring commits in the blame view is currently in public beta and subject to change.

{% endnote %}

All revisions specified in the `.git-blame-ignore-revs` file, which must be in the root directory of your repository, are hidden from the blame view using Git's `git blame --ignore-revs-file` configuration setting. For more information, see [`git blame --ignore-revs-file`](https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt) in the Git documentation.

Expand Down
34 changes: 29 additions & 5 deletions lib/hydro.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import FailBot from '../lib/failbot.js'

const TIME_OUT_TEXT = 'ms has passed since batch creation'

const MOCK_HYDRO_POST =
process.env.NODE_ENV === 'test' || JSON.parse(process.env.MOCK_HYDRO_POST || 'false')

// If the request to Hydro took an age, it could be either our
// network or that Hydro is just slow to respond. (Event possibly
// too slow to respond with a 422 code)
Expand All @@ -31,16 +34,28 @@ function getHttpsAgent() {
}

export default class Hydro {
constructor({ secret, endpoint } = {}) {
this.secret = secret || process.env.HYDRO_SECRET
constructor({ secret, endpoint, forceDisableMock } = {}) {
// When mocking, the secret isn't important because nothing's actually
// password protected in terms of HTTP authorization. But, the
// secret is used for creating an HMAC payload so it has to be
// a string.
this.secret = secret || process.env.HYDRO_SECRET || (MOCK_HYDRO_POST && '')
this.endpoint = endpoint || process.env.HYDRO_ENDPOINT
// This class is involved in 2 types of jest tests:
// 1. end-to-end tests where jest talks to localhost:4000 (with NODE_ENV===test)
// 2. literal unit tests that might mock the socket stuff
// Because `MOCK_HYDRO_POST = process.env.NODE_ENV === 'test'` gets set
// for either type of jest tests, this additional setting makes it
// possible to override `process.env.NODE_ENV === 'test'` from
// mocking the HTTP calls.
this.forceDisableMock = forceDisableMock
}

/**
* Can check if it can actually send to Hydro
*/
maySend() {
return Boolean(this.secret && this.endpoint && process.env.NODE_ENV !== 'test')
return Boolean(this.secret && this.endpoint) || MOCK_HYDRO_POST
}

/**
Expand Down Expand Up @@ -71,8 +86,16 @@ export default class Hydro {

const agent = getHttpsAgent()

const doPost = () =>
got(this.endpoint, {
const doPost = async () => {
// We *could* exit early on this whole `publish()` method if we know
// we're going to "mock" Hydro anyway, but injecting here, before
// the actual network operation, we make most of this method's code
// execute without actually depending on real network. This is
// good for any functional tests that depend on this, e.g. jest tests.
if (MOCK_HYDRO_POST && !this.forceDisableMock) {
return { statusCode: 200 }
}
return got(this.endpoint, {
method: 'POST',
body,
headers: {
Expand All @@ -90,6 +113,7 @@ export default class Hydro {
https: agent,
},
})
}

const res = await statsd.asyncTimer(doPost, 'hydro.response_time')()

Expand Down
237 changes: 202 additions & 35 deletions lib/rest/static/decorated/api.github.com.json

Large diffs are not rendered by default.

192 changes: 162 additions & 30 deletions lib/rest/static/decorated/ghes-3.1.json

Large diffs are not rendered by default.

192 changes: 162 additions & 30 deletions lib/rest/static/decorated/ghes-3.2.json

Large diffs are not rendered by default.

192 changes: 162 additions & 30 deletions lib/rest/static/decorated/ghes-3.3.json

Large diffs are not rendered by default.

192 changes: 162 additions & 30 deletions lib/rest/static/decorated/ghes-3.4.json

Large diffs are not rendered by default.

192 changes: 162 additions & 30 deletions lib/rest/static/decorated/ghes-3.5.json

Large diffs are not rendered by default.

Loading