Skip to content

feat(pages): community conformance homepage for all SDK conformance - #556

Closed
arkavo-com wants to merge 4 commits into
opentdf:mainfrom
arkavo-org:community-xtest-stage2
Closed

feat(pages): community conformance homepage for all SDK conformance#556
arkavo-com wants to merge 4 commits into
opentdf:mainfrom
arkavo-org:community-xtest-stage2

Conversation

@arkavo-com

@arkavo-com arkavo-com commented Jul 12, 2026

Copy link
Copy Markdown

Summary

Rebuilds the GitHub Pages community conformance report as a homepage covering all community SDKs (python, rust, swift) plus the go reference peer — previously only the python artifact was consumed and rendered as a bare two-table page.

  • Site generator (xtest/reporting/generate_site.py): per-SDK scorecards, an encrypt×decrypt interop matrix built from junit test ids (stage-2 community×community pairs appear automatically), a capability matrix listing every SDK, provenance strip (source run, platform ref, go peer, timestamp), and an enriched machine-readable summary.json. Self-contained HTML, light/dark, status glyphs never rely on color alone.
  • Capability snapshots (xtest/reporting/export_supports.py): extracted from the workflow heredoc, parameterized, and now exported for python, rust, swift, and go (tagged reference).
  • community-pages.yml: downloads all community-*stage* artifacts from the source run (via download-artifact with run-id), passes run provenance to the generator, pins the Pages actions by SHA, adds job timeouts, and still deploys on failed runs so the page shows red instead of going stale.
  • community-xtest.yml: adds set -o pipefail to the three piped pytest steps. pytest | tee was swallowing pytest's exit code — run 29210974140 reported green while python stage-1 recorded 3 failed, 0 passed. Note: with the current python failures, the gate will legitimately go red until those are addressed.

Verification

  • Generator run against the real artifacts of run 29210974140; page inspected in light and dark modes.
  • ruff check, ruff format --check, pyright: clean.
  • actionlint on both workflows: clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dvm7uKaNssz7ztu3nAmf7u

Summary by CodeRabbit

  • New Features
    • Added conformance testing for community Python, Rust, and Swift SDKs, including cross-SDK interoperability checks.
    • Added generated GitHub Pages dashboards showing SDK capabilities, interoperability results, and test metrics.
    • Added native macOS platform startup support without Docker or Colima.
  • Bug Fixes
    • Improved compatibility for container format names while preserving legacy aliases.
    • Improved dependency review behavior for forked contributions.
  • Documentation
    • Added community conformance guidance, format terminology, setup instructions, and workflow documentation.

arkavo-com and others added 4 commits July 12, 2026 18:31
…#2)

Community Stage-1: python, rust, and swift ↔ go@latest (Base TDF), floating release pins, native macOS platform for OpenTDFKit, and reporting/Pages.

Verified green Community X-Test (python + rust@0.14.0 + swift@4.0.0).
With python, rust (0.14.0), and swift (4.0.0) all Stage-1 kas-ready,
enable community×community encrypt/decrypt:

- stage2-python-rust (ubuntu): python ↔ rust
- stage2-swift-peers (macos): python ↔ rust ↔ swift
- workflow_dispatch stage=all|1|2 filter
- Capstone requires both stages (skipped allowed when filtered)
- Docs: Stage-2 acceptance + local recipes
OpenTDFKit Package.swift requires swift-tools-version 6.2. macos-latest
runners sometimes ship 6.1, which fails stage2 builds while stage1 can
pass on a different host. Match OpenTDFKit CI (setup-xcode latest-stable).
The Pages site previously consumed only the python artifact and rendered a
bare two-table page. Rebuild it as a proper conformance homepage:

- generate_site.py: aggregate every community artifact into per-SDK
  scorecards, an encrypt×decrypt interop matrix parsed from junit test ids,
  and a capability matrix listing all SDKs (python/rust/swift/go), with
  provenance (source run, platform ref, go peer) and an enriched
  summary.json. Self-contained HTML, light/dark, defusedxml for parsing.
- export_supports.py: capability snapshot extracted from the YAML heredoc
  and parameterized; now exported for python, rust, swift, and the go
  reference peer so every column has data.
- community-pages.yml: download all community-*stage* artifacts from the
  source run, pass run provenance, pin Pages actions by SHA, add timeouts.
- community-xtest.yml: set -o pipefail on the three piped pytest steps —
  `pytest | tee` was swallowing failures (latest run reported green with
  3 failing python tests).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvm7uKaNssz7ztu3nAmf7u
@arkavo-com
arkavo-com requested review from a team as code owners July 12, 2026 23:31
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2d3f94a-54da-4d9b-8784-0d15de6d8f80

📥 Commits

Reviewing files that changed from the base of the PR and between 58fd341 and 5121fc8.

⛔ Files ignored due to path filters (1)
  • xtest/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (37)
  • .github/actions/start-up-with-containers-macos/action.yml
  • .github/workflows/community-pages.yml
  • .github/workflows/community-xtest.yml
  • .github/workflows/dependency-review.yaml
  • .gitignore
  • README.md
  • docs/FORMATS.md
  • docs/community-conformance.md
  • docs/community-xtest-design.md
  • index.html
  • otdf-sdk-mgr/src/otdf_sdk_mgr/config.py
  • otdf-sdk-mgr/src/otdf_sdk_mgr/schema.py
  • otdf-sdk-mgr/tests/test_community_config.py
  • otdf-sdk-mgr/tests/test_schema.py
  • summary.json
  • xtest/AGENTS.md
  • xtest/conftest.py
  • xtest/fixtures/encryption.py
  • xtest/pyproject.toml
  • xtest/reporting/__init__.py
  • xtest/reporting/export_supports.py
  • xtest/reporting/generate_site.py
  • xtest/sdk/Makefile
  • xtest/sdk/python/Makefile
  • xtest/sdk/python/cli.sh
  • xtest/sdk/rust/Makefile
  • xtest/sdk/rust/cli.sh
  • xtest/sdk/swift/Makefile
  • xtest/sdk/swift/cli.sh
  • xtest/tdfs.py
  • xtest/test_abac.py
  • xtest/test_audit_logs_integration.py
  • xtest/test_dpop.py
  • xtest/test_legacy.py
  • xtest/test_policytypes.py
  • xtest/test_pqc.py
  • xtest/test_tdfs.py

📝 Walkthrough

Walkthrough

This PR adds community SDK conformance workflows for Python, Rust, and Swift, native macOS platform startup, capability/reporting Pages, SDK CLI packaging, canonical tdf container naming, and corresponding harness, documentation, and test updates.

Changes

Community conformance infrastructure

Layer / File(s) Summary
Native macOS platform bootstrap
.github/actions/start-up-with-containers-macos/action.yml
Adds validated inputs, native PostgreSQL and Keycloak setup, certificate generation, platform configuration, server startup, logs, and IPv4 test environment patching.
Community workflow execution
.github/workflows/community-xtest.yml
Adds reference resolution, Stage-1 SDK jobs, Stage-2 interoperability jobs, capability probes, artifact uploads, and result enforcement.
Pages publication
.github/workflows/community-pages.yml, index.html, summary.json
Aggregates community artifacts into HTML and JSON summaries and deploys the generated site to Pages.
Reporting pipeline
xtest/reporting/*
Adds capability snapshots, JUnit aggregation, interoperability matrices, capability matrices, and static site generation.

Harness and SDK integration

Layer / File(s) Summary
SDK registration and profile schema
otdf-sdk-mgr/src/otdf_sdk_mgr/*, otdf-sdk-mgr/tests/*
Registers community SDK repositories and directories, preserves official SDK defaults, and normalizes legacy container aliases to canonical profiles.
Harness profile model
xtest/tdfs.py, xtest/conftest.py, xtest/fixtures/encryption.py, xtest/pyproject.toml
Adds community SDK types, canonical tdf profiles, alias handling, Stage-1 markers, official SDK defaults, and dual KAS allowlist variables.
Community CLI packaging
xtest/sdk/*
Builds and wraps Python, Rust, and Swift SDK CLIs with supports probing and environment forwarding.
Test migration
xtest/test_*.py
Switches existing test flows and assertions from ztdf* names to tdf* names and marks the basic roundtrip as Stage-1.

Documentation and repository configuration

Layer / File(s) Summary
Conformance documentation
README.md, docs/*, xtest/AGENTS.md
Documents community stages, format terminology, workflow operation, local commands, ownership, and canonical container profiles.
Repository support configuration
.gitignore, .github/workflows/dependency-review.yaml
Ignores SDK checkout/build outputs and skips dependency review for forked repositories while recording the reason.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: pflynn-virtru, elizabethhealy, jakedoublev, dmihalcik-virtru

Poem

I’m a rabbit with tests in my paws,
New SDKs hop through conformance laws.
TDF names bloom, reports take flight,
macOS starts the platform right.
Pages shine beneath the moon—
Merge this burrow’s changes soon!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch community-xtest-stage2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@arkavo-com

Copy link
Copy Markdown
Author

Opened against the wrong base repo (this is arkavo-org fork work) — apologies for the noise. Re-filed on arkavo-org/opentdf-tests.

@arkavo-com arkavo-com closed this Jul 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a community SDK conformance tier to the OpenTDF cross-client integration test suite (xtest), adding support for Python, Rust, and Swift community SDKs. It includes new documentation, a native macOS startup action, reporting scripts to generate a conformance dashboard, and updates to use canonical container profiles (tdf and tdf-ecwrap) instead of legacy aliases. The reviewer identified several critical issues: a Python 3 syntax error and unhandled exception risks in the site generation script, a potential JSON generation bug in the Python CLI wrapper, and a Cross-Site Scripting (XSS) vulnerability in the dashboard's HTML template.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +125 to +131
try:
snap = json.loads(supports.read_text())
except json.JSONDecodeError, OSError:
continue
sdk = snap.get("sdk")
if isinstance(sdk, str) and sdk:
report.snapshots[sdk] = snap

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.

critical

In Python 3, catching multiple exceptions using a comma (except json.JSONDecodeError, OSError:) is a SyntaxError. It must be written as a tuple: except (json.JSONDecodeError, OSError):.

Additionally, json.loads can return non-dictionary types (like lists or strings). If snap is not a dictionary, calling snap.get("sdk") will raise an AttributeError and crash the script. This suggestion fixes both issues by using a tuple for the exceptions and defensively checking if snap is a dictionary.

Suggested change
try:
snap = json.loads(supports.read_text())
except json.JSONDecodeError, OSError:
continue
sdk = snap.get("sdk")
if isinstance(sdk, str) and sdk:
report.snapshots[sdk] = snap
try:
snap = json.loads(supports.read_text())
if isinstance(snap, dict):
sdk = snap.get("sdk")
if isinstance(sdk, str) and sdk:
report.snapshots[sdk] = snap
except (json.JSONDecodeError, OSError):
continue

Comment on lines +106 to +109
try:
tree = _safe_xml_parse(junit)
except ET.ParseError:
continue

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.

medium

_safe_xml_parse (from defusedxml) can raise security-related exceptions such as defusedxml.EntitiesForbidden or defusedxml.ExternalReferenceForbidden when encountering forbidden XML structures. These exceptions do not inherit from xml.etree.ElementTree.ParseError, so they will not be caught here, causing the script to crash. Catching Exception ensures the generator safely skips any malformed or malicious XML files.

        try:
            tree = _safe_xml_parse(junit)
        except Exception:
            continue

Comment thread xtest/sdk/python/cli.sh
Comment on lines +111 to +117
if [[ -n "${CLIENTID:-}" && -n "${CLIENTSECRET:-}" ]]; then
_creds_file=$(mktemp)
# shellcheck disable=SC2064
trap 'rm -f "${_creds_file:-}"' EXIT
printf '{"clientId":"%s","clientSecret":"%s"}\n' "$CLIENTID" "$CLIENTSECRET" >"$_creds_file"
parent_args+=(--with-client-creds-file "$_creds_file")
fi

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.

medium

Constructing JSON using printf with direct string substitution can produce invalid JSON or corrupted values if CLIENTID or CLIENTSECRET contains special characters (such as " or \). Since jq is guaranteed to be available in the environment, use it to safely construct the JSON credentials file.

Suggested change
if [[ -n "${CLIENTID:-}" && -n "${CLIENTSECRET:-}" ]]; then
_creds_file=$(mktemp)
# shellcheck disable=SC2064
trap 'rm -f "${_creds_file:-}"' EXIT
printf '{"clientId":"%s","clientSecret":"%s"}\n' "$CLIENTID" "$CLIENTSECRET" >"$_creds_file"
parent_args+=(--with-client-creds-file "$_creds_file")
fi
if [[ -n "${CLIENTID:-}" && -n "${CLIENTSECRET:-}" ]]; then
_creds_file=$(mktemp)
# shellcheck disable=SC2064
trap 'rm -f "${_creds_file:-}"' EXIT
jq -n --arg id "$CLIENTID" --arg secret "$CLIENTSECRET" '{"clientId": $id, "clientSecret": $secret}' >"$_creds_file"
parent_args+=(--with-client-creds-file "$_creds_file")
fi

Comment thread index.html
Comment on lines +208 to +212
function cell(v) {
if (v === "supported") return '<span class="pill ok">supported</span>';
if (v === "unsupported") return '<span class="pill fail">unsupported</span>';
return '<span class="pill na">' + (v || "—") + '</span>';
}

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.

security-medium medium

Directly concatenating v into the HTML string can lead to Cross-Site Scripting (XSS) or broken page layouts if summary.json contains unexpected characters or is manipulated. Escaping the HTML characters in v ensures the page remains secure and robust.

Suggested change
function cell(v) {
if (v === "supported") return '<span class="pill ok">supported</span>';
if (v === "unsupported") return '<span class="pill fail">unsupported</span>';
return '<span class="pill na">' + (v || "—") + '</span>';
}
function cell(v) {
if (v === "supported") return '<span class="pill ok">supported</span>';
if (v === "unsupported") return '<span class="pill fail">unsupported</span>';
const safe = String(v || "—").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
return '<span class="pill na">' + safe + '</span>';
}

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.

1 participant