Skip to content

docs: update Terraform reference: custom_attestation_type summary attribute - #372

Open
mintlify[bot] wants to merge 1 commit into
mainfrom
mintlify/0e8bb1ff
Open

docs: update Terraform reference: custom_attestation_type summary attribute#372
mintlify[bot] wants to merge 1 commit into
mainfrom
mintlify/0e8bb1ff

Conversation

@mintlify

@mintlify mintlify Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Documents the new summary attribute on kosli_custom_attestation_type released in terraform-provider-kosli v0.9.3.

Changes

  • terraform-reference/resources/custom_attestation_type.mdx: added summary to the security scan example, added a new file-based code-quality example, and added the summary optional attribute to the schema list.
  • terraform-reference/data-sources/custom_attestation_type.mdx: added summary to the reuse example and outputs, and added the summary read-only attribute to the schema list.

Context

v0.9.3 (tagged 2026-08-18) adds an optional summary JSON attribute (array of ordered, labelled jq expressions) that Kosli renders as rows on the attestation detail page, with URL values rendered as links.

@mintlify
mintlify Bot requested a review from a team as a code owner August 24, 2026 09:08
@mintlify

mintlify Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
kosli 🟢 Ready View Preview Aug 24, 2026, 9:11 AM

@claude

claude Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Claude finished @mintlify[bot]'s task in 2m 19s —— View job


Doc review — summary attribute on kosli_custom_attestation_type

  • Read changed files and repo conventions
  • Review resource page
  • Review data-source page
  • Post findings

Advisory review only — no changes pushed, no approval/request-changes. Four inline comments posted.

Convention checks: pass. No new pages (both files already in config/navigation.json:490,505), no relative links, no new links at all so mint broken-links is unaffected, front matter untouched, existing <Update> changelog entry for v0.9.3 already present at changelog/index.mdx:64.

The content itself is accurate against what the repo already states — the fallback claim matches client_reference/kosli_create_attestation-type.md:38 ("Attestation types created without a summary fall back to the jq evaluation rules checklist"), and the examples mirror the changelog's HCL. The issues below are about structure and consistency, not correctness.

Critical

None.

Improvement

terraform-reference/resources/custom_attestation_type.mdx

  • Line 189 — the attribute bullet is carrying a whole section's worth of prose. Six sentences, ~3× longer than any neighbor, and the only place URL rendering, the fallback, file() loading, and semantic equality are documented. The page already has the right pattern: ## Schema validation and ## JQ rules each explain their attribute in prose with an example while the schema list stays terse. summary should get a ## Summary rows section and a trimmed bullet.
  • Lines 9–12 — the page intro wasn't updated. "Custom attestation types define the structure and validation rules for attestations in Kosli. They can include:" still lists only schema and jq rules. A reader skimming the top of the page won't learn the attribute exists.
  • Lines 90–103 — the code_quality example references summaries/code-quality.json but never shows what goes in it. file() is the one form of the attribute with no worked example on the page. The example also duplicates code_coverage's .line_coverage rule and introduces an unexplained .lint_errors.
  • Line 50 and line 189 — "labelled" → "labeled". CLAUDE.md mandates American spelling; every other occurrence in the repo uses "labeled", including the changelog entry for this same release. Vale's styles/Kosli/AmericanSpelling.yml swap list doesn't cover this pair, so CI won't catch it.

terraform-reference/data-sources/custom_attestation_type.mdx

  • Line 88 — "labelled" → "labeled", and "Null when the type defines no summary" is worth verifying. No other read-only attribute here documents its absent-value behavior, and null-vs-"" matters because line 38 feeds the value straight into a resource argument.
  • Line 31 — stale comment. # Use the queried schema in a new attestation type now sits above a block that reuses both schema and summary; the inline comment at line 36 was updated but this heading comment wasn't.

Suggestion

  • Line 14 — is the "at least one of schema or jq_rules" note still complete? Worth confirming whether the API now accepts a type defined with only summary. If it does, the note needs a third option; if not, it's fine as-is. Not something I can verify from this repo.
  • Consider where the canonical explanation should live. administration/managing_custom_attestation_types/overview.md doesn't mention summaries at all, and getting_started/attestations.md doesn't either — even though changelog/index.mdx:21,64,114 links readers to the latter for exactly this feature. That's a pre-existing gap rather than this PR's doing, but it's why the Terraform reference pages are having to explain product behavior twice (once per page) instead of linking out. Worth a follow-up issue.
  • Line 56 — trailing comma in the jsonencode([...]) list is valid HCL but differs from every other list on the page. Cosmetic; the changelog uses one too, so ignore if that's the house preference.
    • Branch mintlify/0e8bb1ff

Comment thread terraform-reference/resources/custom_attestation_type.mdx
- `description` (String) Description of the custom attestation type. Explains what this attestation type validates.
- `jq_rules` (List of String) List of jq evaluation rules. Each rule is a jq expression that must evaluate to true for the attestation to be considered compliant. Example: `[".coverage >= 80"]`. If omitted, no evaluation is performed.
- `schema` (String) JSON Schema definition that defines the structure of attestation data. Can be provided inline using heredoc syntax or loaded from a file using `file()`. If omitted, no schema validation is performed. Semantic equality is used for comparison, so formatting differences are ignored.
- `summary` (String) JSON array of ordered, labelled jq expressions rendered as rows on the attestation detail page in Kosli. Each element is an object with a `name` (the row label) and an `expression` (a jq expression evaluated against the attestation data); values that are valid URLs render as links. Can be provided inline using `jsonencode()`/heredoc syntax or loaded from a file using `file()`, so the same JSON can be kept in one place and shared with other tooling. Example: `jsonencode([{ name = "Coverage", expression = ".coverage" }])`. If omitted, the attestation detail page falls back to showing the jq evaluation results as a pass/fail checklist; removing it from a type that had one clears the summary. Semantic JSON equality is used when reading the value back from Kosli, so your formatting is preserved rather than being rewritten to the API's compact form.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Improvement — this entry is doing too much work. It's six sentences and ~3× longer than any neighbouring bullet, and it's the only place several behaviors are documented (URL rendering, the fallback, file() loading, semantic equality). The page's pattern for exactly this is a dedicated section: ## Schema validation and ## JQ rules both explain their attribute in prose with an example, and the schema list stays terse.

Suggest adding a ## Summary rows section after ## JQ rules carrying the prose plus a JSON example, and trimming this bullet to match its neighbors. Also fixes "labelled" → "labeled".

Suggested change
- `summary` (String) JSON array of ordered, labelled jq expressions rendered as rows on the attestation detail page in Kosli. Each element is an object with a `name` (the row label) and an `expression` (a jq expression evaluated against the attestation data); values that are valid URLs render as links. Can be provided inline using `jsonencode()`/heredoc syntax or loaded from a file using `file()`, so the same JSON can be kept in one place and shared with other tooling. Example: `jsonencode([{ name = "Coverage", expression = ".coverage" }])`. If omitted, the attestation detail page falls back to showing the jq evaluation results as a pass/fail checklist; removing it from a type that had one clears the summary. Semantic JSON equality is used when reading the value back from Kosli, so your formatting is preserved rather than being rewritten to the API's compact form.
- `summary` (String) JSON array of ordered, labeled jq expressions that Kosli renders as rows on the attestation detail page. Can be provided inline using `jsonencode()`/heredoc syntax or loaded from a file using `file()`. Example: `jsonencode([{ name = "Coverage", expression = ".coverage" }])`. If omitted, the detail page falls back to the jq evaluation results checklist. Semantic equality is used for comparison, so formatting differences are ignored.

Comment on lines +90 to +103
# Attestation type whose schema and summary are kept in standalone JSON files,
# so the same definitions can be shared with other tooling
resource "kosli_custom_attestation_type" "code_quality" {
name = "code-quality"
description = "Validates code quality metrics"

schema = file("${path.module}/schemas/code-quality.json")
summary = file("${path.module}/summaries/code-quality.json")

jq_rules = [
".line_coverage >= 80",
".lint_errors == 0"
]
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Improvement — this example points at files whose contents are never shown. A reader can't tell what belongs in summaries/code-quality.json (a bare JSON array of {name, expression}? wrapped in an object?). The schema case is covered by the ### Schema example block below; there's no equivalent for summary, so the file() path is the one form of the attribute with no worked example on the page.

Two smaller things: the resource is named code_quality but its jq_rules reference .line_coverage, duplicating code_coverage directly above it — and .lint_errors appears with no schema to explain it.

Suggest either dropping this example (the file() pattern is already stated in the attribute list) or pairing it with the JSON file contents in the proposed ## Summary rows section.

Comment thread terraform-reference/data-sources/custom_attestation_type.mdx
@dangrondahl dangrondahl changed the title Update Terraform reference: custom_attestation_type summary attribute docs: update Terraform reference: custom_attestation_type summary attribute Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants