Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
1 change: 1 addition & 0 deletions Dockerfile.openapi_decorator
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ COPY --chown=node:node package-lock.json /openapi-check
ADD --chown=node:node script /openapi-check/script
ADD --chown=node:node lib /openapi-check/lib
ADD --chown=node:node content /openapi-check/content
ADD --chown=node:node data /openapi-check/data

RUN npm ci -D

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,15 @@ on:

{% data reusables.webhooks.workflow_run_desc %}

{% data reusables.github-actions.branch-requirement %}
{% note %}

**Notes:**

* This event will only trigger a workflow run if the workflow file is on the default branch.

* You can't use `workflow_run` to chain together more than three levels of workflows. For example, if you attempt to trigger five workflows (named `B` to `F`) to run sequentially after an initial workflow `A` has run (that is: `A` → `B` → `C` → `D` → `E` → `F`), workflows `E` and `F` will not be run.

{% endnote %}

| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` |
| --------------------- | -------------- | ------------ | -------------|
Expand Down
2 changes: 2 additions & 0 deletions content/admin/packages/enabling-github-packages-with-minio.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ shortTitle: Enable Packages with MinIO
- Make sure to configure the bucket you'll want to use in the future. We do not recommend changing your storage after you start using {% data variables.product.prodname_registry %}.

{% endwarning %}

## Prerequisites

Before you can enable and configure {% data variables.product.prodname_registry %} on {% data variables.product.product_location_enterprise %}, you need to prepare your MinIO storage bucket. To help you quickly set up a MinIO bucket and navigate MinIO's customization options, see the "[Quickstart for configuring your MinIO storage bucket for {% data variables.product.prodname_registry %}](/admin/packages/quickstart-for-configuring-your-minio-storage-bucket-for-github-packages)."

Ensure your MinIO external storage access key ID and secret have these permissions:
Expand Down
49 changes: 14 additions & 35 deletions lib/hydro.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,10 @@ import fetch from 'node-fetch'
import statsd from '../lib/statsd.js'
import FailBot from '../lib/failbot.js'

const SCHEMAS = {
page: 'docs.v0.PageEvent',
exit: 'docs.v0.ExitEvent',
link: 'docs.v0.LinkEvent',
search: 'docs.v0.SearchEvent',
searchResult: 'docs.v0.SearchResultEvent',
navigate: 'docs.v0.NavigateEvent',
survey: 'docs.v0.SurveyEvent',
experiment: 'docs.v0.ExperimentEvent',
redirect: 'docs.v0.RedirectEvent',
clipboard: 'docs.v0.ClipboardEvent',
print: 'docs.v0.PrintEvent',
preference: 'docs.v0.PreferenceEvent',
}

export default class Hydro {
constructor({ secret, endpoint } = {}) {
this.secret = secret || process.env.HYDRO_SECRET
this.endpoint = endpoint || process.env.HYDRO_ENDPOINT
this.schemas = SCHEMAS
}

/**
Expand All @@ -47,20 +31,14 @@ export default class Hydro {
* @param {any} value
*/
async publish(schema, value) {
return this.publishMany([{ schema, value }])
}

/**
* Publish multiple events to Hydro
* @param {[{ schema: string, value: any }]} events
*/
async publishMany(events) {
const body = JSON.stringify({
events: events.map(({ schema, value }) => ({
schema,
value: JSON.stringify(value), // We must double-encode the value property
cluster: 'potomac', // We only have ability to publish externally to potomac cluster
})),
events: [
{
schema,
value: JSON.stringify(value), // We must double-encode the value property
cluster: 'potomac', // We only have ability to publish externally to potomac cluster
},
],
})
const token = this.generatePayloadHmac(body)

Expand All @@ -81,23 +59,24 @@ export default class Hydro {
statsd.increment(`hydro.response_code.${res.status}`, 1, statTags)
statsd.increment('hydro.response_code.all', 1, statTags)

// Track hydro exceptions in Sentry, but don't track 503s because we can't do anything about service availability
if (!res.ok && res.status !== 503) {
// Track hydro exceptions in Sentry,
// but don't track 5xx because we can't do anything about service availability
if (!res.ok && res.status < 500) {
const err = new Error(`Hydro request failed: ${res.statusText}`)
err.status = res.status

const failures = await res.text()

FailBot.report(err, {
hydroStatus: res.status,
hydroText: res.statusText,
hydroFailures: failures,
})

// If the Hydro request failed as an "Unprocessable Entity", log it for diagnostics
if (res.status === 422) {
const failures = await res.json()
console.error(
`Hydro schema validation failed:\n - Request: ${body}\n - Failures: ${JSON.stringify(
failures
)}`
`Hydro schema validation failed:\n - Request: ${body}\n - Failures: ${failures}`
)
}

Expand Down
13 changes: 12 additions & 1 deletion lib/redirects/static/redirect-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,15 @@
- /billing/managing-billing-for-your-github-account/managing-invoices-for-your-enterprise

/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization
- /organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization
- /organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization

# The initializing-github-ae.md article is referenced in these code files:
# - lib/github/private_instance_bootstrapper/internal_support_contact.rb
# - lib/github/private_instance_bootstrapper/saml_idp_configuration.rb
# - lib/github/private_instance_bootstrapper/policies_configuration.rb
# This redirect ensures that the links don't resolve to the non-GHAE version
# of the docs as this article only exists in the GHAE docs.

/github-ae@latest/admin/configuration/configuring-your-enterprise/initializing-github-ae
- /admin/configuration/configuring-your-enterprise/initializing-github-ae
- /enterprise-server@latest/admin/configuration/configuring-your-enterprise/initializing-github-ae
17 changes: 16 additions & 1 deletion lib/schema-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ const preferenceSchema = {
},
}

export default {
export const eventSchema = {
oneOf: [
pageSchema,
exitSchema,
Expand All @@ -477,3 +477,18 @@ export default {
preferenceSchema,
],
}

export const hydroNames = {
page: 'docs.v0.PageEvent',
exit: 'docs.v0.ExitEvent',
link: 'docs.v0.LinkEvent',
search: 'docs.v0.SearchEvent',
searchResult: 'docs.v0.SearchResultEvent',
navigate: 'docs.v0.NavigateEvent',
survey: 'docs.v0.SurveyEvent',
experiment: 'docs.v0.ExperimentEvent',
redirect: 'docs.v0.RedirectEvent',
clipboard: 'docs.v0.ClipboardEvent',
print: 'docs.v0.PrintEvent',
preference: 'docs.v0.PreferenceEvent',
}
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-cn-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-cn.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-en-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-en.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-es-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-es.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-ja-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-ja.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-pt-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.0-pt.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-cn-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-cn.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-en-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-en.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-es-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-es.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-ja-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-ja.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-pt-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.1-pt.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-cn-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-cn.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-en-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-en.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-es-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-es.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-ja-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-ja.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-pt-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-3.2-pt.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-dotcom-cn-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-dotcom-cn.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-dotcom-en-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-dotcom-en.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-dotcom-es-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-dotcom-es.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-dotcom-ja-records.json.br
Git LFS file not shown
4 changes: 2 additions & 2 deletions lib/search/indexes/github-docs-dotcom-ja.json.br
Git LFS file not shown
Loading