From 84b6f0952c7b4f6fb4e0fb35abee71386692474d Mon Sep 17 00:00:00 2001 From: Evan Bonsignori Date: Mon, 8 Aug 2022 13:07:44 -0700 Subject: [PATCH 1/6] fake content change --- .../automating-builds-and-tests/about-continuous-integration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/actions/automating-builds-and-tests/about-continuous-integration.md b/content/actions/automating-builds-and-tests/about-continuous-integration.md index abe756b715..48f19c56fb 100644 --- a/content/actions/automating-builds-and-tests/about-continuous-integration.md +++ b/content/actions/automating-builds-and-tests/about-continuous-integration.md @@ -23,6 +23,8 @@ shortTitle: Continuous integration ## About continuous integration +Some content change test + Continuous integration (CI) is a software practice that requires frequently committing code to a shared repository. Committing code more often detects errors sooner and reduces the amount of code a developer needs to debug when finding the source of an error. Frequent code updates also make it easier to merge changes from different members of a software development team. This is great for developers, who can spend more time writing code and less time debugging errors or resolving merge conflicts. When you commit code to your repository, you can continuously build and test the code to make sure that the commit doesn't introduce errors. Your tests can include code linters (which check style formatting), security checks, code coverage, functional tests, and other custom checks. From d341c808bf533f1466792cc0d1abb5b447851c1c Mon Sep 17 00:00:00 2001 From: Evan Bonsignori Date: Mon, 8 Aug 2022 15:26:30 -0700 Subject: [PATCH 2/6] verify URL health before adding to table --- .../content-changes-table-comment.js | 23 +++++++++++++++---- .../content-changes-table-comment.yml | 5 +++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/actions-scripts/content-changes-table-comment.js b/.github/actions-scripts/content-changes-table-comment.js index 4aecea4709..32400b46c8 100755 --- a/.github/actions-scripts/content-changes-table-comment.js +++ b/.github/actions-scripts/content-changes-table-comment.js @@ -2,6 +2,7 @@ import * as github from '@actions/github' import { setOutput } from '@actions/core' +import got from 'got' import { getContents } from '../../script/helpers/git-utils.js' import parse from '../../lib/read-frontmatter.js' @@ -47,6 +48,13 @@ const articleFiles = files.filter( const lines = await Promise.all( articleFiles.map(async (file) => { + // Action triggered on PR and after preview env is deployed. Check health to determine if preview env is ready (healthy) + let appUrlIsHealthy = false + try { + const res = await got.head(`${APP_URL}/healthz`, { retry: { limit: 0 } }) + appUrlIsHealthy = res.statusCode === 200 + } catch (err) {} + const sourceUrl = file.blob_url const fileName = file.filename.slice(pathPrefix.length) const fileUrl = fileName.slice(0, fileName.lastIndexOf('.')) @@ -70,7 +78,8 @@ const lines = await Promise.all( const { data } = parse(fileContents) let contentCell = '' - let previewCell = '' + let previewCell = appUrlIsHealthy ? '' : '_Deployment pending..._' + let prodCell = '' if (file.status === 'added') contentCell = 'New file: ' @@ -98,12 +107,16 @@ const lines = await Promise.all( if (versions.toString() === nonEnterpriseDefaultVersion) { // omit version from fpt url - previewCell += `[${plan}](${APP_URL}/${fileUrl})
` + previewCell += appUrlIsHealthy ? `[${plan}](${APP_URL}/${fileUrl})
` : '' prodCell += `[${plan}](${PROD_URL}/${fileUrl})
` } else { // for non-versioned releases (ghae, ghec) use full url - previewCell += `[${plan}](${APP_URL}/${versions}/${fileUrl})
` + if (appUrlIsHealthy) { + previewCell += appUrlIsHealthy + ? `[${plan}](${APP_URL}/${versions}/${fileUrl})
` + : '' + } prodCell += `[${plan}](${PROD_URL}/${versions}/${fileUrl})
` } } else if (versions.length) { @@ -113,7 +126,9 @@ const lines = await Promise.all( prodCell += `${plan}@ ` versions.forEach((version) => { - previewCell += `[${version.split('@')[1]}](${APP_URL}/${version}/${fileUrl}) ` + previewCell += appUrlIsHealthy + ? `[${version.split('@')[1]}](${APP_URL}/${version}/${fileUrl}) ` + : '' prodCell += `[${version.split('@')[1]}](${PROD_URL}/${version}/${fileUrl}) ` }) previewCell += '
' diff --git a/.github/workflows/content-changes-table-comment.yml b/.github/workflows/content-changes-table-comment.yml index 51fa2ce095..1d61bd2f01 100644 --- a/.github/workflows/content-changes-table-comment.yml +++ b/.github/workflows/content-changes-table-comment.yml @@ -5,6 +5,10 @@ name: Content Changes Table Comment # **Who does it impact**: docs-internal/docs maintainers and contributors on: + # Trigger this workflow after preview deployment complete + workflow_run: + workflows: + - Azure - Deploy Preview Environment workflow_dispatch: pull_request_target: @@ -40,7 +44,6 @@ jobs: filters: | filterContentDir: - 'content/**/*' - filterContentDir: needs: PR-Preview-Links if: ${{ needs.PR-Preview-Links.outputs.filterContentDir == 'true' }} From b33f478c467a72b16838c1057cbc5d00889f1507 Mon Sep 17 00:00:00 2001 From: Evan Bonsignori Date: Mon, 8 Aug 2022 15:38:39 -0700 Subject: [PATCH 3/6] Update about-continuous-integration.md --- .../automating-builds-and-tests/about-continuous-integration.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/actions/automating-builds-and-tests/about-continuous-integration.md b/content/actions/automating-builds-and-tests/about-continuous-integration.md index 48f19c56fb..abe756b715 100644 --- a/content/actions/automating-builds-and-tests/about-continuous-integration.md +++ b/content/actions/automating-builds-and-tests/about-continuous-integration.md @@ -23,8 +23,6 @@ shortTitle: Continuous integration ## About continuous integration -Some content change test - Continuous integration (CI) is a software practice that requires frequently committing code to a shared repository. Committing code more often detects errors sooner and reduces the amount of code a developer needs to debug when finding the source of an error. Frequent code updates also make it easier to merge changes from different members of a software development team. This is great for developers, who can spend more time writing code and less time debugging errors or resolving merge conflicts. When you commit code to your repository, you can continuously build and test the code to make sure that the commit doesn't introduce errors. Your tests can include code linters (which check style formatting), security checks, code coverage, functional tests, and other custom checks. From 20f1fdfa3113e8687f85b5be7936592120082ffc Mon Sep 17 00:00:00 2001 From: Evan Bonsignori Date: Tue, 9 Aug 2022 12:20:33 -0700 Subject: [PATCH 4/6] debug --- .../a-new-file.md | 16 ++++++++++++++++ ...esses-in-the-audit-log-for-your-enterprise.md | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/a-new-file.md diff --git a/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/a-new-file.md b/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/a-new-file.md new file mode 100644 index 0000000000..4a7e331db4 --- /dev/null +++ b/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/a-new-file.md @@ -0,0 +1,16 @@ +--- +title: Fake article +intro: Fake +shortTitle: Fake +permissions: Enterprise owners can display IP addresses in the audit log for an enterprise. +versions: + feature: enterprise-audit-log-ip-addresses +type: how_to +topics: + - Auditing + - Enterprise + - Logging + - Networking + - Security +--- + diff --git a/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/displaying-ip-addresses-in-the-audit-log-for-your-enterprise.md b/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/displaying-ip-addresses-in-the-audit-log-for-your-enterprise.md index 74917e1594..f427edfd12 100644 --- a/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/displaying-ip-addresses-in-the-audit-log-for-your-enterprise.md +++ b/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/displaying-ip-addresses-in-the-audit-log-for-your-enterprise.md @@ -14,6 +14,8 @@ topics: - Security --- +TEST EDIT + ## About display of IP addresses in the audit log By default, {% data variables.product.product_name %} does not display the source IP address for events in your enterprise's audit log. Optionally, to ensure compliance and respond to threats, you can display the full IP address associated with the actor responsible for each event. Actors are typically users, but can also be apps or integrations. From 9f213fa941d1b9ae28ff5bee1480b005fb71fb50 Mon Sep 17 00:00:00 2001 From: Evan Bonsignori Date: Tue, 9 Aug 2022 12:32:18 -0700 Subject: [PATCH 5/6] remove content changes --- .../a-new-file.md | 16 ---------------- ...esses-in-the-audit-log-for-your-enterprise.md | 2 -- 2 files changed, 18 deletions(-) delete mode 100644 content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/a-new-file.md diff --git a/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/a-new-file.md b/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/a-new-file.md deleted file mode 100644 index 4a7e331db4..0000000000 --- a/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/a-new-file.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Fake article -intro: Fake -shortTitle: Fake -permissions: Enterprise owners can display IP addresses in the audit log for an enterprise. -versions: - feature: enterprise-audit-log-ip-addresses -type: how_to -topics: - - Auditing - - Enterprise - - Logging - - Networking - - Security ---- - diff --git a/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/displaying-ip-addresses-in-the-audit-log-for-your-enterprise.md b/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/displaying-ip-addresses-in-the-audit-log-for-your-enterprise.md index f427edfd12..74917e1594 100644 --- a/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/displaying-ip-addresses-in-the-audit-log-for-your-enterprise.md +++ b/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/displaying-ip-addresses-in-the-audit-log-for-your-enterprise.md @@ -14,8 +14,6 @@ topics: - Security --- -TEST EDIT - ## About display of IP addresses in the audit log By default, {% data variables.product.product_name %} does not display the source IP address for events in your enterprise's audit log. Optionally, to ensure compliance and respond to threats, you can display the full IP address associated with the actor responsible for each event. Actors are typically users, but can also be apps or integrations. From 1ecbbdd924fc111a5e5bd2803eb50c137f0c9705 Mon Sep 17 00:00:00 2001 From: Evan Bonsignori Date: Tue, 9 Aug 2022 13:55:14 -0700 Subject: [PATCH 6/6] Update content-changes-table-comment.yml --- .github/workflows/content-changes-table-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/content-changes-table-comment.yml b/.github/workflows/content-changes-table-comment.yml index 1d61bd2f01..355af58d08 100644 --- a/.github/workflows/content-changes-table-comment.yml +++ b/.github/workflows/content-changes-table-comment.yml @@ -5,7 +5,7 @@ name: Content Changes Table Comment # **Who does it impact**: docs-internal/docs maintainers and contributors on: - # Trigger this workflow after preview deployment complete + # Trigger this workflow after preview deployment runs workflow_run: workflows: - Azure - Deploy Preview Environment