Skip to content

Commit fe84824

Browse files
authored
Restructure GraphQL automated content scripts (#34308)
1 parent b66f4e7 commit fe84824

38 files changed

+62
-62
lines changed

.github/workflows/triage-unallowed-contributions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- 'assets/fonts/**'
1515
- 'data/graphql/**'
1616
- 'Dockerfile*'
17-
- 'lib/graphql/**'
17+
- 'src/**'
1818
- 'lib/redirects/**'
1919
- 'lib/rest/**'
2020
- 'lib/webhooks/**'
@@ -58,7 +58,7 @@ jobs:
5858
- 'assets/fonts/**'
5959
- 'data/graphql/**'
6060
- 'Dockerfile*'
61-
- 'lib/graphql/**'
61+
- 'src/**'
6262
- 'lib/redirects/**'
6363
- 'lib/rest/**'
6464
- 'lib/webhooks/**'
@@ -81,9 +81,9 @@ jobs:
8181
'assets/fonts/**',
8282
'data/graphql/**',
8383
'Dockerfile*',
84-
'lib/graphql/**',
84+
'src/**',
8585
'lib/redirects/**',
86-
'lib/rest/**',
86+
'lib/rest/**',
8787
'lib/webhooks/**',
8888
'package*.json',
8989
'scripts/**',

.github/workflows/update-graphql-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
# need to use a token from a user with access to github/github for this step
4040
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_FR }}
4141
run: |
42-
script/graphql/update-files.js
42+
src/graphql/scripts/update-files.js
4343
- name: Create pull request
4444
id: create-pull-request
4545
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ COPY stylesheets ./stylesheets
4848
COPY pages ./pages
4949
COPY components ./components
5050
COPY lib ./lib
51+
COPY src ./src
5152
# Certain content is necessary for being able to build
5253
COPY content/index.md ./content/index.md
5354
COPY content/rest ./content/rest
@@ -88,6 +89,7 @@ COPY --chown=node:node package.json ./
8889
COPY --chown=node:node assets ./assets
8990
COPY --chown=node:node content ./content
9091
COPY --chown=node:node lib ./lib
92+
COPY --chown=node:node src ./src
9193
COPY --chown=node:node middleware ./middleware
9294
COPY --chown=node:node data ./data
9395
COPY --chown=node:node next.config.js ./

content/graphql/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
The `/content/graphql` directory is where the GitHub GraphQL API docs live!
44

55
* The `/content/graphql/guides` and `/content/graphql/overview` directories contain articles that are human-editable.
6-
* The `/content/graphql/reference` directory contains an article for each GraphQL data type used in the GitHub GraphQL API. Most of the content in this directory is rendered using `include` tags.
6+
* The `/content/graphql/reference` directory contains an article for each GraphQL data type used in the GitHub GraphQL API. This content is generated from the data in `src/graphql/data` and should not be edited by a human. **As a result, we cannot accept contributions to GraphQL API reference content in this repository.**
77

8-
The content rendered by `include` tags is sourced from the `/lib/graphql/static` directory, which is automatically generated from the API source code internally in GitHub, and should not be edited by a human. For more information, see the [`/lib/graphql/README.md`](/lib/graphql/README.md).
9-
10-
**As a result, we cannot accept contributions to GraphQL API reference content in this repository.**
8+
For more information, see the [`/src/graphql/README.md`](/src/graphql/README.md).

data/graphql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GraphQL
22

33
The files in this directory are kept in sync with their counterparts on `github/github`
4-
by [automation](../script/graphql/README.md). These files **should not** be edited by humans.
4+
by [automation](../src/graphql/README.md). These files **should not** be edited by humans.
55

66
Dotcom source files:
77
```

pages/[versionId]/graphql/overview/breaking-changes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { getAutomatedPageMiniTocItems } from 'lib/get-mini-toc-items.js'
1212
import { BreakingChanges } from 'components/graphql/BreakingChanges'
1313
import { BreakingChangesT } from 'components/graphql/types'
14-
import { getGraphqlBreakingChanges } from 'lib/graphql/index.js'
14+
import { getGraphqlBreakingChanges } from 'src/graphql/lib/index.js'
1515

1616
type Props = {
1717
mainContext: MainContextT

pages/[versionId]/graphql/overview/changelog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { getAutomatedPageMiniTocItems } from 'lib/get-mini-toc-items.js'
1212
import { Changelog } from 'components/graphql/Changelog'
1313
import { ChangelogItemT } from 'components/graphql/types'
14-
import { getGraphqlChangelog } from 'lib/graphql/index.js'
14+
import { getGraphqlChangelog } from 'src/graphql/lib/index.js'
1515

1616
type Props = {
1717
mainContext: MainContextT

pages/[versionId]/graphql/overview/schema-previews.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { getAutomatedPageMiniTocItems } from 'lib/get-mini-toc-items.js'
1212
import { Previews } from 'components/graphql/Previews'
1313
import { PreviewT } from 'components/graphql/types'
14-
import { getPreviews } from 'lib/graphql/index.js'
14+
import { getPreviews } from 'src/graphql/lib/index.js'
1515

1616
type Props = {
1717
mainContext: MainContextT

pages/[versionId]/graphql/reference/[page].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { GetServerSideProps } from 'next'
22
import React from 'react'
33

44
import { GraphqlPage } from 'components/graphql/GraphqlPage'
5-
import { getGraphqlSchema, getMiniToc } from 'lib/graphql/index.js'
5+
import { getGraphqlSchema, getMiniToc } from 'src/graphql/lib/index.js'
66
import { MainContextT, MainContext, getMainContext } from 'components/context/MainContext'
77
import type { ObjectT, GraphqlT } from 'components/graphql/types'
88
import { AutomatedPage } from 'components/article/AutomatedPage'

script/enterprise-server-deprecations/remove-static-files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { deprecated } from '../../lib/enterprise-server-releases.js'
1515

1616
const graphqlDataDir = path.join(process.cwd(), 'data/graphql')
1717
const webhooksStaticDir = path.join(process.cwd(), 'lib/webhooks/static')
18-
const graphqlStaticDir = path.join(process.cwd(), 'lib/graphql/static')
18+
const graphqlStaticDir = path.join(process.cwd(), 'src/graphql/data')
1919
const restDecoratedDir = path.join(process.cwd(), 'lib/rest/static/decorated')
2020
const ghesReleaseNotesDir = 'data/release-notes/enterprise-server'
2121

0 commit comments

Comments
 (0)