Skip to content

Commit d840dc4

Browse files
authored
Merge branch 'main' into feature/show-ga-when-technical-preview-exists
2 parents 38d5cca + 0b83e45 commit d840dc4

File tree

16 files changed

+396
-235
lines changed

16 files changed

+396
-235
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ updates:
1717
day: 'monday'
1818
time: '08:00'
1919
groups:
20+
eslint:
21+
patterns:
22+
- 'eslint'
23+
- '@eslint/*'
24+
- 'typescript-eslint'
2025
eui:
2126
patterns:
2227
- '@elastic/eui*'

.github/workflows/preview-build.yml

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,17 @@ on:
4343
type: string
4444
default: 'false'
4545
required: false
46+
disable-comments:
47+
description: 'Disable comments'
48+
type: boolean
49+
default: false
50+
required: false
4651

4752
permissions:
4853
id-token: write
4954
deployments: write
5055
contents: read
51-
pull-requests: read
56+
pull-requests: write
5257

5358
jobs:
5459
match:
@@ -231,6 +236,81 @@ jobs:
231236
aws cloudfront create-invalidation \
232237
--distribution-id EKT7LT5PM8RKS \
233238
--paths "${PATH_PREFIX}" "${PATH_PREFIX}/*"
239+
240+
- name: Comment on PR
241+
continue-on-error: true
242+
if: startsWith(github.event_name, 'pull_request') && inputs.disable-comments != 'true' && env.MATCH == 'true' && steps.deployment.outputs.result && steps.check-files.outputs.all_changed_files
243+
uses: actions/github-script@v7
244+
env:
245+
ALL_CHANGED_FILES: ${{ steps.check-files.outputs.all_changed_files }}
246+
with:
247+
script: |
248+
const title = '## 🔍 Preview links for changed docs'
249+
const changedMdFiles = process.env.ALL_CHANGED_FILES
250+
.split(/\s+/)
251+
.filter(i => i.endsWith('.md'))
252+
.filter(i => !i.includes('/_snippets/'));
253+
254+
if (changedMdFiles.length === 0) {
255+
return;
256+
}
257+
258+
const toLink = (file) => {
259+
const path = file
260+
.replace('docs/', '')
261+
.replace('/index.md', '')
262+
.replace('.md', '');
263+
return `[${file}](https://docs-v3-preview.elastic.dev${process.env.PATH_PREFIX}/${path})`;
264+
}
265+
266+
const links = changedMdFiles.map(toLink)
267+
268+
const body = [
269+
title,
270+
...links.slice(0, 10).map(i => `- ${i}`),
271+
]
272+
273+
if (links.length > 10) {
274+
body.push('<details>');
275+
body.push('<summary>More links …</summary>');
276+
body.push('');
277+
for (const link of links.slice(10, 100)) {
278+
body.push(`- ${link}`);
279+
}
280+
body.push('');
281+
body.push('</details>');
282+
}
283+
284+
if (links.length > 100) {
285+
body.push('');
286+
body.push(`<sub>In total, ${links.length} files changed.</sub>`);
287+
}
288+
289+
const owner = context.repo.owner;
290+
const repo = context.repo.repo;
291+
const issue_number = context.payload.pull_request.number;
292+
293+
// Post or update a single bot comment
294+
const { data: comments } = await github.rest.issues.listComments({
295+
owner, repo, issue_number
296+
});
297+
const existing = comments.find(c =>
298+
c.user.type === 'Bot' &&
299+
c.body.startsWith(title)
300+
);
301+
if (existing) {
302+
await github.rest.issues.updateComment({
303+
owner, repo,
304+
comment_id: existing.id,
305+
body: body.join('\n'),
306+
});
307+
} else {
308+
await github.rest.issues.createComment({
309+
owner, repo,
310+
issue_number,
311+
body:body.join('\n'),
312+
});
313+
}
234314
235315
- name: Update Link Index
236316
if: |

Directory.Packages.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
<PackageVersion Include="Amazon.Lambda.S3Events" Version="3.1.0" />
1414
<PackageVersion Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4" />
1515
<PackageVersion Include="Amazon.Lambda.SQSEvents" Version="2.2.0" />
16-
<PackageVersion Include="AWSSDK.CloudFront" Version="4.0.0.10" />
17-
<PackageVersion Include="AWSSDK.CloudFrontKeyValueStore" Version="4.0.0.9" />
1816
<PackageVersion Include="AWSSDK.Core" Version="4.0.0.2" />
1917
<PackageVersion Include="AWSSDK.SQS" Version="4.0.0.1" />
2018
<PackageVersion Include="AWSSDK.S3" Version="4.0.0.1" />

docs/migration/guide/mapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ navigation_title: What books were migrated?
66

77
We did not migrate all Elastic documentation. We are purposefully leaving the majority of content behind in the legacy Asciidoc build system. This system will turn into our documentation archive.
88

9-
A full list of the content that was migrated to the V3 format is available [here](https://github.com/elastic/asciidocalypse/blob/main/docs/readme.md).
9+
A full list of the content that was migrated to the V3 format is available [here](https://github.com/elastic/asciidocalypse/tree/main-archive/docs#readme).

docs/migration/versioning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Tagged deployment
4747

4848
This is the default. To get started, follow our [guide](guide/index.md) to set up the new docs folder structure and CI configuration
4949

50-
Once setup ensure the repository is added to our `assembler.yml` under `references`.
50+
Once setup ensure the repository is added to our [`assembler.yml`](https://github.com/elastic/docs-builder/blob/main/src/tooling/docs-assembler/assembler.yml) under `references`.
5151

5252
For example say you want to onboard `elastic/my-repository` into the production build:
5353

@@ -113,4 +113,4 @@ jobs:
113113
pull-requests: read
114114
```
115115

116-
1. Ensure version branches are built and publish their links ahead of time.
116+
1. Ensure version branches are built and publish their links ahead of time.

src/Elastic.Documentation.Configuration/Versions/Version.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ public enum VersioningSystemId
8282
[Display(Name = "edot_php")]
8383
EdotPhp,
8484
[Display(Name = "edot_python")]
85-
EdotPython
85+
EdotPython,
86+
[Display(Name = "edot_cf_aws")]
87+
EdotCfAws
8688
}
8789

8890
[YamlSerializable]

src/Elastic.Documentation.Configuration/versions.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,7 @@ versioning_systems:
8585
edot_python:
8686
base: 1.0
8787
current: 1.3.0
88+
edot_cf_aws:
89+
base: 0.1
90+
current: 0.1.6
91+

0 commit comments

Comments
 (0)