Skip to content

Commit ccd8171

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/limited-width-layout-2
2 parents 3240315 + d160752 commit ccd8171

File tree

116 files changed

+1350
-998
lines changed

Some content is hidden

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

116 files changed

+1350
-998
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@ updates:
2424
interval: 'weekly'
2525
day: 'monday'
2626
time: '08:00'
27+
groups:
28+
system-io-abstractions:
29+
patterns:
30+
- 'System.IO.Abstractions'
31+
- 'System.IO.Abstractions.*'
2732
labels:
2833
- chore

.github/workflows/preview-build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ jobs:
175175
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && steps.s3-upload.outcome == 'success'
176176
uses: elastic/docs-builder/actions/update-link-index@main
177177

178-
- name: Update Reference Index
179-
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && steps.s3-upload.outcome == 'success'
180-
uses: elastic/docs-builder/actions/update-reference-index@main
181-
182178
- name: Update deployment status
183179
uses: actions/github-script@v7
184180
if: always() && steps.deployment.outputs.result

.github/workflows/preview-cleanup.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,3 @@ jobs:
5252
PR_NUMBER: ${{ github.event.pull_request.number }}
5353
run: |
5454
aws s3 rm "s3://elastic-docs-v3-website-preview/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}" --recursive
55-
56-
- name: 'Update Reference Index'
57-
uses: elastic/docs-builder/actions/update-reference-index@main

.github/workflows/release-drafter.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ permissions:
1111

1212
jobs:
1313
update-release-draft:
14+
concurrency:
15+
group: release-drafter
1416
permissions:
1517
contents: write
1618
pull-requests: read

.github/workflows/release.yml

Lines changed: 84 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,46 @@
1-
name: Pre-release main branch
1+
name: Release
22

33
on:
4-
release:
5-
types: [published]
6-
4+
workflow_dispatch:
5+
76
permissions:
87
contents: read
98
packages: write
9+
10+
concurrency:
11+
group: release-drafter
1012

1113
jobs:
14+
15+
release-drafter:
16+
outputs:
17+
tag_name: ${{ steps.release-drafter.outputs.tag_name }}
18+
permissions:
19+
contents: write
20+
pull-requests: read
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Verify branch
24+
run: |
25+
if [[ "${{ github.ref }}" != refs/heads/main ]]; then
26+
echo "This workflow is only allowed to run on the main branch."
27+
exit 1
28+
fi
29+
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
30+
id: release-drafter
31+
env:
32+
GITHUB_TOKEN: ${{ github.token }}
33+
- name: Create tag
34+
uses: actions/github-script@v7
35+
with:
36+
script: |
37+
github.rest.git.createRef({
38+
owner: context.repo.owner,
39+
repo: context.repo.repo,
40+
ref: 'refs/tags/${{ steps.release-drafter.outputs.tag_name }}',
41+
sha: context.sha
42+
})
43+
1244
containers:
1345
runs-on: ubuntu-latest
1446
outputs:
@@ -17,7 +49,8 @@ jobs:
1749

1850
steps:
1951
- uses: actions/checkout@v4
20-
52+
with:
53+
ref: ${{ steps.release-drafter.outputs.tag_name }}
2154
- name: Bootstrap Action Workspace
2255
id: bootstrap
2356
uses: ./.github/actions/bootstrap
@@ -29,32 +62,52 @@ jobs:
2962
username: ${{ github.actor }}
3063
password: ${{ secrets.GITHUB_TOKEN }}
3164

32-
3365
- name: Publish Containers
3466
run: ./build.sh publishcontainers
3567

3668
release-lambda:
69+
environment:
70+
name: link-index-updater-prod
3771
runs-on: ubuntu-latest
72+
needs:
73+
- release-drafter
3874
permissions:
3975
contents: write
76+
id-token: write
77+
env:
78+
ZIP_FILE: link-index-updater-lambda.zip
4079
steps:
4180
- uses: actions/checkout@v4
81+
with:
82+
ref: ${{ steps.release-drafter.outputs.tag_name }}
4283
- name: Amazon Linux 2023 build
4384
run: |
4485
docker build . -t publish-links-index:latest -f src/infra/docs-lambda-index-publisher/lambda.DockerFile
4586
- name: Get bootstrap binary
4687
run: |
4788
docker cp $(docker create --name tc publish-links-index:latest):/app/.artifacts/publish ./.artifacts && docker rm tc
48-
49-
# TODO publish to AWS
89+
90+
- uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
91+
with:
92+
role-to-assume: arn:aws:iam::197730964718:role/elastic-docs-v3-link-index-updater-deployer
93+
aws-region: us-east-2
94+
95+
- name: Upload Lambda function
96+
run: |
97+
zip -j "${ZIP_FILE}" .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
98+
aws lambda update-function-code \
99+
--function-name elastic-docs-v3-link-index-updater \
100+
--zip-file "fileb://${ZIP_FILE}"
101+
50102
- name: Attach Distribution to release
51103
env:
52104
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53-
run: gh release upload ${{ github.event.release.tag_name }} .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
54-
shell: bash
105+
run: gh release upload ${{ needs.release-drafter.outputs.tag_name }} "${ZIP_FILE}"
55106

56107
release:
57-
needs: [containers]
108+
needs:
109+
- containers
110+
- release-drafter
58111
strategy:
59112
fail-fast: false
60113
matrix:
@@ -70,6 +123,8 @@ jobs:
70123

71124
steps:
72125
- uses: actions/checkout@v4
126+
with:
127+
ref: ${{ steps.release-drafter.outputs.tag_name }}
73128

74129
- name: Bootstrap Action Workspace
75130
id: bootstrap
@@ -90,6 +145,22 @@ jobs:
90145
env:
91146
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92147
run: |
93-
gh release upload ${{ github.event.release.tag_name }} .artifacts/publish/docs-builder/release/*.zip
94-
gh release upload ${{ github.event.release.tag_name }} .artifacts/publish/docs-assembler/release/*.zip
148+
gh release upload ${{ needs.release-drafter.outputs.tag_name }} .artifacts/publish/docs-builder/release/*.zip
149+
gh release upload ${{ needs.release-drafter.outputs.tag_name }} .artifacts/publish/docs-assembler/release/*.zip
95150
shell: bash
151+
152+
publish-release:
153+
needs:
154+
- release
155+
- release-lambda
156+
- release-drafter
157+
runs-on: ubuntu-latest
158+
permissions:
159+
contents: write
160+
steps:
161+
- name: Publish release
162+
env:
163+
GH_TOKEN: ${{ github.token }}
164+
TAG_NAME: ${{ needs.release-drafter.outputs.tag_name }}
165+
run: |
166+
gh release edit ${{ needs.release-drafter.outputs.tag_name }} --draft=false --latest --repo ${{ github.repository }}

Directory.Packages.props

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
</ItemGroup>
99
<!-- AWS -->
1010
<ItemGroup>
11-
<PackageVersion Include="Amazon.Lambda.RuntimeSupport" Version="1.13.0"/>
12-
<PackageVersion Include="Amazon.Lambda.Core" Version="2.5.1"/>
13-
<PackageVersion Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4"/>
14-
<PackageVersion Include="AWSSDK.S3" Version="3.7.416.9"/>
11+
<PackageVersion Include="Amazon.Lambda.RuntimeSupport" Version="1.13.0" />
12+
<PackageVersion Include="Amazon.Lambda.Core" Version="2.5.1" />
13+
<PackageVersion Include="Amazon.Lambda.S3Events" Version="3.1.0" />
14+
<PackageVersion Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4" />
15+
<PackageVersion Include="Amazon.Lambda.SQSEvents" Version="2.2.0" />
16+
<PackageVersion Include="AWSSDK.SQS" Version="3.7.400.135" />
17+
<PackageVersion Include="AWSSDK.S3" Version="3.7.416.16"/>
1518
</ItemGroup>
16-
1719
<!-- Build -->
1820
<ItemGroup>
1921
<PackageVersion Include="Argu" Version="6.2.5" />
@@ -23,42 +25,41 @@
2325
<PackageVersion Include="Fake.IO.Zip" Version="6.1.3" />
2426
<PackageVersion Include="FSharp.Core" Version="9.0.202" />
2527
</ItemGroup>
26-
2728
<ItemGroup>
28-
<PackageVersion Include="ConsoleAppFramework" Version="5.4.1" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive"/>
29+
<PackageVersion Include="ConsoleAppFramework" Version="5.4.1" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
2930
<PackageVersion Include="ConsoleAppFramework.Abstractions" Version="5.4.1" />
30-
<PackageVersion Include="Crayon" Version="2.0.69"/>
31+
<PackageVersion Include="Crayon" Version="2.0.69" />
3132
<PackageVersion Include="DotNet.Glob" Version="3.1.3" />
32-
<PackageVersion Include="Errata" Version="0.13.0" />
33+
<PackageVersion Include="Errata" Version="0.14.0" />
3334
<PackageVersion Include="Github.Actions.Core" Version="9.0.0"/>
34-
<PackageVersion Include="Markdig" Version="0.40.0" />
35-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.4"/>
36-
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.4"/>
35+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.4" />
36+
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.4" />
37+
<PackageVersion Include="Markdig" Version="0.41.1" />
3738
<PackageVersion Include="NetEscapades.EnumGenerators" Version="1.0.0-beta12" PrivateAssets="all" ExcludeAssets="runtime" />
3839
<PackageVersion Include="Proc" Version="0.9.1" />
3940
<PackageVersion Include="RazorSlices" Version="0.8.1" />
4041
<PackageVersion Include="Samboy063.Tomlet" Version="6.0.0" />
4142
<PackageVersion Include="Slugify.Core" Version="4.0.1" />
4243
<PackageVersion Include="SoftCircuits.IniFileParser" Version="2.7.0" />
43-
<PackageVersion Include="System.IO.Abstractions" Version="21.0.29" />
44-
<PackageVersion Include="Utf8StreamReader" Version="1.3.2"/>
45-
<PackageVersion Include="Vecc.YamlDotNet.Analyzers.StaticGenerator" Version="16.1.3" PrivateAssets="All"/>
44+
<PackageVersion Include="System.IO.Abstractions" Version="22.0.14" />
45+
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.4" />
46+
<PackageVersion Include="Utf8StreamReader" Version="1.3.2" />
47+
<PackageVersion Include="Vecc.YamlDotNet.Analyzers.StaticGenerator" Version="16.1.3" PrivateAssets="All" />
4648
<PackageVersion Include="Westwind.AspNetCore.LiveReload" Version="0.5.2" />
4749
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
4850
</ItemGroup>
49-
5051
<!-- Test packages -->
5152
<ItemGroup>
52-
<PackageVersion Include="AngleSharp.Diffing" Version="1.0.0"/>
53-
<PackageVersion Include="DiffPlex" Version="1.7.2"/>
54-
<PackageVersion Include="FluentAssertions" Version="6.12.1"/>
55-
<PackageVersion Include="FsUnit.xUnit" Version="7.0.1"/>
53+
<PackageVersion Include="AngleSharp.Diffing" Version="1.0.0" />
54+
<PackageVersion Include="DiffPlex" Version="1.7.2" />
55+
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
56+
<PackageVersion Include="FsUnit.xUnit" Version="7.0.1" />
5657
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
5758
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0" />
58-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0"/>
59-
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="21.0.29"/>
60-
<PackageVersion Include="Unquote" Version="7.0.1"/>
61-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2"/>
62-
<PackageVersion Include="xunit.v3" Version="1.1.0"/>
59+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
60+
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="22.0.14" />
61+
<PackageVersion Include="Unquote" Version="7.0.1" />
62+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
63+
<PackageVersion Include="xunit.v3" Version="1.1.0" />
6364
</ItemGroup>
64-
</Project>
65+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information
4+
5+
namespace Elastic.Documentation;
6+
7+
public static class ContentSourceMoniker
8+
{
9+
public static Uri Create(string repo, string? path) => new(CreateString(repo, path));
10+
11+
public static string CreateString(string repo, string? path)
12+
{
13+
path = path?.Replace("\\", "/").Trim('/');
14+
if (string.IsNullOrWhiteSpace(path) || path == ".")
15+
return $"{repo}://";
16+
return $"{repo}://{path}/";
17+
}
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information
4+
5+
namespace Elastic.Documentation.Diagnostics;
6+
7+
public readonly record struct Diagnostic
8+
{
9+
public Severity Severity { get; init; }
10+
public int? Line { get; init; }
11+
public int? Column { get; init; }
12+
public int? Length { get; init; }
13+
public string File { get; init; }
14+
public string Message { get; init; }
15+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information
4+
5+
using System.Threading.Channels;
6+
7+
namespace Elastic.Documentation.Diagnostics;
8+
9+
public sealed class DiagnosticsChannel : IDisposable
10+
{
11+
private readonly Channel<Diagnostic> _channel;
12+
private readonly CancellationTokenSource _ctxSource;
13+
public ChannelReader<Diagnostic> Reader => _channel.Reader;
14+
15+
public Cancel CancellationToken => _ctxSource.Token;
16+
17+
public DiagnosticsChannel()
18+
{
19+
var options = new UnboundedChannelOptions
20+
{
21+
SingleReader = true,
22+
SingleWriter = false
23+
};
24+
_ctxSource = new CancellationTokenSource();
25+
_channel = Channel.CreateUnbounded<Diagnostic>(options);
26+
}
27+
28+
public void TryComplete(Exception? exception = null)
29+
{
30+
_ = _channel.Writer.TryComplete(exception);
31+
_ctxSource.Cancel();
32+
}
33+
34+
public ValueTask<bool> WaitToWrite(Cancel ctx) => _channel.Writer.WaitToWriteAsync(ctx);
35+
36+
public void Write(Diagnostic diagnostic)
37+
{
38+
var written = _channel.Writer.TryWrite(diagnostic);
39+
if (!written)
40+
{
41+
//TODO
42+
}
43+
}
44+
45+
public void Dispose() => _ctxSource.Dispose();
46+
}
47+
48+
public interface IDiagnosticsOutput
49+
{
50+
void Write(Diagnostic diagnostic);
51+
}

0 commit comments

Comments
 (0)