@@ -53,3 +53,150 @@ Slack: `#docs-engineering`
5353Repo: ` github/docs-engineering `
5454
5555If you have a question about automation pipelines, you can ask in the ` #docs-engineering ` Slack channel. If you notice a problem with one of the automation pipelines, you can open an issue in the ` github/docs-engineering ` repository.
56+
57+ ## Sample Pipeline Template
58+
59+ ### Basic pipeline structure
60+
61+ ```
62+ src/<pipeline-name>/
63+ ├── README.md # Pipeline documentation
64+ ├── scripts/
65+ │ └── sync.ts # Main sync script
66+ ├── data/ # Generated structured data (optional)
67+ │ ├── fpt/
68+ │ ├── ghec/
69+ │ └── ghes-*/
70+ ├── lib/ # Utilities and helpers
71+ ├── components/ # React components (if needed)
72+ ├── pages/ # Next.js pages (if needed)
73+ └── tests/ # Pipeline-specific tests
74+ ### Minimal sync script example
75+
76+ ```typescript
77+ // scripts/sync.ts
78+ import { Command } from 'commander'
79+
80+ const program = new Command()
81+ .description('Sync <pipeline-name> data')
82+ .option('--source-branch <branch>', 'Source repo branch', 'main')
83+ .parse()
84+
85+ const opts = program.opts()
86+
87+ async function main() {
88+ // 1. Fetch data from external source
89+ // 2. Transform data
90+ // 3. Write to data/ directory (or generate Markdown)
91+ // 4. Validate output
92+ }
93+
94+ main()
95+ ```
96+
97+ ### Workflow example
98+
99+ ``` yaml
100+ # .github/workflows/sync-<pipeline-name>.yml
101+ name : Sync <pipeline-name>
102+
103+ on :
104+ workflow_dispatch :
105+ inputs :
106+ SOURCE_BRANCH :
107+ description : ' Branch to sync from'
108+ default : ' main'
109+ schedule :
110+ - cron : ' 16 20 * * *' # Daily
111+
112+ jobs :
113+ sync :
114+ runs-on : ubuntu-latest
115+ steps :
116+ - uses : actions/checkout@v4
117+ - run : npm ci
118+ - run : npm run sync-<pipeline-name>
119+ ` ` `
120+
121+ ## Ownership Table
122+
123+ | Pipeline | Owning Team | Source Data Owner | Sync Frequency |
124+ |----------|-------------|-------------------|----------------|
125+ | REST | Docs Engineering | API Platform | Daily |
126+ | GraphQL | Docs Engineering | API Platform | Daily |
127+ | Webhooks | Docs Engineering | API Platform | Daily |
128+ | CodeQL CLI | Docs Engineering | Code Scanning | Per release |
129+ | GitHub Apps | Docs Engineering | Integrations | Daily |
130+ | Audit Logs | Docs Engineering | Enterprise | Daily |
131+ | Secret Scanning | Docs Engineering | Security | Daily |
132+
133+ ## Migration Status
134+
135+ ### Active pipelines (✅ Production)
136+ - REST API - Fully automated, daily sync
137+ - GraphQL API - Fully automated, daily sync
138+ - Webhooks - Fully automated, daily sync
139+ - GitHub Apps - Fully automated, daily sync
140+ - Secret Scanning - Fully automated, daily sync
141+ - Audit Logs - Fully automated, daily sync
142+
143+ ### Manual sync per release
144+ - CodeQL CLI - Manual sync per release
145+
146+ ### Legacy pipelines (📦 To migrate)
147+ - None currently identified
148+
149+ ### Migration patterns
150+
151+ When migrating manual content to automated pipelines:
152+ 1. **Audit existing content** - Document current structure
153+ 2. **Source data analysis** - Identify gaps between source and docs
154+ 3. **Data enrichment** - Work with source team to add missing fields
155+ 4. **Scraping phase** - Temporarily scrape existing content to preserve prose
156+ 5. **Gradual migration** - Migrate section by section
157+ 6. **Validation** - Compare old vs new output
158+ 7. **Deprecate manual** - Remove manual content once automated is stable
159+
160+ ## Shared Components
161+
162+ Components in ` src/automated-pipelines/components/` available for reuse:
163+ - Parameter tables
164+ - Response schemas
165+ - Code example formatting
166+ - Common layout patterns
167+
168+ # # Testing Strategy
169+
170+ # ## Automated pipeline tests
171+
172+ All autogenerated pages tested in `src/automated-pipelines/tests/rendering.ts` :
173+ - Page renders without errors
174+ - Required sections present
175+ - Links are valid
176+ - Schema validation
177+
178+ # ## Pipeline-specific tests
179+
180+ Each pipeline in `src/<pipeline-name>/tests/` should test :
181+ - Data transformation logic
182+ - Schema validation
183+ - Version handling
184+ - Edge cases specific to that pipeline
185+
186+ # ## Testing locally
187+
188+ ` ` ` bash
189+ # Run all automated pipeline tests
190+ npm run test -- src/automated-pipelines/tests
191+
192+ # Run specific pipeline tests
193+ npm run test -- src/<pipeline-name>/tests
194+ ` ` `
195+
196+ We are not expecting significant investment here, but we will add and support pipelines as needed to meet business needs.
197+
198+ # ## Developer experience
199+ - Pipeline scaffolding tool
200+ - Validation helpers
201+ - Testing fixtures
202+ - Documentation generator
0 commit comments