Replace Python SBDL converters with inline # @sbdl declarations using SBDL's built-in gathering#1171
Conversation
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. No release type found in pull request title "Replace Python SBDL converters with inline Available types:
|
❌MegaLinter analysis: Error
Detailed Issues❌ GHERKIN / gherkin-lint - 6 errors
|
…tract-sbdl.sh Co-authored-by: rjaegers <45816308+rjaegers@users.noreply.github.com>
#!sbdl declarations and a shell extraction script
|
Copilot please use sbdl built-in functionality to gather the design materials instead of the bash script. |
…ript Co-authored-by: rjaegers <45816308+rjaegers@users.noreply.github.com>
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
Done in be330f9. SBDL has a built-in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
#!sbdl declarations and a shell extraction script# @sbdl declarations using SBDL's built-in gathering
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
|
Copilot can you rebase on the target branch and solve the conflicts? |
I'm unable to perform a rebase — the sandbox only has a shallow clone of this branch, and |




~580 lines of Python scripts were generating SBDL by parsing Gherkin and BATS files externally. This moves SBDL declarations inline — next to the elements they describe — and uses SBDL's built-in
@sbdlprefix support to gather them directly, with no custom extraction script needed.Inline
# @sbdlin Gherkin feature filesEach
Feature,Rule, andScenariointest/cpp/features/*.featurenow carries a# @sbdlcomment expressing the element type, its parent relation, and description. The#keeps the line a valid Gherkin comment; SBDL recognizes the@sbdlprefix natively and extracts the declaration:Inline
# @sbdlin BATS test filesEach
@testblock intest/cpp/,test/rust/, andtest/base/gets a# @sbdlline below the existing# bats test_tags=annotation. Flavor-prefixed identifiers (cpp-,rust-,base-) avoid collisions:Flavor files
docs/support/cpp-flavor.sbdlanddocs/support/rust-flavor.sbdlprovide the per-flavordocument-flavordefinition element used by the document templates.Workflow
.github/workflows/wc-document-generation.ymlupdated to callsbdldirectly with the feature and BATS files as inputs — no intermediary extraction step or output file needed.gherkin-officialandpythondependencies removed.Deleted files
docs/support/gherkin_mapping_config.pydocs/support/gherkin_sbdl_converter.pydocs/support/bats_sbdl_converter.pydocs/support/generate-sbdl.pyOriginal prompt
Context
PR #1166 (branch
docs/generate-test-spec-and-traceability) currently uses ~580+ lines of custom Python scripts to convert Gherkin.featurefiles and BATS.batstest files into SBDL. This involves:docs/support/gherkin_mapping_config.py(80 lines) — mapping configsdocs/support/gherkin_sbdl_converter.py(204 lines) — Gherkin parser/converterdocs/support/bats_sbdl_converter.py(144 lines) — BATS parser/converterdocs/support/generate-sbdl.py(160 lines) — unified orchestratordocs/support/gherkin-to-sbdl.py(39 lines) — standalone Gherkin converterSBDL's strength is keeping definitions close to the code (see https://sbdl.dev). The goal is to embed SBDL declarations inline in the source files (
.featureand.bats) and replace the Python conversion scripts with a simple extraction mechanism.Requirements
1. Add inline SBDL to Gherkin
.featurefilesFor each Feature, Rule, and Scenario that currently gets converted to SBDL, add an inline
#!sbdlcomment directly in the.featurefile, right next to the element it describes.Pattern for Features (mapped to
aspectorrequirementdepending on config):For the
test-specificationconfig: Features → aspects, Rules → requirements, Scenarios → tests.For the
requirementsconfig: Features → requirements, Rules → requirements.Since both configs need to be supported, use the test-specification mapping (aspect/requirement/test) as the canonical inline form, since it's the superset. The requirements config can be handled by the SBDL toolchain at document generation time.
Files to annotate (all in
test/cpp/features/):compatibility.feature— Feature: Compatibility + its Rulescompilation.feature— Feature: Compilation + its Rules + Scenariodebugging.feature— Feature: Debugging + its Rulesmaintainability.feature— Feature: Maintainability + its Rulessecurity.feature— Feature: Security + its Rulesstatic-dynamic-analysis.feature— Feature: Static and dynamic analysis + its Rules + ScenarioInline SBDL format — add as a comment line directly below the Feature/Rule/Scenario keyword line. Use hyphenated-lowercase-slug identifiers (matching what
to_slug()currently generates). Do NOT duplicate the title in both the identifier and acustom:titleattribute — the identifier should be a short, meaningful slug, and the Gherkin name itself serves as the human-readable title. Example:For Scenarios:
2. Add inline SBDL to BATS
.batstest filesReplace the current
# bats test_tags=...traceability approach with inline#!sbdldeclarations. Keep the# bats test_tags=...lines as they are (they serve BATS's own filtering), but add#!sbdllines that directly express the traceability.Files to annotate:
test/cpp/integration-tests.batstest/rust/integration-tests.batstest/base/integration-tests.batsPattern: Add
#!sbdlcomment directly above or below the# bats test_tags=line, before the@testline. Use a short author-chosen identifier prefixed with the flavor (e.g.cpp-,rust-,base-). Express the requirement relation directly:Use the tag values that correspond to Rule slugs from the
.featurefiles as the requirement references. Where a test maps to multiple tags, choose the most specific Rule slug for therequirement isrelation.3. Create a simple SBDL extraction script
Replace
generate-sbdl.py,gherkin-to-sbdl.py,gherkin_sbdl_converter.py,gherkin_mapping_config.py, andbats_sbdl_converter.pywith a single simple scriptdocs/support/extract-sbdl.sh(or a minimal Python equivalentdocs/support/extract-sbdl.py) that:#!sbdllines from the input files#!sbdlprefix (and any leading comment characters like#or spaces).sbdlfile with the...This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.