Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ public static AssemblyConfiguration Deserialize(string yaml, bool skipPrivateRep
.ToDictionary(kvp => kvp.Name, kvp => kvp);

config.PrivateRepositories = privateRepositories.Where(r => !r.Value.Skip).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
// All repos marked private: true, regardless of skip: true. Skip means "does not publish
// docs", not "is not private". This set is used for render-time link visibility so that
// entries like kibana-team (private: true, skip: true) still have their links hidden.
config.AllPrivateRepositoryNames = new HashSet<string>(
privateRepositories.Select(r => r.Key),
StringComparer.OrdinalIgnoreCase
);
return config;
}
catch (Exception e)
Expand Down Expand Up @@ -119,6 +126,13 @@ public static AssemblyConfiguration Deserialize(string yaml, bool skipPrivateRep
[YamlIgnore]
public IReadOnlyDictionary<string, Repository> PrivateRepositories { get; private set; } = new Dictionary<string, Repository>();

/// All repository names marked <c>private: true</c>, regardless of <c>skip: true</c>.
/// <c>skip: true</c> means a repo does not publish docs, not that it is publicly visible.
/// Use this set for render-time link visibility rather than <see cref="PrivateRepositories"/>,
/// which excludes skipped repos because the cross-link fetcher has no link index for them.
[YamlIgnore]
public IReadOnlySet<string> AllPrivateRepositoryNames { get; private set; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase);

[YamlMember(Alias = "environments")]
public Dictionary<string, PublishEnvironment> Environments { get; set; } = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,13 @@ private void LoadPrivateRepositories()
{
try
{
// Try to load assembler configuration to get private repositories
// Try to load assembler configuration to get private repositories.
// Use AllPrivateRepositoryNames rather than PrivateRepositories.Keys: PrivateRepositories
// excludes skip:true entries (because the cross-link fetcher has no link index for them),
// but skip:true means "does not publish docs", not "is public". Repos like kibana-team
// (private:true, skip:true) must still have their links hidden at render time.
var assemblerConfig = AssemblyConfiguration.Create(Build.ConfigurationFileProvider);
foreach (var repoName in assemblerConfig.PrivateRepositories.Keys)
foreach (var repoName in assemblerConfig.AllPrivateRepositoryNames)
_ = PrivateRepositories.Add(repoName);
}
catch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ public void PrivateRepositoriesPropertyIsAccessible() =>
// (may contain repos from embedded assembler.yml)
Block!.PrivateRepositories.Should().NotBeNull();

[Fact]
public void LoadPrivateRepositories_IncludesSkipTruePrivateRepos()
{
// kibana-team is marked private: true, skip: true in the embedded assembler.yml.
// skip: true means "does not publish docs", not "is public". LoadPrivateRepositories
// must include it so that its links are hidden at render time.
Block!.PrivateRepositories.Should().Contain("kibana-team");
}

[Fact]
public void RendersPrLinksForPublicRepo()
{
Expand Down
Loading