Skip to content

Commit ef726ed

Browse files
authored
Merge branch 'main' into patch-9
2 parents f0f3029 + cbd8ef7 commit ef726ed

461 files changed

Lines changed: 804772 additions & 1457 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ docs/
77
node_modules/
88
script/
99
tests/
10-
# These files are currently being added by automation in github/github. We will be removing the files permanently when we fix the broken automation in github/github.
11-
lib/rest/static/dereferenced
1210
# Folder is cloned during the preview + prod workflows, the assets are merged into other locations for use before the build
1311
docs-early-access/
1412
# During the preview deploy untrusted user code may be cloned into this directory

.github/actions-scripts/rendered-content-link-checker.js

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ async function main(core, octokit, uploadArtifact, opts = {}) {
288288
)
289289
}
290290
}
291+
} else {
292+
// It might be that the PR got a comment about >0 flaws before,
293+
// and now it can update that comment to say all is well again.
294+
if (shouldComment) {
295+
await commentOnPR(core, octokit, flaws, opts)
296+
}
291297
}
292298
}
293299

@@ -327,7 +333,7 @@ async function linkReports(core, octokit, newReport, opts) {
327333

328334
const [owner, repo] = reportRepository.split('/')
329335

330-
core.debug('Attempting to link reports...')
336+
core.info('Attempting to link reports...')
331337
// Find previous broken link report issue
332338
let previousReports
333339
try {
@@ -346,7 +352,7 @@ async function linkReports(core, octokit, newReport, opts) {
346352
core.setFailed('Error listing issues for repo')
347353
throw error
348354
}
349-
core.debug(`Found ${previousReports.length} previous reports`)
355+
core.info(`Found ${previousReports.length} previous reports`)
350356

351357
if (previousReports.length <= 1) {
352358
core.info('No previous reports to link to')
@@ -422,10 +428,48 @@ async function commentOnPR(core, octokit, flaws, opts) {
422428
return
423429
}
424430

431+
const findAgainSymbol = '<!-- rendered-content-link-checker-comment-finder -->'
432+
425433
const body = flawIssueDisplay(flaws, opts, false)
434+
435+
const { data } = await octokit.rest.issues.listComments({
436+
owner,
437+
repo,
438+
issue_number: pullNumber,
439+
})
440+
let previousCommentId
441+
for (const { body, id } of data) {
442+
if (body.includes(findAgainSymbol)) {
443+
previousCommentId = id
444+
}
445+
}
446+
426447
// Since failed external urls aren't included in PR comment, body may be empty
427448
if (!body) {
428449
core.info('No flaws qualify for comment')
450+
451+
if (previousCommentId) {
452+
const nothingComment = 'Previous broken links comment now moot. 👌😙'
453+
await octokit.rest.issues.updateComment({
454+
owner,
455+
repo,
456+
comment_id: previousCommentId,
457+
body: `${nothingComment}\n\n${findAgainSymbol}`,
458+
})
459+
core.info(`Updated comment on PR: ${pullNumber} (${previousCommentId})`)
460+
}
461+
return
462+
}
463+
464+
if (previousCommentId) {
465+
const noteComment = '(*The original automated comment was updated*)'
466+
await octokit.rest.issues.updateComment({
467+
owner,
468+
repo,
469+
comment_id: previousCommentId,
470+
body: `${body}\n\n${noteComment}\n\n${findAgainSymbol}`,
471+
})
472+
core.info(`Updated comment on PR: ${pullNumber} (${previousCommentId})`)
429473
return
430474
}
431475

@@ -434,7 +478,7 @@ async function commentOnPR(core, octokit, flaws, opts) {
434478
owner,
435479
repo,
436480
issue_number: pullNumber,
437-
body,
481+
body: `${body}\n\n${findAgainSymbol}`,
438482
})
439483
core.info(`Created comment on PR: ${pullNumber}`)
440484
} catch (error) {

.github/workflows/first-responder-docs-content.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ jobs:
3333
const repoName = context.payload.repository.name
3434
const ownerName = context.payload.repository.owner.login
3535
const issueNumber = (context.eventName === "issues") ? context.payload.issue.number : context.payload.number
36-
const labels = (context.eventName === "issues") ? context.payload.issue.labels : context.payload.pull_request.labels
37-
const isOpenApiBotLabel = labels.filter(label => label.name === 'github-openapi-bot').length
3836
const updatedIssueInformation = await github.issues.get({
3937
owner: ownerName,
4038
repo: repoName,
@@ -43,13 +41,10 @@ jobs:
4341
const teamMembers = await github.request(
4442
`/orgs/github/teams/docs/members?per_page=100`
4543
)
46-
const logins = teamMembers.data.map(member => member.login)
44+
const teamLogins = teamMembers.data.map(member => member.login)
4745
// ignore PRs opened by docs bot accounts
48-
logins.push('Octomerger', 'octoglot')
49-
// For now, we do want the OpenAPI PRs to show up on the FR
50-
// project board because they aren't yet automerged.
51-
if (!isOpenApiBotLabel) logins.push('docubot')
52-
if (logins.some(login => login === updatedIssueInformation.data.user.login)) {
46+
teamLogins.push('Octomerger', 'octoglot')
47+
if (teamLogins.some(login => login === updatedIssueInformation.data.user.login)) {
5348
console.log(`This issue or pull request was authored by a member of the github/docs team.`)
5449
return 'true'
5550
}

.github/workflows/optimize-images.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.
67.9 KB
150 KB
-13.5 KB
Binary file not shown.
-73.7 KB
Binary file not shown.
-94 KB
Binary file not shown.
-66 KB
Binary file not shown.

0 commit comments

Comments
 (0)