Skip to content

Commit c5a427c

Browse files
authored
Merge pull request #43279 from github/repo-sync
Repo sync
2 parents f2a2c50 + e9c6874 commit c5a427c

File tree

26 files changed

+489
-183
lines changed

26 files changed

+489
-183
lines changed

eslint.config.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ export default [
193193
'src/article-api/scripts/generate-api-docs.ts',
194194
'src/article-api/transformers/audit-logs-transformer.ts',
195195
'src/article-api/transformers/rest-transformer.ts',
196-
'src/automated-pipelines/tests/rendering.ts',
197196
'src/codeql-cli/scripts/convert-markdown-for-docs.ts',
198197
'src/content-linter/lib/helpers/get-lintable-yml.ts',
199198
'src/content-linter/lib/helpers/print-annotations.ts',
@@ -229,16 +228,11 @@ export default [
229228
'src/content-render/unified/index.ts',
230229
'src/content-render/unified/module-types.d.ts',
231230
'src/content-render/unified/rewrite-local-links.ts',
232-
'src/data-directory/lib/data-directory.ts',
233-
'src/data-directory/lib/data-schemas/learning-tracks.ts',
234231
'src/data-directory/lib/get-data.ts',
235-
'src/data-directory/scripts/find-orphaned-features/find.ts',
236232
'src/early-access/scripts/migrate-early-access-product.ts',
237233
'src/early-access/scripts/what-docs-early-access-branch.ts',
238234
'src/fixtures/tests/categories-and-subcategory.ts',
239235
'src/fixtures/tests/guides.ts',
240-
'src/fixtures/tests/liquid.ts',
241-
'src/fixtures/tests/markdown.ts',
242236
'src/fixtures/tests/translations.ts',
243237
'src/frame/components/context/ArticleContext.tsx',
244238
'src/frame/components/context/CategoryLandingContext.tsx',
@@ -258,13 +252,10 @@ export default [
258252
'src/github-apps/lib/index.ts',
259253
'src/graphql/lib/index.ts',
260254
'src/graphql/pages/reference.tsx',
261-
'src/graphql/scripts/build-changelog.ts',
262-
'src/graphql/scripts/utils/process-previews.ts',
263255
'src/graphql/scripts/utils/process-schemas.ts',
264256
'src/graphql/scripts/utils/schema-helpers.ts',
265257
'src/graphql/tests/validate-schema.ts',
266258
'src/journeys/lib/journey-path-resolver.ts',
267-
'src/journeys/middleware/journey-track.ts',
268259
'src/landings/components/CookBookFilter.tsx',
269260
'src/landings/components/ProductGuidesContext.tsx',
270261
'src/landings/components/ProductLandingContext.tsx',
@@ -274,13 +265,10 @@ export default [
274265
'src/languages/lib/correct-translation-content.ts',
275266
'src/languages/lib/render-with-fallback.ts',
276267
'src/languages/lib/translation-utils.ts',
277-
'src/learning-track/lib/process-learning-tracks.ts',
278268
'src/links/lib/update-internal-links.ts',
279269
'src/links/scripts/check-github-github-links.ts',
280270
'src/links/scripts/update-internal-links.ts',
281-
'src/links/tests/extract-links.ts',
282271
'src/pages/_error.tsx',
283-
'src/products/tests/get-product-groups.ts',
284272
'src/redirects/middleware/handle-redirects.ts',
285273
'src/rest/components/get-rest-code-samples.ts',
286274
'src/rest/lib/index.ts',
@@ -319,13 +307,8 @@ export default [
319307
'src/types/markdownlint-rule-helpers.d.ts',
320308
'src/types/markdownlint-rule-search-replace.d.ts',
321309
'src/types/primer__octicons.d.ts',
322-
'src/versions/scripts/update-versioning-in-files.ts',
323310
'src/versions/scripts/use-short-versions.ts',
324311
'src/webhooks/lib/index.ts',
325-
'src/webhooks/scripts/webhook.ts',
326-
'src/workflows/content-changes-table-comment.ts',
327-
'src/workflows/fr-add-docs-reviewers-requests.ts',
328-
'src/workflows/git-utils.ts',
329312
'src/workflows/projects.ts',
330313
'src/workflows/tests/actions-workflows.ts',
331314
],

src/automated-pipelines/tests/rendering.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ type Page = {
1212
fullPath: string
1313
permalinks: Array<{ href: string }>
1414
versions: {
15-
feature?: any
16-
[key: string]: any
15+
feature?: string | string[]
16+
[key: string]: string | string[] | undefined
1717
}
1818
}
1919

src/data-directory/lib/data-directory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface DataDirectoryOptions {
1414
}
1515

1616
interface DataDirectoryResult {
17-
[key: string]: any
17+
[key: string]: unknown
1818
}
1919

2020
export default function dataDirectory(

src/data-directory/lib/data-schemas/learning-tracks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { schema } from '@/frame/lib/frontmatter'
22

33
// Some learning tracks have `versions` blocks that match `versions` frontmatter,
44
// so we can import that part of the FM schema.
5-
const versionsProps = Object.assign({}, (schema.properties as any).versions)
5+
const versionsProps = Object.assign({}, schema.properties.versions)
66

77
// `versions` are not required in learning tracks the way they are in FM.
88
delete versionsProps.required

src/data-directory/scripts/find-orphaned-features/find.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ function escapeRegex(string: string) {
317317
return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&')
318318
}
319319

320-
function isFloat(x: any) {
320+
function isFloat(x: string | number) {
321321
return !!(Number(x) + 1)
322322
}
323323
strictEqual(isFloat('1.2'), true)

src/data-directory/tests/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('data-directory', () => {
2424
return content.replace('markdown', 'MARKDOWN')
2525
}
2626
const data = dataDirectory(fixturesDir, { preprocess })
27-
expect(data.nested.baz).toBe('I am MARKDOWN!')
27+
expect((data.nested as Record<string, unknown>).baz).toBe('I am MARKDOWN!')
2828
})
2929

3030
test('option: extensions array', async () => {

src/fixtures/tests/liquid.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ describe('rowheaders', () => {
131131
// `scope` attribute.
132132
// See "Scope attribute should be used correctly on tables"
133133
// https://dequeuniversity.com/rules/axe/4.1/scope-attr-valid?application=RuleDescription
134-
$('thead th', firstTable).each((i: number, element: any) => {
134+
$('thead th', firstTable).each((i, element) => {
135135
expect($(element).attr('scope')).toBe('col')
136136
})
137-
$('tbody th', firstTable).each((i: number, element: any) => {
137+
$('tbody th', firstTable).each((i, element) => {
138138
expect($(element).attr('scope')).toBe('row')
139139
})
140140
// The 5 here is the other `expect(...)` that happens before these
@@ -222,7 +222,7 @@ describe('misc Liquid', () => {
222222
const links = $(`#article-contents a[href="${url}"]`)
223223
expect(links.length).toBe(2)
224224
const texts = links
225-
.map((i: number, element: any) => {
225+
.map((i, element) => {
226226
return $(element).text()
227227
})
228228
.get()
@@ -293,7 +293,7 @@ describe('data tag', () => {
293293
// But because `{% data reusables.injectables.paragraphs %}` is
294294
// inserted with some indentation, that's replicated on every line.
295295
const li = $('#article-contents li')
296-
.filter((_: number, element: any) => {
296+
.filter((_, element) => {
297297
return $(element).text().trim().startsWith('Point 1')
298298
})
299299
.eq(0)

src/fixtures/tests/markdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ describe('alerts', () => {
2323
const svgs = $('svg', alerts)
2424
expect(svgs.length).toBe(5)
2525
const titles = $('.ghd-alert-title', alerts)
26-
.map((_: number, el: any) => $(el).text())
26+
.map((_, el) => $(el).text())
2727
.get()
2828
expect(titles).toEqual(['Tip', 'Note', 'Important', 'Warning', 'Caution'])
2929
const bodies = $('p:nth-child(2)', alerts)
30-
.map((_: number, el: any) => $(el).text())
30+
.map((_, el) => $(el).text())
3131
.get()
3232
.map((s: string) => s.trim())
3333
expect(bodies).toEqual([

src/graphql/scripts/build-changelog.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ interface IgnoredChangesSummary {
5757
types: IgnoredChangeType[]
5858
}
5959

60+
let lastIgnoredChanges: Change[] = []
61+
6062
/**
6163
* Tag `changelogEntry` with `date: YYYY-mm-dd`, then prepend it to the JSON
6264
* structure written to `targetPath`. (`changelogEntry` and that file are modified in place.)
@@ -89,9 +91,8 @@ export async function createChangelogEntry(
8991
newUpcomingChanges: UpcomingChange[],
9092
): Promise<ChangelogEntry | null> {
9193
// Create schema objects out of the strings
92-
// Using 'as any' because loadSchema accepts string schema directly without requiring loaders
93-
const oldSchema = await loadSchema(oldSchemaString, {} as any)
94-
const newSchema = await loadSchema(newSchemaString, {} as any)
94+
const oldSchema = await loadSchema(oldSchemaString, { loaders: [] })
95+
const newSchema = await loadSchema(newSchemaString, { loaders: [] })
9596

9697
// Generate changes between the two schemas
9798
const changes = await diff(oldSchema, newSchema)
@@ -122,7 +123,7 @@ export async function createChangelogEntry(
122123
}
123124

124125
// Store ignored changes for potential workflow outputs
125-
;(createChangelogEntry as any).lastIgnoredChanges = ignoredChanges
126+
lastIgnoredChanges = ignoredChanges
126127

127128
const { schemaChangesToReport, previewChangesToReport } = segmentPreviewChanges(
128129
changesToReport,
@@ -333,7 +334,7 @@ const CHANGES_TO_REPORT = [
333334
* Get the ignored change types from the last changelog entry creation
334335
*/
335336
export function getLastIgnoredChanges(): Change[] {
336-
return (createChangelogEntry as any).lastIgnoredChanges || []
337+
return lastIgnoredChanges
337338
}
338339

339340
/**

src/graphql/scripts/sync.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ interface IgnoredChange {
3131

3232
interface RawPreview {
3333
title: string
34+
description?: string
3435
toggled_on: string[]
3536
toggled_by: string
3637
announcement?: unknown
3738
updates?: unknown
39+
owning_teams?: string[]
3840
}
3941

4042
interface UpcomingChangeEntry {

0 commit comments

Comments
 (0)