tripl 0.3.3__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tripl-0.3.3 → tripl-0.3.4}/Dockerfile +1 -1
- {tripl-0.3.3 → tripl-0.3.4}/PKG-INFO +11 -2
- {tripl-0.3.3 → tripl-0.3.4}/README.md +10 -1
- tripl-0.3.4/examples/checkout/README.md +22 -0
- tripl-0.3.4/examples/checkout/checkout.py +28 -0
- tripl-0.3.4/examples/compatibility/orders.json +13 -0
- {tripl-0.3.3 → tripl-0.3.4}/pyproject.toml +1 -1
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/__init__.py +4 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/branches.py +1 -1
- tripl-0.3.4/src/tripl_cli/api/check_runs.py +48 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/endpoints.py +6 -0
- tripl-0.3.4/src/tripl_cli/api/meta_fields.py +10 -0
- tripl-0.3.4/src/tripl_cli/api/plan_revisions.py +32 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/plan_validation.py +15 -2
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/__init__.py +2 -1
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/baseline.py +52 -20
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/calls.py +42 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/config.py +138 -5
- tripl-0.3.4/src/tripl_cli/check/coverage.py +203 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/gate.py +35 -17
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/inventory.py +393 -83
- tripl-0.3.4/src/tripl_cli/check/lint.py +212 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/listing.py +189 -54
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/model.py +170 -11
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/payloads.py +7 -5
- tripl-0.3.4/src/tripl_cli/check/places.py +407 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/render.py +60 -6
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/reports.py +1 -1
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/scan.py +73 -12
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/scopes.py +254 -62
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/signatures.py +126 -41
- tripl-0.3.4/src/tripl_cli/check/summary.py +296 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/suppress.py +53 -19
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/symbols.py +411 -65
- tripl-0.3.4/src/tripl_cli/check/upload.py +384 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/validate.py +29 -3
- tripl-0.3.4/src/tripl_cli/check/values.py +1647 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/cli.py +91 -34
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/files.py +30 -1
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/__init__.py +21 -0
- tripl-0.3.4/src/tripl_cli/commands/_plan.py +336 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/check.py +537 -59
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/codegen.py +32 -9
- tripl-0.3.4/src/tripl_cli/commands/compatibility.py +127 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/doctor.py +33 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/export.py +14 -5
- tripl-0.3.4/src/tripl_cli/commands/journey_capture.py +89 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/plan.py +90 -6
- tripl-0.3.4/src/tripl_cli/commands/reproduce.py +191 -0
- tripl-0.3.4/src/tripl_cli/compat_sql.py +147 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/config.py +42 -4
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/diagnostics/endpoints.py +2 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/files/compose.yaml +1 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/model.py +19 -13
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/render.py +110 -6
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/report.py +151 -19
- tripl-0.3.4/src/tripl_cli/streams.py +103 -0
- tripl-0.3.4/src/tripl_cli/support_report.py +139 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/conftest.py +58 -1
- tripl-0.3.4/tests/journey_fixture/candidate.json +19 -0
- tripl-0.3.4/tests/journey_fixture/healthy.json +19 -0
- tripl-0.3.4/tests/journey_fixture/suspect.json +17 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_api_requests.py +6 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_check_baseline.py +86 -2
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_check_cmd.py +609 -19
- tripl-0.3.4/tests/test_check_coverage.py +304 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_check_gate.py +34 -6
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_check_gate_cmd.py +123 -0
- tripl-0.3.4/tests/test_check_lint.py +709 -0
- tripl-0.3.4/tests/test_check_list_doc_samples.py +208 -0
- tripl-0.3.4/tests/test_check_list_suppressions.py +289 -0
- tripl-0.3.4/tests/test_check_payload_doc_samples.py +142 -0
- tripl-0.3.4/tests/test_check_plan_branch_fallback.py +408 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_check_reports.py +197 -4
- tripl-0.3.4/tests/test_check_revision.py +138 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_check_scan.py +1781 -83
- tripl-0.3.4/tests/test_check_scan_choices.py +583 -0
- tripl-0.3.4/tests/test_check_summary.py +228 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_check_suppress.py +141 -5
- tripl-0.3.4/tests/test_check_upload.py +727 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_ci_templates.py +326 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_codegen_cmd.py +219 -0
- tripl-0.3.4/tests/test_compat_sql.py +92 -0
- tripl-0.3.4/tests/test_compatibility_cmd.py +66 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_config.py +55 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_contract.py +73 -6
- tripl-0.3.4/tests/test_journey_capture.py +94 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_output_samples.py +52 -6
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_plan_cmd.py +197 -5
- tripl-0.3.4/tests/test_reproduce.py +214 -0
- tripl-0.3.4/tests/test_streams.py +313 -0
- tripl-0.3.4/tests/test_support_report.py +209 -0
- {tripl-0.3.3 → tripl-0.3.4}/uv.lock +70 -70
- tripl-0.3.3/src/tripl_cli/check/values.py +0 -728
- tripl-0.3.3/src/tripl_cli/commands/_plan.py +0 -164
- {tripl-0.3.3 → tripl-0.3.4}/.gitignore +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/LICENSE +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/__init__.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/__main__.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/auth.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/chart_annotations.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/data_sources.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/docs.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/event_types.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/events.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/monitoring.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/plan_export.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/projects.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/request.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/scans.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/search.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/api/variables.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/changes.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/fingerprint.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/lexer.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/presets.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/check/yamlish.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/client.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/__init__.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/calls.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/context.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/context_named.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/context_plan.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/generate.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/languages.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/model.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/naming.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/template.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/named.kotlin.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/named.swift.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/named.ts.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/screen_view.kotlin.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/screen_view.swift.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/screen_view.ts.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/self_describing.kotlin.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/self_describing.swift.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/self_describing.ts.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/structured.kotlin.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/structured.swift.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/structured.ts.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/transport.kotlin.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/transport.swift.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/templates/transport.ts.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/codegen/value_types.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/_check_config.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/_docs_files.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/_resolve.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/_write.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/annotate.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/docs.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/drifts.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/events.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/install.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/scans.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/status.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/upgrade.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/watch.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/commands/whoami.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/diagnostics/__init__.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/diagnostics/checks.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/diagnostics/collect.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/diagnostics/scan_checks.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/errors.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/__init__.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/docker.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/files/rabbitmq.conf +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/files.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/health.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/plan.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/render.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/secrets.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/install/shell.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/py.typed +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/runner.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/watch/__init__.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/watch/collect.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/watch/diff.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/watch/loop.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/watch/model.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/src/tripl_cli/watch/render.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/__init__.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/check_golden/no-marker.codequality.json +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/check_golden/no-marker.junit.xml +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/check_golden/no-marker.sarif.json +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/check.yml +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/check.yml +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/kotlin/AcmeAction.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/kotlin/AcmeAppConstants.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/kotlin/AcmeCategory.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/kotlin/AcmeLabel.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/kotlin/AcmeProperty.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/kotlin/AcmeScreens.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/kotlin/AcmeStructured.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/kotlin/TriplTransport.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/swift/AcmeAppConstants.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/swift/AcmePlanned.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/swift/AcmeScreens.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/swift/AcmeStructured.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/swift/TriplTransport.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/ts/acmeAction.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/ts/acmeAppConstants.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/ts/acmeCategory.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/ts/acmeLabel.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/ts/acmeProperty.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/ts/acmeScreens.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/ts/acmeStructured.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/golden/ts/triplTransport.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/model.json +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/holder.kotlin.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/holder.ts.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/named.kotlin.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/named.swift.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/named.ts.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/planned.swift.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/screen.kotlin.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/screen.swift.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/screen.ts.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/structured.kotlin.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/structured.swift.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/custom/templates/structured.ts.mustache +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/kotlin/AppEvents.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/kotlin/LegacyTracking.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/kotlin/ScreenTracking.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/kotlin/SdTracking.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/kotlin/TriplTransport.kt +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/swift/AppEvents.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/swift/LegacyTracking.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/swift/ScreenTracking.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/swift/SdTracking.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/swift/TriplTransport.swift +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/ts/appEvents.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/ts/legacyTracking.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/ts/screenTracking.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/ts/sdTracking.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/golden/ts/triplTransport.ts +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/codegen/model.json +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_annotate_cmd.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_check_changes.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_check_config_flags.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_checks.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_cli.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_client.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_client_redirects.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_codegen_custom.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_codegen_generate.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_codegen_naming.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_codegen_template.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_compose_env.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_docker_detect.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_docs_audience.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_docs_cmd.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_docs_cover_the_parser.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_doctor.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_drifts_cmd.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_events_cmd.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_install_cmd.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_install_files.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_install_version_recovery.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_runner.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_scans_cmd.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_status.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_upgrade_cmd.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_watch.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_watch_diff.py +0 -0
- {tripl-0.3.3 → tripl-0.3.4}/tests/test_whoami_cmd.py +0 -0
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# own rather than `COPY --from=<image>` because Dependabot bumps FROM lines
|
|
13
13
|
# only. Bump it together with the uv images of the root Dockerfile,
|
|
14
14
|
# backend/Dockerfile and mcp-server/Dockerfile.
|
|
15
|
-
FROM ghcr.io/astral-sh/uv:0.13.
|
|
15
|
+
FROM ghcr.io/astral-sh/uv:0.13.8 AS uv
|
|
16
16
|
|
|
17
17
|
FROM python:3.14-slim-trixie AS build
|
|
18
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: tripl
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Command-line client for tripl: instance diagnostics and live monitoring, tracking-plan reads, code checks and codegen against the plan, team notes, and self-hosted install and upgrade
|
|
5
5
|
Project-URL: Homepage, https://docs.tripl.io/
|
|
6
6
|
Project-URL: Documentation, https://docs.tripl.io/run/cli
|
|
@@ -109,6 +109,7 @@ prints that group's help on stderr and exits 2.
|
|
|
109
109
|
tripl doctor # check the instance and report what is broken
|
|
110
110
|
tripl doctor --json # one JSON document on stdout, human lines on stderr
|
|
111
111
|
tripl doctor --strict # exit 3 on warnings too (never on skipped checks)
|
|
112
|
+
tripl doctor --support-report ./tripl-support.json # privacy-safe file to attach to a support request
|
|
112
113
|
tripl status # projects, events, scans, signals, coverage
|
|
113
114
|
tripl whoami # the account, organization and scope the API key acts as
|
|
114
115
|
tripl watch # follow jobs, signals and delivery failures live
|
|
@@ -126,6 +127,7 @@ tripl plan types --project SLUG # event types, with a field count ea
|
|
|
126
127
|
tripl plan fields <event-type> --project SLUG # one event type's field definitions
|
|
127
128
|
tripl plan properties --project SLUG # properties, and how many events use each
|
|
128
129
|
tripl plan branches --project SLUG # plan branches and how far ahead each is
|
|
130
|
+
tripl plan revisions --project SLUG # stored plan revisions; the id check --revision takes
|
|
129
131
|
tripl plan search <query> --project SLUG # search the whole plan, ids to read next
|
|
130
132
|
tripl annotate "Deployed web 2026.09.25" --project SLUG --url URL # deploy marker on monitoring charts (WRITE)
|
|
131
133
|
tripl check # validate the tracking calls in this checkout against the plan
|
|
@@ -418,7 +420,8 @@ not moved).
|
|
|
418
420
|
| 130 | Interrupted (SIGINT). For `watch` this is the **normal** ending — a run without `--duration` has no other way to stop. |
|
|
419
421
|
|
|
420
422
|
`check` uses 0, 1, 2 and 4: 1 when any call site or event has an error (or,
|
|
421
|
-
with `--strict`, a warning)
|
|
423
|
+
with `--strict`, a warning) or, with `--strict-suppressions`, a
|
|
424
|
+
`tripl-check-ignore` marker is malformed or unused, 2 for a bad check config or payload file, or a
|
|
422
425
|
config that matches no call (unless `--allow-empty`), and 4 for an unavailable
|
|
423
426
|
instance. `codegen` uses them too: 1 for drift under `--check` (or a plan
|
|
424
427
|
without a configured event type), 2 for a bad check config or template, 4 for
|
|
@@ -509,3 +512,9 @@ uv run --group dev mypy src
|
|
|
509
512
|
than from the published release, so a change here is picked up by
|
|
510
513
|
`cd mcp-server && uv sync` without any install step — and both suites test the
|
|
511
514
|
same source. Run **both** after touching `client.py`.
|
|
515
|
+
|
|
516
|
+
Use `tripl reproduce` to compare synthetic app-test captures from healthy,
|
|
517
|
+
suspect and candidate builds for a tracking incident.
|
|
518
|
+
Create each capture with `tripl journey-capture`.
|
|
519
|
+
|
|
520
|
+
Use `tripl compatibility preview` to compile a bounded historical check of an event rename on a plan branch. After review and merge, `tripl compatibility model` emits the reusable ClickHouse SELECT from the main event.
|
|
@@ -81,6 +81,7 @@ prints that group's help on stderr and exits 2.
|
|
|
81
81
|
tripl doctor # check the instance and report what is broken
|
|
82
82
|
tripl doctor --json # one JSON document on stdout, human lines on stderr
|
|
83
83
|
tripl doctor --strict # exit 3 on warnings too (never on skipped checks)
|
|
84
|
+
tripl doctor --support-report ./tripl-support.json # privacy-safe file to attach to a support request
|
|
84
85
|
tripl status # projects, events, scans, signals, coverage
|
|
85
86
|
tripl whoami # the account, organization and scope the API key acts as
|
|
86
87
|
tripl watch # follow jobs, signals and delivery failures live
|
|
@@ -98,6 +99,7 @@ tripl plan types --project SLUG # event types, with a field count ea
|
|
|
98
99
|
tripl plan fields <event-type> --project SLUG # one event type's field definitions
|
|
99
100
|
tripl plan properties --project SLUG # properties, and how many events use each
|
|
100
101
|
tripl plan branches --project SLUG # plan branches and how far ahead each is
|
|
102
|
+
tripl plan revisions --project SLUG # stored plan revisions; the id check --revision takes
|
|
101
103
|
tripl plan search <query> --project SLUG # search the whole plan, ids to read next
|
|
102
104
|
tripl annotate "Deployed web 2026.09.25" --project SLUG --url URL # deploy marker on monitoring charts (WRITE)
|
|
103
105
|
tripl check # validate the tracking calls in this checkout against the plan
|
|
@@ -390,7 +392,8 @@ not moved).
|
|
|
390
392
|
| 130 | Interrupted (SIGINT). For `watch` this is the **normal** ending — a run without `--duration` has no other way to stop. |
|
|
391
393
|
|
|
392
394
|
`check` uses 0, 1, 2 and 4: 1 when any call site or event has an error (or,
|
|
393
|
-
with `--strict`, a warning)
|
|
395
|
+
with `--strict`, a warning) or, with `--strict-suppressions`, a
|
|
396
|
+
`tripl-check-ignore` marker is malformed or unused, 2 for a bad check config or payload file, or a
|
|
394
397
|
config that matches no call (unless `--allow-empty`), and 4 for an unavailable
|
|
395
398
|
instance. `codegen` uses them too: 1 for drift under `--check` (or a plan
|
|
396
399
|
without a configured event type), 2 for a bad check config or template, 4 for
|
|
@@ -481,3 +484,9 @@ uv run --group dev mypy src
|
|
|
481
484
|
than from the published release, so a change here is picked up by
|
|
482
485
|
`cd mcp-server && uv sync` without any install step — and both suites test the
|
|
483
486
|
same source. Run **both** after touching `client.py`.
|
|
487
|
+
|
|
488
|
+
Use `tripl reproduce` to compare synthetic app-test captures from healthy,
|
|
489
|
+
suspect and candidate builds for a tracking incident.
|
|
490
|
+
Create each capture with `tripl journey-capture`.
|
|
491
|
+
|
|
492
|
+
Use `tripl compatibility preview` to compile a bounded historical check of an event rename on a plan branch. After review and merge, `tripl compatibility model` emits the reusable ClickHouse SELECT from the main event.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Reproduce a missing purchase
|
|
2
|
+
|
|
3
|
+
From this directory, using a development install of the Tripl CLI and an empty output directory:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
captures=$(mktemp -d)
|
|
7
|
+
for build in healthy suspect fixed; do
|
|
8
|
+
tripl journey-capture --journey checkout --fixture synthetic-order-v1 \
|
|
9
|
+
--build "$build" --output "$captures/$build.json" --allow-event purchase \
|
|
10
|
+
-- python3 checkout.py "$build" || exit 1
|
|
11
|
+
done
|
|
12
|
+
|
|
13
|
+
tripl reproduce --event purchase --healthy "$captures/healthy.json" \
|
|
14
|
+
--suspect "$captures/suspect.json"
|
|
15
|
+
|
|
16
|
+
tripl reproduce --event purchase --healthy "$captures/healthy.json" \
|
|
17
|
+
--suspect "$captures/suspect.json" --candidate "$captures/fixed.json"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The first comparison exits 3 when it reproduces the regression. The second exits 0 when the candidate restores the expected count.
|
|
21
|
+
|
|
22
|
+
For an application pilot, run the capture step inside each build's CI job with its immutable build identifier. Substitute the team's existing deterministic checkout test for the example. Have the test assert successful checkout and write a JSON array of observed event names to the file named by `TRIPL_JOURNEY_EVENTS`. Only explicitly allowlisted event names enter the capture. The adapter runs the command twice with separate output files and a five-minute timeout per attempt. Use a synthetic account and reset the fixture between attempts. Upload the resulting JSON as a CI artifact for the incident comparison.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Synthetic redirect checkout used by the incident reproduction walkthrough."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def checkout(build: str) -> tuple[str, list[str]]:
|
|
10
|
+
events = ["checkout_started"]
|
|
11
|
+
order = {"state": "pending"}
|
|
12
|
+
# In the suspect revision, returning from the payment app fires the
|
|
13
|
+
# redirect callback but drops the analytics listener during remount.
|
|
14
|
+
listeners = [] if build == "suspect" else [events.append]
|
|
15
|
+
order["state"] = "paid"
|
|
16
|
+
for notify in listeners:
|
|
17
|
+
notify("purchase")
|
|
18
|
+
return order["state"], events
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if __name__ == "__main__":
|
|
22
|
+
build = sys.argv[1]
|
|
23
|
+
if build not in {"healthy", "suspect", "fixed"}:
|
|
24
|
+
raise SystemExit("expected healthy, suspect or fixed")
|
|
25
|
+
state, events = checkout(build)
|
|
26
|
+
if state != "paid":
|
|
27
|
+
raise SystemExit("checkout did not finish")
|
|
28
|
+
Path(os.environ["TRIPL_JOURNEY_EVENTS"]).write_text(json.dumps(events))
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"table": "analytics.events",
|
|
3
|
+
"event_column": "name",
|
|
4
|
+
"platform_column": "platform",
|
|
5
|
+
"build_column": "build",
|
|
6
|
+
"time_column": "ts",
|
|
7
|
+
"dedup_column": "order_id",
|
|
8
|
+
"rules": [
|
|
9
|
+
{"event": "checkout_success", "platform": "ios", "min_build": 1, "max_build": 25},
|
|
10
|
+
{"event": "order_completed", "platform": "ios", "min_build": 25, "max_build": 9999},
|
|
11
|
+
{"event": "checkout_success", "platform": "android", "min_build": 1, "max_build": 9999}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tripl"
|
|
3
3
|
# One version for the service, this CLI and tripl-mcp; bin/release.sh writes it.
|
|
4
|
-
version = "0.3.
|
|
4
|
+
version = "0.3.4"
|
|
5
5
|
description = "Command-line client for tripl: instance diagnostics and live monitoring, tracking-plan reads, code checks and codegen against the plan, team notes, and self-hosted install and upgrade"
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
requires-python = ">=3.12"
|
|
@@ -47,12 +47,14 @@ from tripl_cli.api import (
|
|
|
47
47
|
auth,
|
|
48
48
|
branches,
|
|
49
49
|
chart_annotations,
|
|
50
|
+
check_runs,
|
|
50
51
|
data_sources,
|
|
51
52
|
docs,
|
|
52
53
|
event_types,
|
|
53
54
|
events,
|
|
54
55
|
monitoring,
|
|
55
56
|
plan_export,
|
|
57
|
+
plan_revisions,
|
|
56
58
|
plan_validation,
|
|
57
59
|
projects,
|
|
58
60
|
scans,
|
|
@@ -70,6 +72,7 @@ __all__ = [
|
|
|
70
72
|
"auth",
|
|
71
73
|
"branches",
|
|
72
74
|
"chart_annotations",
|
|
75
|
+
"check_runs",
|
|
73
76
|
"data_sources",
|
|
74
77
|
"docs",
|
|
75
78
|
"event_types",
|
|
@@ -78,6 +81,7 @@ __all__ = [
|
|
|
78
81
|
"page_items",
|
|
79
82
|
"page_total",
|
|
80
83
|
"plan_export",
|
|
84
|
+
"plan_revisions",
|
|
81
85
|
"plan_validation",
|
|
82
86
|
"projects",
|
|
83
87
|
"scans",
|
|
@@ -59,7 +59,7 @@ def get_diff(slug: str, branch_id: str) -> ApiRequest:
|
|
|
59
59
|
"""Answers ``{behind_base, entries, summary}``. No CLI verb reads it yet.
|
|
60
60
|
|
|
61
61
|
``tripl plan`` does not expose it: that payload is not a list, so it does
|
|
62
|
-
not fit the one document shape the
|
|
62
|
+
not fit the one document shape the eight read verbs share, and
|
|
63
63
|
``behind_base`` is too load-bearing to smuggle into an ``items`` array.
|
|
64
64
|
``tripl-mcp``'s ``get_branch_diff`` calls this.
|
|
65
65
|
"""
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Uploading a ``tripl check`` run (``tripl check --upload``).
|
|
2
|
+
|
|
3
|
+
A WRITE, unlike validation: it records the run in tripl. A ``write`` key of a
|
|
4
|
+
project editor may send it, and so may the narrow ``check_upload`` key a CI job
|
|
5
|
+
holds (``tk_c_``), which reads like a ``read`` key and may write nothing else.
|
|
6
|
+
A run on the repository's default branch becomes what "used in code" shows on
|
|
7
|
+
each event; any other run is kept as a summary for the history.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from collections.abc import Mapping
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
from tripl_cli.api.request import ApiRequest
|
|
16
|
+
|
|
17
|
+
UPLOAD = "/projects/{slug}/check-runs"
|
|
18
|
+
|
|
19
|
+
ENDPOINTS: tuple[tuple[str, str], ...] = (("post", UPLOAD),)
|
|
20
|
+
|
|
21
|
+
# The route's own cap on the calls of one run.
|
|
22
|
+
MAX_CALLS = 5000
|
|
23
|
+
|
|
24
|
+
# The route's per-call bounds (``CheckRunCallIn``, ``CheckRunFinding``). The
|
|
25
|
+
# CLI cuts a longer value rather than have one call fail the whole upload.
|
|
26
|
+
PATH_MAX_LENGTH = 1000
|
|
27
|
+
EVENT_TYPE_MAX_LENGTH = 100
|
|
28
|
+
NAME_MAX_LENGTH = 500
|
|
29
|
+
MESSAGE_MAX_LENGTH = 2000
|
|
30
|
+
FIELD_MAX_LENGTH = 255
|
|
31
|
+
CODE_MAX_LENGTH = 100
|
|
32
|
+
MAX_FINDINGS_PER_CALL = 50
|
|
33
|
+
# Of the run itself.
|
|
34
|
+
REPOSITORY_MAX_LENGTH = 255
|
|
35
|
+
REF_MAX_LENGTH = 255
|
|
36
|
+
CHECK_ROOT_MAX_LENGTH = 1000
|
|
37
|
+
URL_MAX_LENGTH = 2000
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def upload(slug: str, run: Mapping[str, Any]) -> ApiRequest:
|
|
41
|
+
"""One run: ``repository``, ``check_root``, ``commit_sha``, ``ref``, ``calls``, ...
|
|
42
|
+
|
|
43
|
+
``run["calls"]`` is sent as given, so it must already be at most ``MAX_CALLS``.
|
|
44
|
+
"""
|
|
45
|
+
calls = run.get("calls") or ()
|
|
46
|
+
if len(calls) > MAX_CALLS:
|
|
47
|
+
raise ValueError(f"at most {MAX_CALLS} calls per check run, got {len(calls)}")
|
|
48
|
+
return ApiRequest("POST", UPLOAD.format(slug=slug), json_body=dict(run))
|
|
@@ -18,12 +18,15 @@ from tripl_cli.api import (
|
|
|
18
18
|
auth,
|
|
19
19
|
branches,
|
|
20
20
|
chart_annotations,
|
|
21
|
+
check_runs,
|
|
21
22
|
data_sources,
|
|
22
23
|
docs,
|
|
23
24
|
event_types,
|
|
24
25
|
events,
|
|
26
|
+
meta_fields,
|
|
25
27
|
monitoring,
|
|
26
28
|
plan_export,
|
|
29
|
+
plan_revisions,
|
|
27
30
|
plan_validation,
|
|
28
31
|
projects,
|
|
29
32
|
scans,
|
|
@@ -35,12 +38,15 @@ SHARED_ENDPOINTS: dict[str, tuple[tuple[str, str], ...]] = {
|
|
|
35
38
|
"auth": auth.ENDPOINTS,
|
|
36
39
|
"branches": branches.ENDPOINTS,
|
|
37
40
|
"chart_annotations": chart_annotations.ENDPOINTS,
|
|
41
|
+
"check_runs": check_runs.ENDPOINTS,
|
|
38
42
|
"data_sources": data_sources.ENDPOINTS,
|
|
39
43
|
"docs": docs.ENDPOINTS,
|
|
40
44
|
"event_types": event_types.ENDPOINTS,
|
|
41
45
|
"events": events.ENDPOINTS,
|
|
46
|
+
"meta_fields": meta_fields.ENDPOINTS,
|
|
42
47
|
"monitoring": monitoring.ENDPOINTS,
|
|
43
48
|
"plan_export": plan_export.ENDPOINTS,
|
|
49
|
+
"plan_revisions": plan_revisions.ENDPOINTS,
|
|
44
50
|
"plan_validation": plan_validation.ENDPOINTS,
|
|
45
51
|
"projects": projects.ENDPOINTS,
|
|
46
52
|
"scans": scans.ENDPOINTS,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Branch-scoped catalog metadata definitions."""
|
|
2
|
+
|
|
3
|
+
from tripl_cli.api.request import ApiRequest
|
|
4
|
+
|
|
5
|
+
LIST = "/projects/{slug}/meta-fields"
|
|
6
|
+
ENDPOINTS = (("get", LIST),)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def list_fields(slug: str, branch: str) -> ApiRequest:
|
|
10
|
+
return ApiRequest("GET", LIST.format(slug=slug), params={"branch": branch})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Plan revisions: the stored copies of a project's whole plan.
|
|
2
|
+
|
|
3
|
+
Only the listing is built here. Taking a revision, reverting to one and reading
|
|
4
|
+
one's full payload stay in the tripl UI, like the branch transitions
|
|
5
|
+
``api/branches.py`` leaves out.
|
|
6
|
+
|
|
7
|
+
The listing covers the whole project and has no ``?branch=``: a revision is a
|
|
8
|
+
fixed copy, not a view of a plan that moves. A row made for a plan branch (its
|
|
9
|
+
merge base, or the merge itself) names that branch in ``branch_id``.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
from tripl_cli.api.request import ApiRequest
|
|
15
|
+
|
|
16
|
+
LIST = "/projects/{slug}/revisions"
|
|
17
|
+
|
|
18
|
+
ENDPOINTS: tuple[tuple[str, str], ...] = (("get", LIST),)
|
|
19
|
+
|
|
20
|
+
# The route's own bounds: `limit` is Query(ge=1, le=200) with a server default
|
|
21
|
+
# of 50. Pinned to the OpenAPI document by the contract test.
|
|
22
|
+
LIMIT_DEFAULT = 50
|
|
23
|
+
LIMIT_MAX = 200
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def list_revisions(slug: str, *, offset: int | None = None, limit: int | None = None) -> ApiRequest:
|
|
27
|
+
"""Paged, newest first: answers ``{items, total}``.
|
|
28
|
+
|
|
29
|
+
Each item is a summary (id, created_at, kind, summary, branch_id and
|
|
30
|
+
entity_counts) without the stored plan itself.
|
|
31
|
+
"""
|
|
32
|
+
return ApiRequest("GET", LIST.format(slug=slug), params={"offset": offset, "limit": limit})
|
|
@@ -5,7 +5,9 @@ included, may call it. It is still a POST because a batch of up to
|
|
|
5
5
|
``MAX_ITEMS`` items does not fit in a query string.
|
|
6
6
|
|
|
7
7
|
``?branch=`` follows the rule every plan read follows (see ``api/branches.py``):
|
|
8
|
-
omitted means the live main plan.
|
|
8
|
+
omitted means the live main plan. ``?revision=`` names a stored plan revision
|
|
9
|
+
to validate against instead (never with ``branch``); the answer's ``plan`` then
|
|
10
|
+
says which revision judged the calls (``answering_plan``).
|
|
9
11
|
"""
|
|
10
12
|
|
|
11
13
|
from __future__ import annotations
|
|
@@ -40,6 +42,7 @@ def validate(
|
|
|
40
42
|
items: Sequence[Mapping[str, Any]],
|
|
41
43
|
*,
|
|
42
44
|
branch: str | None = None,
|
|
45
|
+
revision: str | None = None,
|
|
43
46
|
strict: bool = False,
|
|
44
47
|
) -> ApiRequest:
|
|
45
48
|
"""One batch. ``items`` is sent as given, so it must already be at most ``MAX_ITEMS``.
|
|
@@ -55,7 +58,7 @@ def validate(
|
|
|
55
58
|
return ApiRequest(
|
|
56
59
|
"POST",
|
|
57
60
|
VALIDATE.format(slug=slug),
|
|
58
|
-
params={"branch": branch},
|
|
61
|
+
params={"branch": branch, "revision": revision},
|
|
59
62
|
json_body=body,
|
|
60
63
|
)
|
|
61
64
|
|
|
@@ -67,6 +70,16 @@ def batches[T](items: Sequence[T], size: int = MAX_ITEMS) -> list[Sequence[T]]:
|
|
|
67
70
|
return [items[start : start + size] for start in range(0, len(items), size)]
|
|
68
71
|
|
|
69
72
|
|
|
73
|
+
def answering_plan(payload: Any) -> JsonDict:
|
|
74
|
+
"""The response's ``plan``: ``revision``, ``plan_hash``, ``created_at``; ``{}`` when absent.
|
|
75
|
+
|
|
76
|
+
Absent means an instance older than the ``revision`` parameter, which
|
|
77
|
+
ignored it and judged the calls by the live plan.
|
|
78
|
+
"""
|
|
79
|
+
plan = payload.get("plan") if isinstance(payload, dict) else None
|
|
80
|
+
return plan if isinstance(plan, dict) else {}
|
|
81
|
+
|
|
82
|
+
|
|
70
83
|
def verdicts(payload: Any) -> JsonList:
|
|
71
84
|
"""The per-item verdicts of one response, in the order the route answered them."""
|
|
72
85
|
return page_items(payload)
|
|
@@ -11,7 +11,8 @@ Layers, each importable without the ones after it:
|
|
|
11
11
|
``signatures`` a declaration's parameters, and whether one with no body declares.
|
|
12
12
|
``scopes`` named functions, their parameters and bodies (``--list``'s hints).
|
|
13
13
|
``values`` an argument's tokens -> a known string, a choice, a dict, or dynamic.
|
|
14
|
-
``
|
|
14
|
+
``lint`` the opt-in checks of names and keys that need no plan (``lint:``).
|
|
15
|
+
``scan`` files -> call sites -> validation items (static mode).
|
|
15
16
|
``inventory`` the same scan, kept in full for ``--list``: what was read, and why not.
|
|
16
17
|
``payloads`` captured events -> validation items (payload mode).
|
|
17
18
|
``validate`` batching to ``POST /plan/validate`` and mapping verdicts back.
|
|
@@ -8,9 +8,9 @@ nightly schedule (the plan changes in tripl, not in git) and ``--payloads``
|
|
|
8
8
|
|
|
9
9
|
An entry is a finding without its place: the item it is on, by what the item
|
|
10
10
|
sends (``baseline_key``: ``gate.item_key``, so never its line or its file),
|
|
11
|
-
and the finding's code and
|
|
12
|
-
the most severe of them. A finding is held by the baseline when an entry for
|
|
13
|
-
its item, code and
|
|
11
|
+
and the finding's code, field and rule, with how many such findings there were
|
|
12
|
+
and the most severe of them. A finding is held by the baseline when an entry for
|
|
13
|
+
its item, code, field and rule exists at its severity or a higher one, and the
|
|
14
14
|
entry's count is not used up: three identical calls where the file holds two
|
|
15
15
|
leave one new (a copy pasted anywhere), and a warning that became an error is
|
|
16
16
|
new (an escalation). Which copy is the new one is decided as the gate decides
|
|
@@ -19,6 +19,15 @@ first, so a pasted copy is the one that fails. A finding a marker suppresses
|
|
|
19
19
|
takes up nothing (the marker wins), and ``no_verdict`` is never held: nothing
|
|
20
20
|
was decided about the call.
|
|
21
21
|
|
|
22
|
+
The rule is what tells one violation of a workspace policy from another: they
|
|
23
|
+
all share the code ``policy_violation``. An entry written for one rule does
|
|
24
|
+
not hold a finding of another, so a call baselined for its name still fails
|
|
25
|
+
when it starts breaking a second rule, and waiving the first rule with a
|
|
26
|
+
marker does not hand its entry to the second. An entry with no rule is what a
|
|
27
|
+
finding without one writes, and what every file written before the rule was
|
|
28
|
+
recorded holds; it stands for a finding of any rule that has no entry of its
|
|
29
|
+
own, so those files keep working as they did.
|
|
30
|
+
|
|
22
31
|
The file is JSON, written so that it diffs cleanly in review: no timestamp,
|
|
23
32
|
entries sorted, one key per line, each entry with a short ``example`` (the
|
|
24
33
|
item and one place it was at when written) for a reader. It names the
|
|
@@ -32,7 +41,7 @@ worst still seen); it never adds anything.
|
|
|
32
41
|
|
|
33
42
|
Captured events (``--payloads``) are matched by presence, not by count: how
|
|
34
43
|
many times a test run fired an event is runtime frequency, not copies of a
|
|
35
|
-
call in the code. An entry holds every finding of its key, code and
|
|
44
|
+
call in the code. An entry holds every finding of its key, code, field and rule;
|
|
36
45
|
its count is what was seen when it was written, for a reader, and a prune
|
|
37
46
|
only drops an entry this run did not see at all.
|
|
38
47
|
"""
|
|
@@ -71,12 +80,19 @@ _RANK = {SEVERITY_ERROR: 2, SEVERITY_WARNING: 1, SEVERITY_INFO: 0}
|
|
|
71
80
|
_SEVERITIES = tuple(_RANK)
|
|
72
81
|
|
|
73
82
|
|
|
83
|
+
# What an entry is of: the item's key, and the finding's code, field and rule.
|
|
84
|
+
Group = tuple[str, str, str | None, str | None]
|
|
85
|
+
|
|
86
|
+
|
|
74
87
|
@dataclass(frozen=True)
|
|
75
88
|
class Entry:
|
|
76
89
|
"""One line of the baseline: ``count`` findings of ``code`` on ``field`` at items like ``key``.
|
|
77
90
|
|
|
78
91
|
``key`` is ``baseline_key``'s canonical JSON; ``severity`` the most
|
|
79
92
|
severe of the findings; ``example`` what a reader is shown, never compared.
|
|
93
|
+
``rule`` is the policy rule the findings broke; None for findings without
|
|
94
|
+
one, and then the entry holds a finding of any rule that has no entry of
|
|
95
|
+
its own (a file written before the rule was recorded).
|
|
80
96
|
"""
|
|
81
97
|
|
|
82
98
|
key: str
|
|
@@ -85,10 +101,11 @@ class Entry:
|
|
|
85
101
|
severity: str
|
|
86
102
|
count: int
|
|
87
103
|
example: str = ""
|
|
104
|
+
rule: str | None = None
|
|
88
105
|
|
|
89
106
|
@property
|
|
90
|
-
def group(self) ->
|
|
91
|
-
return (self.key, self.code, self.field)
|
|
107
|
+
def group(self) -> Group:
|
|
108
|
+
return (self.key, self.code, self.field, self.rule)
|
|
92
109
|
|
|
93
110
|
|
|
94
111
|
@dataclass(frozen=True)
|
|
@@ -203,12 +220,12 @@ def load(path: str, *, project: str, mode: str) -> Baseline:
|
|
|
203
220
|
if not isinstance(raw, list):
|
|
204
221
|
raise TriplConfigError(f"--baseline: {path}: entries must be a list.")
|
|
205
222
|
entries = [_entry(value, path, number) for number, value in enumerate(raw, start=1)]
|
|
206
|
-
seen: set[
|
|
223
|
+
seen: set[Group] = set()
|
|
207
224
|
for number, entry in enumerate(entries, start=1):
|
|
208
225
|
if entry.group in seen:
|
|
209
226
|
raise TriplConfigError(
|
|
210
|
-
f"--baseline: {path} entry {number} repeats an earlier entry's key, code
|
|
211
|
-
f"field; merge the two counts, or {rewrite}."
|
|
227
|
+
f"--baseline: {path} entry {number} repeats an earlier entry's key, code, "
|
|
228
|
+
f"field and rule; merge the two counts, or {rewrite}."
|
|
212
229
|
)
|
|
213
230
|
seen.add(entry.group)
|
|
214
231
|
return Baseline(path, tuple(entries))
|
|
@@ -219,6 +236,7 @@ def _entry(value: Any, path: str, number: int) -> Entry:
|
|
|
219
236
|
if not isinstance(value, dict):
|
|
220
237
|
raise TriplConfigError(f"{where} is not a JSON object.")
|
|
221
238
|
key, code, field = value.get("key"), value.get("code"), value.get("field")
|
|
239
|
+
rule = value.get("rule")
|
|
222
240
|
severity, count, example = value.get("severity"), value.get("count"), value.get("example", "")
|
|
223
241
|
if not _well_formed(key):
|
|
224
242
|
raise TriplConfigError(f"{where}: key must be the list tripl wrote.")
|
|
@@ -226,6 +244,8 @@ def _entry(value: Any, path: str, number: int) -> Entry:
|
|
|
226
244
|
raise TriplConfigError(f"{where}: code must be a finding code.")
|
|
227
245
|
if field is not None and not isinstance(field, str):
|
|
228
246
|
raise TriplConfigError(f"{where}: field must be a string or null.")
|
|
247
|
+
if rule is not None and (not isinstance(rule, str) or not rule):
|
|
248
|
+
raise TriplConfigError(f"{where}: rule must be a rule's name, or left out.")
|
|
229
249
|
if severity not in _SEVERITIES:
|
|
230
250
|
raise TriplConfigError(f"{where}: severity must be one of {', '.join(_SEVERITIES)}.")
|
|
231
251
|
if isinstance(count, bool) or not isinstance(count, int) or count < 1:
|
|
@@ -234,7 +254,7 @@ def _entry(value: Any, path: str, number: int) -> Entry:
|
|
|
234
254
|
raise TriplConfigError(f"{where}: example must be a string.")
|
|
235
255
|
# The key as item_key prints it, so the two compare as strings.
|
|
236
256
|
canonical = json.dumps(key, sort_keys=True, ensure_ascii=False, default=str)
|
|
237
|
-
return Entry(canonical, code, field, str(severity), count, example)
|
|
257
|
+
return Entry(canonical, code, field, str(severity), count, example, rule)
|
|
238
258
|
|
|
239
259
|
|
|
240
260
|
_WIRE = frozenset({"event_type", "name", "fields", "properties", "complete"})
|
|
@@ -278,8 +298,9 @@ def match(
|
|
|
278
298
|
) -> Matching:
|
|
279
299
|
"""``results`` with ``baselined`` on every finding, as copies, and what each entry held.
|
|
280
300
|
|
|
281
|
-
Each entry holds up to ``count`` findings of its key, code
|
|
282
|
-
its severity or below
|
|
301
|
+
Each entry holds up to ``count`` findings of its key, code, field and
|
|
302
|
+
rule at its severity or below; a finding whose rule has no entry falls to
|
|
303
|
+
the entry with no rule, if there is one. When there are more, the ones the change did not
|
|
283
304
|
bring in (under a gate) go first, then the more severe, then in run
|
|
284
305
|
order; the rest are new. With ``presence`` (captured events) the count is
|
|
285
306
|
not enforced: an entry holds every such finding.
|
|
@@ -292,7 +313,11 @@ def match(
|
|
|
292
313
|
if not _counted(finding):
|
|
293
314
|
continue
|
|
294
315
|
key = key if key is not None else baseline_key(result.item)
|
|
295
|
-
entry = index.get((key, finding.code, finding.field))
|
|
316
|
+
entry = index.get((key, finding.code, finding.field, finding.rule))
|
|
317
|
+
if entry is None and finding.rule is not None:
|
|
318
|
+
# A file written before the rule was recorded: its entry
|
|
319
|
+
# stands for the code on this field whichever rule raised it.
|
|
320
|
+
entry = index.get((key, finding.code, finding.field, None))
|
|
296
321
|
if entry is not None and _rank(finding.severity) <= _rank(entries[entry].severity):
|
|
297
322
|
found[entry].append((at, position))
|
|
298
323
|
held: set[tuple[int, int]] = set()
|
|
@@ -331,16 +356,16 @@ def collect(report: CheckReport) -> tuple[Entry, ...]:
|
|
|
331
356
|
no marker suppresses, ``no_verdict`` excepted. Each entry's example is its
|
|
332
357
|
first place in the repository, in path and line order.
|
|
333
358
|
"""
|
|
334
|
-
counts: dict[
|
|
335
|
-
worst: dict[
|
|
336
|
-
first: dict[
|
|
359
|
+
counts: dict[Group, int] = defaultdict(int)
|
|
360
|
+
worst: dict[Group, str] = {}
|
|
361
|
+
first: dict[Group, tuple[tuple[str, int, int], str]] = {}
|
|
337
362
|
for result in report.results:
|
|
338
363
|
key: str | None = None
|
|
339
364
|
for finding in result.findings:
|
|
340
365
|
if not (_counted(finding) and severe(finding, report.strict)):
|
|
341
366
|
continue
|
|
342
367
|
key = key if key is not None else baseline_key(result.item)
|
|
343
|
-
group = (key, finding.code, finding.field)
|
|
368
|
+
group = (key, finding.code, finding.field, finding.rule)
|
|
344
369
|
counts[group] += 1
|
|
345
370
|
if group not in worst or _rank(finding.severity) > _rank(worst[group]):
|
|
346
371
|
worst[group] = finding.severity
|
|
@@ -348,7 +373,11 @@ def collect(report: CheckReport) -> tuple[Entry, ...]:
|
|
|
348
373
|
place = (report.repo_path(origin), origin.line, origin.column or 0)
|
|
349
374
|
if group not in first or place < first[group][0]:
|
|
350
375
|
first[group] = (place, _example(result.item, place[0]))
|
|
351
|
-
entries = (
|
|
376
|
+
entries = (
|
|
377
|
+
Entry(key, code, field, worst[group], counts[group], first[group][1], rule)
|
|
378
|
+
for group in counts
|
|
379
|
+
for key, code, field, rule in (group,)
|
|
380
|
+
)
|
|
352
381
|
return tuple(sorted(entries, key=entry_order))
|
|
353
382
|
|
|
354
383
|
|
|
@@ -364,8 +393,8 @@ def _example(item: CheckItem, path: str) -> str:
|
|
|
364
393
|
return f"{item.event_type or '-'} {label} at {where or f'{path}:{origin.line}'}"
|
|
365
394
|
|
|
366
395
|
|
|
367
|
-
def entry_order(entry: Entry) -> tuple[str, str, str, str]:
|
|
368
|
-
return (entry.key, entry.code, entry.field or "", entry.severity)
|
|
396
|
+
def entry_order(entry: Entry) -> tuple[str, str, str, str, str]:
|
|
397
|
+
return (entry.key, entry.code, entry.field or "", entry.rule or "", entry.severity)
|
|
369
398
|
|
|
370
399
|
|
|
371
400
|
def pruned(entries: Sequence[Entry], matching: Matching) -> tuple[Entry, ...]:
|
|
@@ -411,6 +440,9 @@ def render_file(entries: Sequence[Entry], *, project: str, mode: str) -> str:
|
|
|
411
440
|
values = [
|
|
412
441
|
("code", _text(entry.code)),
|
|
413
442
|
("field", _text(entry.field)),
|
|
443
|
+
# Only where there is one, so a file with no policy finding
|
|
444
|
+
# is the same bytes as before the rule was recorded.
|
|
445
|
+
*([("rule", _text(entry.rule))] if entry.rule is not None else []),
|
|
414
446
|
("severity", _text(entry.severity)),
|
|
415
447
|
("count", json.dumps(entry.count)),
|
|
416
448
|
("example", _text(entry.example)),
|
|
@@ -22,6 +22,21 @@ from dataclasses import dataclass, field
|
|
|
22
22
|
|
|
23
23
|
from tripl_cli.check.lexer import IDENT, PUNCT, Token
|
|
24
24
|
|
|
25
|
+
# Reserved words that read as `name(` but open a statement or an expression:
|
|
26
|
+
# `if (a) track(1)` has one call, not two. Only words no language here lets
|
|
27
|
+
# a function take, so `of(1, 2)` (RxJS) or `with(a)` stay calls, and only
|
|
28
|
+
# when no `.` precedes them: `.for(a)` is a Swift implicit member.
|
|
29
|
+
_KEYWORD_CALLEES: dict[str, frozenset[str]] = {
|
|
30
|
+
language: frozenset({"if", "while", "for", "switch", "catch", "return", "throw"} | extra)
|
|
31
|
+
for language, extra in {
|
|
32
|
+
"ts": {"typeof"},
|
|
33
|
+
"kotlin": {"when"},
|
|
34
|
+
"swift": {"guard"},
|
|
35
|
+
"java": {"synchronized"},
|
|
36
|
+
"objc": {"synchronized"},
|
|
37
|
+
}.items()
|
|
38
|
+
}
|
|
39
|
+
|
|
25
40
|
# An identifier directly before a callee means a declaration (`func log(`,
|
|
26
41
|
# `void log(`, `fun log(`), except for these, which precede EXPRESSIONS.
|
|
27
42
|
_EXPRESSION_KEYWORDS = frozenset(
|
|
@@ -125,6 +140,29 @@ def matching(tokens: list[Token], open_index: int) -> int:
|
|
|
125
140
|
return len(tokens)
|
|
126
141
|
|
|
127
142
|
|
|
143
|
+
def closers(tokens: list[Token]) -> list[int]:
|
|
144
|
+
"""Per token index: what ``matching`` returns for the bracket that opens there.
|
|
145
|
+
|
|
146
|
+
One pass over ``tokens`` instead of one scan per bracket, for a reader that
|
|
147
|
+
asks about many nested brackets: asking ``matching`` at every level of
|
|
148
|
+
``f(f(f(…)))`` reads the rest of the nest again each time. As ``matching``
|
|
149
|
+
does, it counts brackets without checking their kind, so a mismatched pair
|
|
150
|
+
(``( ]``) still closes, a closer with nothing open is passed over, and a
|
|
151
|
+
bracket that never closes gets ``len(tokens)``. The value at a token that
|
|
152
|
+
opens nothing is ``len(tokens)`` too, and means nothing.
|
|
153
|
+
"""
|
|
154
|
+
table = [len(tokens)] * len(tokens)
|
|
155
|
+
open_at: list[int] = []
|
|
156
|
+
for index, token in enumerate(tokens):
|
|
157
|
+
if token.kind != PUNCT:
|
|
158
|
+
continue
|
|
159
|
+
if token.text in _OPENERS:
|
|
160
|
+
open_at.append(index)
|
|
161
|
+
elif token.text in _CLOSERS and open_at:
|
|
162
|
+
table[open_at.pop()] = index
|
|
163
|
+
return table
|
|
164
|
+
|
|
165
|
+
|
|
128
166
|
def _matching_back(tokens: list[Token], close_index: int) -> int:
|
|
129
167
|
depth = 0
|
|
130
168
|
for index in range(close_index, -1, -1):
|
|
@@ -299,6 +337,10 @@ def find_calls(tokens: list[Token], language: str, source: str) -> list[Call]:
|
|
|
299
337
|
if found is None:
|
|
300
338
|
continue
|
|
301
339
|
callee, first = found
|
|
340
|
+
if callee in _KEYWORD_CALLEES.get(language, frozenset()) and not (
|
|
341
|
+
index > 0 and tokens[index - 1].is_punct(".")
|
|
342
|
+
):
|
|
343
|
+
continue
|
|
302
344
|
close = matching(tokens, index + 1)
|
|
303
345
|
if language in ("ts", "java", "objc") and close + 1 < len(tokens):
|
|
304
346
|
# `name(params) {` / `name(params): Type {` is a method DEFINITION in
|