Skip to content

docs: fix TES backend examples - #263

Merged
uniqueg merged 3 commits into
devfrom
docs/tes-backend-examples
Oct 23, 2026
Merged

uniqueg merged 3 commits into
devfrom
docs/tes-backend-examples

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Finishes #229: #251 removed the default TES backends; the chart's examples still listed backends in the old string form (- "https://tes.example.org"), which the config model rejects since then.

  • deployment/values.yaml (commented config example) and deployment/README.md (values example): backends as objects (- url: ...), with client_credentials.issuer, which the default auth: client_credentials needs (the config model rejects backends with that auth and no identity provider).
  • docs/configuration.md: the TES instances example lacked the identity provider for the same reason; added it.
  • New tests/test_config_examples.py: every YAML block with service_list in README.md, deployment/README.md and docs/*.md, and the commented config example of the chart's values, merged into the base config (deep_merge of FOCA, as the app does), validates against CustomConfig, with the listed backend URLs. The old examples fail it (3 of 4). A second test fails if one of the expected sources (deployment/README.md, deployment/values.yaml, docs/access-control.md, docs/configuration.md) drops out of the collection.

No other old-form examples left (grepped docs, config files, Compose, test fixtures).

Review: quality review only (docs plus a small test with parsing logic; no app or chart template change). It found three lows (weak final assert, missing UTF-8 encoding, silent drop-out of examples); all fixed. Sourcery: YAML fences with info strings (yml, yaml title=...) escaped collection; fixed.

Verification

  • pytest: 664 passed, 76 skipped (Helm tests skipped: no helm locally; the chart change is in comments and the README only).
  • New test fails on origin/dev (README, configuration.md, values.yaml examples), passes on the branch.
  • pre-commit run on the changed files (ruff, mypy, semgrep, ast-grep, ...): passed.
  • mkdocs build --strict: passed.
  • CI: all checks passed (tests incl. MongoDB 7.0, Helm chart, Compose, docs, Read the Docs, CodeQL, image scan).

Declined review findings

None.

Open questions

None.

Closes #229

🤖 Generated with Claude Code

uniqueg and others added 2 commits October 23, 2026 20:35
The chart's values and README still listed TES backends as strings,
which the config model rejects since #251, and the examples of the
chart and of docs/configuration.md used the default auth
(client_credentials) without the identity provider it needs. List
backends as objects (url) and set client_credentials.issuer.

Add a test that the documented examples with TES backends (YAML
blocks of the READMEs and docs, and the commented config example of
the chart's values), merged into the base config, validate against
the config model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Address review: fail if a source of examples drops out of the
collection, compare the parsed backend URLs, and read the base config
as UTF-8.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The PR updates all affected TES backend examples to the current structured configuration, including the required identity-provider settings for client-credentials authentication, and adds tests that collect, merge, and validate documentation examples against the application config model while guarding against collection gaps.

Flow diagram for validating documented TES configuration examples

flowchart LR
    Docs[Documentation YAML examples] --> Collect[Collect service_list examples]
    Values[Chart values config example] --> Collect
    Collect --> Merge[deep_merge with base config]
    Merge --> Validate[Validate against CustomConfig]
    Validate --> Assert[Assert expected backend URLs]
Loading

File-Level Changes

Change Details Files
Updated TES backend documentation examples to match the current object-based configuration and authentication requirements.
  • Changed backend entries from URL strings to objects with url fields.
  • Added client_credentials.issuer to examples using the default client-credentials authentication.
  • Applied the corrected examples to deployment documentation, chart values comments, and configuration documentation.
deployment/README.md
deployment/values.yaml
docs/configuration.md
Added regression coverage that discovers and validates TES configuration examples across documentation and chart values.
  • Extracted YAML code blocks containing service_list and the commented chart config example.
  • Merged each example with the base configuration using the application’s deep_merge behavior and validated it with CustomConfig.
  • Verified backend URLs are preserved and required documentation sources are not silently omitted.
tests/test_config_examples.py

Assessment against linked issues

Issue Objective Addressed Explanation
#229 Ensure TES backends are empty by default and warn or refuse to start when none are configured. ❌ This PR changes documentation examples and adds example-validation tests; it does not change the configuration defaults or startup behavior. The PR body says #251 removed the defaults, but that change is not in this PR.
#229 Use generic, valid TES backend examples and replace public TES instances in Compose and tests with a local stub or mock. ❌ The PR updates documentation and chart examples to the object format and adds validation tests for them. It does not change Compose or test backend setup to use a local stub or mock, as the issue requests.
#229 Document the upgrade requirement for deployments that relied on the default backend list. ❌ The PR does not add release notes or an upgrading-page notice telling deployments to configure their own backends.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@read-the-docs-community

read-the-docs-community Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35362652 | 📁 Comparing e702d33 against latest (54f8611)

  🔍 Preview build  

2 files changed
± configuration/index.html
± deployment/index.html

@uniqueg
uniqueg marked this pull request as ready for review October 23, 2026 18:40
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (54f8611) to head (e702d33).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #263   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         1849      1849           
=========================================
  Hits          1849      1849           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tests/test_config_examples.py" line_range="26" />
<code_context>
+    *sorted((ROOT / "docs").glob("*.md")),
+]
+# YAML code blocks of Markdown files
+YAML_BLOCK = re.compile(r"^```yaml\n(.*?)^```", re.DOTALL | re.MULTILINE)
+# Sources that must contribute examples (collection by heuristics must not
+# silently miss them)
</code_context>
<issue_to_address>
**Some TES examples escape validation**

When a Markdown file uses a valid alternate YAML fence such as ` ```yaml title=example ` for a TES example and also has another collected example, `YAML_BLOCK` ignores valid YAML fences with an info string beyond the exact bare `yaml` form, so those TES configurations are never parsed or validated. `test_examples_collected` can still pass when that file has another collected example.

Recognize supported YAML fence info strings when collecting blocks, and assert that every YAML block containing `service_list:` is collected.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: tests/test_config_examples.py:26


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread tests/test_config_examples.py Resolved
Address review: also collect yml blocks and blocks whose fence has
further info (e.g., a title), so no example escapes validation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit db5863f into dev Oct 23, 2026
18 checks passed
@uniqueg
uniqueg deleted the docs/tes-backend-examples branch October 23, 2026 18:44
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.

fix!: no default TES backends

1 participant