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
3 changes: 3 additions & 0 deletions config/assembler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ environments:
optimizely:
enabled: false
id: "18132920325"
feature_flags:
ASSEMBLER_API_EXPLORER: true
Comment thread
infra-vault-gh-plugin-prod[bot] marked this conversation as resolved.
Resolved
Comment thread
akira28 marked this conversation as resolved.
Resolved
Comment thread
infra-vault-gh-plugin-prod[bot] marked this conversation as resolved.
Resolved
Comment thread
infra-vault-gh-plugin-prod[bot] marked this conversation as resolved.
Resolved
PAGE_FEEDBACK: true
# Same AWS account as edge, so the WAF integration URL is shared.
waf_integration_url: https://33d8ddf078ac.edge.captcha-sdk.awswaf.com/33d8ddf078ac/jsapi.js
staging:
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/isolated/configure/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ Suppresses hints about links to API reference pages that don't exist in the API

### `ApiLinkLegacyPrefix`

Suppresses hints about links to API reference pages that use the legacy `/docs/api/doc/` prefix. The hint names the page's URL after the API Explorer cutover. Only valid in `docset.yml`.
Suppresses hints about links to API reference pages that use the legacy `/docs/api/doc/` prefix. The hint names the page's current URL. Only valid in `docset.yml`.
8 changes: 4 additions & 4 deletions docs/syntax/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ External links display an arrow indicator next to the link text.

### Links to API reference pages

Prefer an [API cross-link](../data/openapi/api-explorer.md#api-cross-links) to an API page, because the build fails when the page is missing. A hard-coded `https://www.elastic.co/docs/api/doc/...` link still works, and the build shows a hint when it points at a page that no longer exists in the API pages of the link index. The hint doesn't fail a `--strict` build, and you can silence it with `ApiLinkMissingPage` under [`suppress`](../documentation/isolated/configure/index.md#suppress). It covers inline links, bare URLs, directive links, `redirects.yml` targets and the links between API pages in OpenAPI descriptions, which you fix in the spec.
Prefer an [API cross-link](../data/openapi/api-explorer.md#api-cross-links) to an API page, because the build fails when the page is missing. A hard-coded `https://www.elastic.co/docs/api/...` link still works, and the build shows a hint when it points at a page that no longer exists in the API pages of the link index. The hint doesn't fail a `--strict` build, and you can silence it with `ApiLinkMissingPage` under [`suppress`](../documentation/isolated/configure/index.md#suppress). It covers inline links, bare URLs, directive links, `redirects.yml` targets and the links between API pages in OpenAPI descriptions, which you fix in the spec.

```markdown
[Search API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search)
[Search API](https://www.elastic.co/docs/api/elasticsearch/operation/operation-search)
```

If an endpoint no longer exists in the current API docs, point the link at the versioned tree that still has it, for example `https://www.elastic.co/docs/api/doc/kibana/v8/...`. Only the page is checked, not the `#anchor`, and `<...>` autolinks are not checked. An API the link index holds no pages for is not checked. Old bump.sh URLs are checked at the page the edge redirects them to.
If an endpoint no longer exists in the current API docs, point the link at the versioned tree that still has it, for example `https://www.elastic.co/docs/api/kibana/v8/...`. Only the page is checked, not the `#anchor`, and `<...>` autolinks are not checked. An API the link index holds no pages for is not checked. Old bump.sh URLs are checked at the page the edge redirects them to.

API pages are moving from `/docs/api/doc/<api>/...` to `/docs/api/<api>/...`. Until the API Explorer replaces bump.sh on `www.elastic.co`, keep writing `/docs/api/doc/...` links: they work on every environment, and the edge redirects them to the new path where the API Explorer already serves its pages. The build shows a hint with the new URL for each `/docs/api/doc/...` link, so you know what the link becomes after the cutover. You can silence it with `ApiLinkLegacyPrefix` under [`suppress`](../documentation/isolated/configure/index.md#suppress).
API pages moved from `/docs/api/doc/<api>/...` to `/docs/api/<api>/...` when the API Explorer replaced bump.sh on `www.elastic.co`. Write new links in the `/docs/api/<api>/...` form. Most existing `/docs/api/doc/...` links keep working, because the edge redirects them to the new path, and the build shows a hint with the new URL for each one. You can silence that hint with `ApiLinkLegacyPrefix` under [`suppress`](../documentation/isolated/configure/index.md#suppress). A few have no new page, such as links to `/docs/api/doc/observability-serverless/...`. For those the build shows the missing-page hint instead, which `ApiLinkMissingPage` silences, so point the link at a page that exists.

### Linked images

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public Uri Resolve(Uri crossLinkUri, string path) =>
public Uri ResolveSitePath(Uri crossLinkUri, string sitePath) => new(PublishedBaseUri, $"docs/{sitePath}");

/// <inheritdoc />
/// <remarks>www.elastic.co serves bump.sh until the API Explorer cutover (elastic/docs-eng-team#725), which flips this with prod's flag.</remarks>
public bool LegacyApiUrls => true;
/// <remarks>Follows prod's API Explorer flag, since isolated builds link API pages to www.elastic.co (elastic/docs-eng-team#725).</remarks>
public bool LegacyApiUrls => false;

private static Uri PublishedBaseUri { get; } = new("https://www.elastic.co");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
example-repo://api/example-api
isolated resolved https://www.elastic.co/docs/api/doc/example-api
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api
isolated resolved https://www.elastic.co/docs/api/example-api
codex-absolute resolved https://www.elastic.co/docs/api/example-api
publish resolved https://docs.example.test/api/doc/example-api
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api
publish-api-explorer resolved https://docs.example.test/docs/api/example-api
example-repo://api/example-api/
isolated resolved https://www.elastic.co/docs/api/doc/example-api
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api
isolated resolved https://www.elastic.co/docs/api/example-api
codex-absolute resolved https://www.elastic.co/docs/api/example-api
publish resolved https://docs.example.test/api/doc/example-api
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api
publish-api-explorer resolved https://docs.example.test/docs/api/example-api
example-repo://api/example-api/operation/operation-search
isolated resolved https://www.elastic.co/docs/api/doc/example-api/operation/operation-search
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api/operation/operation-search
isolated resolved https://www.elastic.co/docs/api/example-api/operation/operation-search
codex-absolute resolved https://www.elastic.co/docs/api/example-api/operation/operation-search
publish resolved https://docs.example.test/api/doc/example-api/operation/operation-search
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api/operation/operation-search
publish-api-explorer resolved https://docs.example.test/docs/api/example-api/operation/operation-search
example-repo://api/example-api/operation/operation-search#fragment
isolated resolved https://www.elastic.co/docs/api/doc/example-api/operation/operation-search#fragment
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api/operation/operation-search#fragment
isolated resolved https://www.elastic.co/docs/api/example-api/operation/operation-search#fragment
codex-absolute resolved https://www.elastic.co/docs/api/example-api/operation/operation-search#fragment
publish resolved https://docs.example.test/api/doc/example-api/operation/operation-search#fragment
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api/operation/operation-search#fragment
publish-api-explorer resolved https://docs.example.test/docs/api/example-api/operation/operation-search#fragment
example-repo://api/example-api/operation/operation-new
isolated resolved https://www.elastic.co/docs/api/doc/example-api/operation/operation-new
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api/operation/operation-new
isolated resolved https://www.elastic.co/docs/api/example-api/operation/operation-new
codex-absolute resolved https://www.elastic.co/docs/api/example-api/operation/operation-new
publish resolved https://docs.example.test/api/doc/example-api/operation/operation-new
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api/operation/operation-new
publish-api-explorer resolved https://docs.example.test/docs/api/example-api/operation/operation-new
Expand All @@ -41,26 +41,26 @@ example-repo://api/example-api/operation/operation-missing
publish-prefixed LinkFloatingPageNotFound: 'operation/operation-missing' is not a page of 'api/example-api' in the current version.
publish-api-explorer LinkFloatingPageNotFound: 'operation/operation-missing' is not a page of 'api/example-api' in the current version.
example-repo://api/example-api/8
isolated resolved https://www.elastic.co/docs/api/doc/example-api/8
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api/8
isolated resolved https://www.elastic.co/docs/api/example-api/8
codex-absolute resolved https://www.elastic.co/docs/api/example-api/8
publish resolved https://docs.example.test/api/doc/example-api/8
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api/8
publish-api-explorer resolved https://docs.example.test/docs/api/example-api/8
example-repo://api/example-api/8/operation/operation-search
isolated resolved https://www.elastic.co/docs/api/doc/example-api/v8/operation/operation-search
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api/v8/operation/operation-search
isolated resolved https://www.elastic.co/docs/api/example-api/v8/operation/operation-search
codex-absolute resolved https://www.elastic.co/docs/api/example-api/v8/operation/operation-search
publish resolved https://docs.example.test/api/doc/example-api/v8/operation/operation-search
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api/v8/operation/operation-search
publish-api-explorer resolved https://docs.example.test/docs/api/example-api/v8/operation/operation-search
example-repo://api/example-api/8/operation/operation-search-legacy
isolated resolved https://www.elastic.co/docs/api/doc/example-api/v8/operation/operation-search
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api/v8/operation/operation-search
isolated resolved https://www.elastic.co/docs/api/example-api/v8/operation/operation-search
codex-absolute resolved https://www.elastic.co/docs/api/example-api/v8/operation/operation-search
publish resolved https://docs.example.test/api/doc/example-api/v8/operation/operation-search
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api/v8/operation/operation-search
publish-api-explorer resolved https://docs.example.test/docs/api/example-api/v8/operation/operation-search
example-repo://api/example-api/8/operation/operation-old
isolated resolved https://www.elastic.co/docs/api/doc/example-api/v8/operation/operation-old
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api/v8/operation/operation-old
isolated resolved https://www.elastic.co/docs/api/example-api/v8/operation/operation-old
codex-absolute resolved https://www.elastic.co/docs/api/example-api/v8/operation/operation-old
publish resolved https://docs.example.test/api/doc/example-api/v8/operation/operation-old
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api/v8/operation/operation-old
publish-api-explorer resolved https://docs.example.test/docs/api/example-api/v8/operation/operation-old
Expand All @@ -71,8 +71,8 @@ example-repo://api/example-api/8/operation/operation-new
publish-prefixed LinkFloatingPageNotFound: 'operation/operation-new' is not a page of 'api/example-api' in version '8'.
publish-api-explorer LinkFloatingPageNotFound: 'operation/operation-new' is not a page of 'api/example-api' in version '8'.
example-repo://api/example-api/main/operation/operation-search
isolated resolved https://www.elastic.co/docs/api/doc/example-api/operation/operation-search
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api/operation/operation-search
isolated resolved https://www.elastic.co/docs/api/example-api/operation/operation-search
codex-absolute resolved https://www.elastic.co/docs/api/example-api/operation/operation-search
publish resolved https://docs.example.test/api/doc/example-api/operation/operation-search
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api/operation/operation-search
publish-api-explorer resolved https://docs.example.test/docs/api/example-api/operation/operation-search
Expand All @@ -83,8 +83,8 @@ example-repo://api/example-api/main/operation/operation-search-legacy
publish-prefixed LinkFloatingPageNotFound: 'operation/operation-search-legacy' is not a page of 'api/example-api' in version 'main'.
publish-api-explorer LinkFloatingPageNotFound: 'operation/operation-search-legacy' is not a page of 'api/example-api' in version 'main'.
example-repo://api/example-api/main
isolated resolved https://www.elastic.co/docs/api/doc/example-api
codex-absolute resolved https://www.elastic.co/docs/api/doc/example-api
isolated resolved https://www.elastic.co/docs/api/example-api
codex-absolute resolved https://www.elastic.co/docs/api/example-api
publish resolved https://docs.example.test/api/doc/example-api
publish-prefixed resolved https://docs.example.test/docs/9.0/api/doc/example-api
publish-api-explorer resolved https://docs.example.test/docs/api/example-api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ preview
enabled: assembler-api-explorer, page-feedback
enabled with FEATURE_PAGE_FEEDBACK=false and FEATURE_GUIDE_NAV=true: assembler-api-explorer, guide-nav
prod
yaml:
enabled:
enabled with FEATURE_PAGE_FEEDBACK=false and FEATURE_GUIDE_NAV=true: guide-nav
yaml: ASSEMBLER_API_EXPLORER=true, PAGE_FEEDBACK=true
enabled: assembler-api-explorer, page-feedback
enabled with FEATURE_PAGE_FEEDBACK=false and FEATURE_GUIDE_NAV=true: assembler-api-explorer, guide-nav
staging
yaml: ASSEMBLER_API_EXPLORER=true, NAVIGATION_PREVIEW=false, PAGE_FEEDBACK=true, WEBSITE_SEARCH=true
enabled: assembler-api-explorer, page-feedback, website-search
Expand Down
10 changes: 3 additions & 7 deletions tests/Elastic.Documentation.Build.Tests/FeatureFlagsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,12 @@ public void EnabledKeys_EnvironmentVariableOverridesYaml()
}

[Test]
public void ProdEnvironment_DoesNotEnableAssemblerApiExplorer()
public void ProdEnvironment_EnablesAssemblerApiExplorer()
{
var config = AssemblyConfiguration.Create(new ConfigurationFileProvider(new TestLoggerFactory(), new ConfigurationFileSystem()));
var prod = config.Environments["prod"];

prod.FeatureFlags.Should().NotContainKey("ASSEMBLER_API_EXPLORER");

var features = new FeatureFlags([]);
foreach (var (key, value) in prod.FeatureFlags)
features.Set(key, value);
features.AssemblerApiExplorerEnabled.Should().BeFalse();
// The checked-in value, not the effective flag: CI sets FEATURE_ASSEMBLER_API_EXPLORER, which would mask a removed key.
prod.FeatureFlags.Should().Contain("ASSEMBLER_API_EXPLORER", true);
}
}
Loading
Loading