Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/actions-scripts/create-translation-batch-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ async function findOrCreatePullRequest(config) {
* @param {object} config Configuration options for labeling the PR
* @returns {Promise<undefined>}
*/
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 = {
Expand All @@ -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()
20 changes: 10 additions & 10 deletions .github/actions-scripts/msft-create-translation-batch-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ async function findOrCreatePullRequest(config) {
* @param {object} config Configuration options for labeling the PR
* @returns {Promise<undefined>}
*/
// 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 = {
Expand All @@ -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()
78 changes: 39 additions & 39 deletions .github/workflows/create-translation-batch-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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: 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.'

# 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.'
# - 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"

# # 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.'
82 changes: 39 additions & 43 deletions .github/workflows/msft-create-translation-batch-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand All @@ -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: 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.'

# # 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.'
- 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"

# 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.'
2 changes: 1 addition & 1 deletion tests/translations/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
}))
])

Expand Down
6 changes: 4 additions & 2 deletions tests/translations/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand All @@ -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(
Expand Down