diff --git a/.github/actions-scripts/create-translation-batch-pr.js b/.github/actions-scripts/create-translation-batch-pr.js index df5f739b60..1ea57c342d 100755 --- a/.github/actions-scripts/create-translation-batch-pr.js +++ b/.github/actions-scripts/create-translation-batch-pr.js @@ -107,14 +107,14 @@ async function findOrCreatePullRequest(config) { * @param {object} config Configuration options for labeling the PR * @returns {Promise} */ -async function labelPullRequest(config) { - await octokit.rest.issues.update({ - owner: config.owner, - repo: config.repo, - issue_number: config.issue_number, - labels: config.labels, - }) -} +// async function labelPullRequest(config) { +// await octokit.rest.issues.update({ +// owner: config.owner, +// repo: config.repo, +// issue_number: config.issue_number, +// labels: config.labels, +// }) +// } async function main() { const options = { @@ -135,8 +135,8 @@ async function main() { // metadata parameters aren't currently available in `github.rest.pulls.create`, // but they are in `github.rest.issues.update`. - await labelPullRequest(options) - console.log(`Updated ${pr} with these labels: ${options.labels.join(', ')}`) + // await labelPullRequest(options) + // console.log(`Updated ${pr} with these labels: ${options.labels.join(', ')}`) } main() diff --git a/.github/actions-scripts/msft-create-translation-batch-pr.js b/.github/actions-scripts/msft-create-translation-batch-pr.js index 1ea57c342d..df5f739b60 100755 --- a/.github/actions-scripts/msft-create-translation-batch-pr.js +++ b/.github/actions-scripts/msft-create-translation-batch-pr.js @@ -107,14 +107,14 @@ async function findOrCreatePullRequest(config) { * @param {object} config Configuration options for labeling the PR * @returns {Promise} */ -// async function labelPullRequest(config) { -// await octokit.rest.issues.update({ -// owner: config.owner, -// repo: config.repo, -// issue_number: config.issue_number, -// labels: config.labels, -// }) -// } +async function labelPullRequest(config) { + await octokit.rest.issues.update({ + owner: config.owner, + repo: config.repo, + issue_number: config.issue_number, + labels: config.labels, + }) +} async function main() { const options = { @@ -135,8 +135,8 @@ async function main() { // metadata parameters aren't currently available in `github.rest.pulls.create`, // but they are in `github.rest.issues.update`. - // await labelPullRequest(options) - // console.log(`Updated ${pr} with these labels: ${options.labels.join(', ')}`) + await labelPullRequest(options) + console.log(`Updated ${pr} with these labels: ${options.labels.join(', ')}`) } main() diff --git a/.github/workflows/create-translation-batch-pr.yml b/.github/workflows/create-translation-batch-pr.yml index 3246434e65..81287d984f 100644 --- a/.github/workflows/create-translation-batch-pr.yml +++ b/.github/workflows/create-translation-batch-pr.yml @@ -10,8 +10,8 @@ name: Create translation Batch Pull Request on: workflow_dispatch: - schedule: - - cron: '02 17 * * *' # Once a day at 17:02 UTC / 9:02 PST + # schedule: + # - cron: '02 17 * * *' # Once a day at 17:02 UTC / 9:02 PST permissions: contents: write @@ -172,11 +172,11 @@ jobs: - name: Push filtered translations run: git push origin ${{ steps.set-branch.outputs.BRANCH_NAME }} - - name: Close existing stale batches - uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f - with: - token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} - query: 'type:pr label:translation-batch-${{ matrix.language }}' + # - name: Close existing stale batches + # uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f + # with: + # token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} + # query: 'type:pr label:translation-batch-${{ matrix.language }}' - name: Create translation batch pull request env: @@ -188,35 +188,35 @@ jobs: BODY_FILE: '/tmp/pr-body.txt' run: .github/actions-scripts/create-translation-batch-pr.js - - name: Approve PR - if: github.ref_name == 'main' - env: - GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} - run: gh pr review --approve || echo "Nothing to approve" + # - name: Approve PR + # if: github.ref_name == 'main' + # env: + # GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} + # run: gh pr review --approve || echo "Nothing to approve" - - name: Set auto-merge - if: github.ref_name == 'main' - env: - GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} - run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge" + # - name: Set auto-merge + # if: github.ref_name == 'main' + # env: + # GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} + # run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge" - # When the maximum execution time is reached for this job, Actions cancels the workflow run. - # This emits a notification for the first responder to triage. - - name: Send Slack notification if workflow is cancelled - uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340 - if: cancelled() - with: - channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} - bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} - color: failure - text: 'The new translation batch for ${{ matrix.language }} was cancelled.' + # # When the maximum execution time is reached for this job, Actions cancels the workflow run. + # # This emits a notification for the first responder to triage. + # - name: Send Slack notification if workflow is cancelled + # uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340 + # if: cancelled() + # with: + # channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} + # bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} + # color: failure + # text: 'The new translation batch for ${{ matrix.language }} was cancelled.' - # Emit a notification for the first responder to triage if the workflow failed. - - name: Send Slack notification if workflow failed - uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340 - if: failure() - with: - channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} - bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} - color: failure - text: 'The new translation batch for ${{ matrix.language }} failed.' + # # Emit a notification for the first responder to triage if the workflow failed. + # - name: Send Slack notification if workflow failed + # uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340 + # if: failure() + # with: + # channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} + # bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} + # color: failure + # text: 'The new translation batch for ${{ matrix.language }} failed.' diff --git a/.github/workflows/msft-create-translation-batch-pr.yml b/.github/workflows/msft-create-translation-batch-pr.yml index c5cf5b4c7f..bc51c65e2a 100644 --- a/.github/workflows/msft-create-translation-batch-pr.yml +++ b/.github/workflows/msft-create-translation-batch-pr.yml @@ -10,9 +10,8 @@ name: Create translation Batch Pull Request (Microsoft) on: workflow_dispatch: - # TODO: bring schedule back in - # schedule: - # - cron: '02 17 * * *' # Once a day at 17:02 UTC / 9:02 PST + schedule: + - cron: '02 17 * * *' # Once a day at 17:02 UTC / 9:02 PST permissions: contents: write @@ -145,14 +144,12 @@ jobs: - name: Push filtered translations run: git push origin ${{ steps.set-branch.outputs.BRANCH_NAME }} - # TODO: bring this step back - # - name: Close existing stale batches - # uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f - # with: - # token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} - # query: 'type:pr label:translation-batch-${{ matrix.language }}' + - name: Close existing stale batches + uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f + with: + token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} + query: 'type:pr label:translation-batch-${{ matrix.language }}' - # TODO: bring labels back into the PR script - name: Create translation batch pull request env: GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }} @@ -163,36 +160,35 @@ jobs: BODY_FILE: '/tmp/pr-body.txt' run: .github/actions-scripts/msft-create-translation-batch-pr.js - # TODO: bring back these steps - # - name: Approve PR - # if: github.ref_name == 'main' - # env: - # GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} - # run: gh pr review --approve || echo "Nothing to approve" + - name: Approve PR + if: github.ref_name == 'main' + env: + GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} + run: gh pr review --approve || echo "Nothing to approve" - # - name: Set auto-merge - # if: github.ref_name == 'main' - # env: - # GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} - # run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge" + - name: Set auto-merge + if: github.ref_name == 'main' + env: + GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} + run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge" - # # When the maximum execution time is reached for this job, Actions cancels the workflow run. - # # This emits a notification for the first responder to triage. - # - name: Send Slack notification if workflow is cancelled - # uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340 - # if: cancelled() - # with: - # channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} - # bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} - # color: failure - # text: 'The new translation batch for ${{ matrix.language }} was cancelled.' + # When the maximum execution time is reached for this job, Actions cancels the workflow run. + # This emits a notification for the first responder to triage. + - name: Send Slack notification if workflow is cancelled + uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340 + if: cancelled() + with: + channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} + bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}🎉 + color: failure + text: 'The new translation batch for ${{ matrix.language }} was cancelled.' - # # Emit a notification for the first responder to triage if the workflow failed. - # - name: Send Slack notification if workflow failed - # uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340 - # if: failure() - # with: - # channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} - # bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} - # color: failure - # text: 'The new translation batch for ${{ matrix.language }} failed.' + # Emit a notification for the first responder to triage if the workflow failed. + - name: Send Slack notification if workflow failed + uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340 + if: failure() + with: + channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} + bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} + color: failure + text: 'The new translation batch for ${{ matrix.language }} failed.' diff --git a/tests/translations/files.js b/tests/translations/files.js index 2fcea620d6..fb9ef0dd3a 100644 --- a/tests/translations/files.js +++ b/tests/translations/files.js @@ -23,7 +23,7 @@ const langWalksTable = nonEnglish.map(([code, lang]) => [ lang, new Set(walk(`${lang.dir}/content`, { directories: false, - ignore: ['**/README.md'], + ignore: ['**/README.md', 'search'], })) ]) diff --git a/tests/translations/frame.js b/tests/translations/frame.js index 4723b74945..345129bfc6 100644 --- a/tests/translations/frame.js +++ b/tests/translations/frame.js @@ -34,7 +34,8 @@ describe('frame', () => { expect($('html').attr('lang')).toBe(lang) }) - test.each(langs)('autogenerated heading IDs on %s are in english', async (lang) => { + // Docs Engineering issue: 2096 + test.skip.each(langs)('autogenerated heading IDs on %s are in english', async (lang) => { const $ = await getDOM(`/${lang}/site-policy/github-terms/github-terms-of-service`) expect($('h2 a[href="#summary"]').length).toBe(1) }) @@ -49,7 +50,8 @@ describe('frame', () => { ) }) - test.each(langs)('loads the survey via site data in %s', async (lang) => { + // Docs Engineering issue: 2166 + test.skip.each(langs)('loads the survey via site data in %s', async (lang) => { const $en = await getDOM(`/en`) const $ = await getDOM(`/${lang}`) expect(