Skip to content

Commit 244146f

Browse files
committed
Add edge content source
1 parent 48cd485 commit 244146f

File tree

7 files changed

+36
-14
lines changed

7 files changed

+36
-14
lines changed

config/assembler.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ environments:
2727
LAZY_LOAD_NAVIGATION: true
2828
dev:
2929
uri: http://localhost:4000
30-
content_source: next
30+
content_source: edge
3131
path_prefix: docs
3232

3333
named_git_references:
34-
stack: &stack 9.0
34+
stack:
35+
current: &stack_current 9.0
36+
next: &stack_next 9.1
37+
edge: &stack_edge main
38+
3539
cloud-hosted: ms-120
3640

3741
###
@@ -68,8 +72,9 @@ references:
6872
apm-aws-lambda:
6973
apm-k8s-attacher:
7074
beats:
71-
current: "9.0"
72-
next: main
75+
current: *stack_current
76+
next: *stack_next
77+
edge: *stack_edge
7378
ecs-dotnet:
7479
ecs-logging-go-logrus:
7580
ecs-logging-go-zap:
@@ -81,8 +86,9 @@ references:
8186
ecs-logging-ruby:
8287
ecs-logging:
8388
ecs:
84-
current: "9.0"
85-
next: main
89+
current: *stack_current
90+
next: *stack_next
91+
edge: *stack_edge
8692
elastic-otel-dotnet:
8793
elastic-otel-java:
8894
elastic-otel-node:
@@ -93,8 +99,9 @@ references:
9399
integrations:
94100
logstash-docs-md:
95101
logstash:
96-
current: "9.0"
97-
next: main
102+
current: *stack_current
103+
next: *stack_next
104+
edge: *stack_edge
98105
opentelemetry:
99106

100107
# @elastic/admin-docs

src/Elastic.Documentation.Configuration/Assembler/AssemblyConfiguration.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ private static TRepository RepositoryDefaults<TRepository>(TRepository r, string
5555
repository.GitReferenceCurrent = "main";
5656
if (string.IsNullOrEmpty(repository.GitReferenceNext))
5757
repository.GitReferenceNext = "main";
58+
if (string.IsNullOrEmpty(repository.GitReferenceEdge))
59+
repository.GitReferenceEdge = "main";
5860
if (string.IsNullOrEmpty(repository.Origin))
5961
{
6062
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("GITHUB_ACTIONS")))

src/Elastic.Documentation.Configuration/Assembler/ContentSource.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@ public enum ContentSource
1717

1818
[JsonStringEnumMemberName("current")]
1919
[Display(Name = "current")]
20-
Current
20+
Current,
21+
22+
[JsonStringEnumMemberName("edge")]
23+
[Display(Name = "edge")]
24+
Edge
2125
}

src/Elastic.Documentation.Configuration/Assembler/Repository.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public record Repository
3535
[YamlMember(Alias = "next")]
3636
public string GitReferenceNext { get; set; } = "main";
3737

38+
[YamlMember(Alias = "edge")]
39+
public string GitReferenceEdge { get; set; } = "main";
40+
3841
[YamlMember(Alias = "checkout_strategy")]
3942
public CheckoutStrategy CheckoutStrategy { get; set; } = CheckoutStrategy.Partial;
4043

@@ -45,6 +48,7 @@ public record Repository
4548
{
4649
ContentSource.Current => GitReferenceCurrent,
4750
ContentSource.Next => GitReferenceNext,
51+
ContentSource.Edge => GitReferenceEdge,
4852
_ => throw new ArgumentException($"The content source {contentSource} is not supported.", nameof(contentSource))
4953
};
5054
}

src/tooling/docs-assembler/Building/AssemblerCrossLinkFetcher.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ public override async Task<FetchedCrossLinks> Fetch(Cancel ctx)
2929
if (repository.Skip)
3030
continue;
3131

32-
var branch = publishEnvironment.ContentSource == ContentSource.Current
33-
? repository.GitReferenceCurrent
34-
: repository.GitReferenceNext;
32+
var branch = repository.GetBranch(publishEnvironment.ContentSource);
3533

3634
var linkReference = await Fetch(repositoryName, [branch], ctx);
3735
linkReferences.Add(repositoryName, linkReference);

src/tooling/docs-assembler/Navigation/AssemblerDocumentationSet.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public AssemblerDocumentationSet(
3030
Checkout checkout,
3131
CrossLinkResolver crossLinkResolver,
3232
TableOfContentsTreeCollector treeCollector,
33-
VersionsConfiguration versionsConfiguration)
33+
VersionsConfiguration versionsConfiguration
34+
)
3435
{
3536
AssembleContext = context;
3637
Checkout = checkout;
@@ -47,7 +48,7 @@ public AssemblerDocumentationSet(
4748
RepositoryName = checkout.Repository.Name,
4849
Ref = checkout.HeadReference,
4950
Remote = $"elastic/${checkout.Repository.Name}",
50-
Branch = checkout.Repository.GitReferenceCurrent
51+
Branch = checkout.Repository.GetBranch(env.ContentSource)
5152
};
5253

5354
var buildContext = new BuildContext(

tests/docs-assembler.Tests/src/docs-assembler.Tests/AssemblerConfigurationTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ public void ReadsVersions()
7070
.And.Be("main");
7171
apmServer.GitReferenceCurrent.Should().NotBeNullOrEmpty()
7272
.And.Be("main");
73+
apmServer.GitReferenceEdge.Should().NotBeNullOrEmpty()
74+
.And.Be("main");
75+
76+
var beats = config.ReferenceRepositories["apm-server"];
77+
beats.GitReferenceCurrent.Should().NotBeNullOrEmpty()
78+
.And.NotBe("main");
7379

7480
}
7581
}

0 commit comments

Comments
 (0)