Skip to content

Commit 965e1cc

Browse files
committed
Fix
1 parent ad6de3c commit 965e1cc

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/Elastic.Documentation.LinkIndex/LinkIndexProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public interface ILinkIndexProvider
1515
Task<LinkReferenceRegistry> GetLinkIndex(Cancel cancellationToken = default);
1616
Task SaveLinkIndex(LinkReferenceRegistry registry, Cancel cancellationToken = default);
1717
Task<LinkReference> GetLinkReference(string key, Cancel cancellationToken = default);
18+
19+
string GetLinkIndexPublicUrl();
1820
}
1921

2022
public class AwsS3LinkIndexProvider(IAmazonS3 s3Client, string bucketName = "elastic-docs-link-index", string registryKey = "link-index.json") : ILinkIndexProvider
@@ -74,4 +76,6 @@ public async Task<LinkReference> GetLinkReference(string key, Cancel cancellatio
7476
await using var stream = getObjectResponse.ResponseStream;
7577
return LinkReference.Deserialize(stream);
7678
}
79+
80+
public string GetLinkIndexPublicUrl() => $"https://{bucketName}.s3.{s3Client.Config.RegionEndpoint.SystemName}.amazonaws.com/{registryKey}";
7781
}

src/Elastic.Markdown/Links/CrossLinks/CrossLinkFetcher.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public record FetchedCrossLinks
3434

3535
public abstract class CrossLinkFetcher(ILinkIndexProvider linkIndexProvider, ILoggerFactory logger) : IDisposable
3636
{
37-
public const string RegistryUrl = $"https://elastic-docs-link-index.s3.us-east-2.amazonaws.com/link-index.json";
3837
private readonly ILogger _logger = logger.CreateLogger(nameof(CrossLinkFetcher));
3938
private readonly HttpClient _client = new();
4039
private LinkReferenceRegistry? _linkIndex;

src/tooling/docs-assembler/Cli/ContentSourceCommands.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ public async Task<int> Validate(Cancel ctx = default)
6161
if (!registryMapping.TryGetValue(next, out _))
6262
{
6363
collector.EmitError(context.ConfigurationPath,
64-
$"'{repository.Name}' has not yet published links.json for configured 'next' content source: '{next}' see {CrossLinkFetcher.RegistryUrl}");
64+
$"'{repository.Name}' has not yet published links.json for configured 'next' content source: '{next}' see {linkIndexProvider.GetLinkIndexPublicUrl()}");
6565
}
6666
if (!registryMapping.TryGetValue(current, out _))
6767
{
6868
collector.EmitError(context.ConfigurationPath,
69-
$"'{repository.Name}' has not yet published links.json for configured 'current' content source: '{current}' see {CrossLinkFetcher.RegistryUrl}");
69+
$"'{repository.Name}' has not yet published links.json for configured 'current' content source: '{current}' see {linkIndexProvider.GetLinkIndexPublicUrl()}");
7070
}
7171
}
7272

0 commit comments

Comments
 (0)