Skip to content

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Feb 13, 2025

This is the first stab at it:

  • We need a index.json file that lists all links.json files with their latest ref
  • This allows us to cache links.json files locally.

All links resolve to: https://docs-v3-preview.elastic.dev/elastic/<repos>/tree/main currently.

The index.json file should also list the current branch name so we do not assume main.

var dictionary = new Dictionary<string, LinkReference>();
foreach (var link in _links)
{
var url = $"https://elastic-docs-link-index.s3.us-east-2.amazonaws.com/elastic/{link}/main/links.json";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be master in some cases

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aye, that's why we need a links index file that points to all current index files.

{
var url = $"https://elastic-docs-link-index.s3.us-east-2.amazonaws.com/elastic/{link}/main/links.json";
_logger.LogInformation($"Fetching {url}");
var json = await client.GetStringAsync(url);
Copy link
Member

@reakaleek reakaleek Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the url doesn't exit yet?

While we onboard repositories, not all of them might be available from the start.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I'm only going to make docs-content mandatory to resolve.

All others we'll blindly transform to urls for now. (will follow up with another PR to introduce this behavior).

@Mpdreamz Mpdreamz merged commit 1a2dd84 into main Feb 14, 2025
5 checks passed
@Mpdreamz Mpdreamz deleted the feature/cross-links branch February 14, 2025 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants