From 2bb2e388bb5ddd2fcbe0dd819f205f32dea98029 Mon Sep 17 00:00:00 2001 From: JacobPEvans <20714140+JacobPEvans@users.noreply.github.com> Date: Sun, 26 Apr 2026 14:34:20 -0400 Subject: [PATCH 1/4] feat: ship working demo passthrough pipeline + fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The template now ships a real working demo (passthrough pipeline + matching route + fixture pair) instead of placeholders that fail validation. This: - Gives the test harness real content to exercise on the template itself (lifts the is_template skip guard) - Provides consumers a known-working starting point they can replace - Lets us prove the harness has teeth: deliberate fixture breaks surface as CI failures, restoration restores green Files: - default/pipelines/passthrough/conf.yml — Eval stamps sourcetype, index, datatype on every event - default/pipelines/route.yml — replaces REPLACE_* placeholders with a real passthrough route (filter datatype=='cribl-demo') - tests/fixtures/passthrough/sample.{json,expected.json} — input + expected output pair driving the auto-discovered Vitest case - .github/workflows/test.yml — drops is_template==false guard so CI runs end-to-end against the demo content --- .github/workflows/test.yml | 5 +++-- default/pipelines/passthrough/conf.yml | 20 +++++++++++++++++++ default/pipelines/route.yml | 12 +++++------ .../fixtures/passthrough/sample.expected.json | 8 ++++++++ tests/fixtures/passthrough/sample.json | 7 +++++++ 5 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 default/pipelines/passthrough/conf.yml create mode 100644 tests/fixtures/passthrough/sample.expected.json create mode 100644 tests/fixtures/passthrough/sample.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 00a5fa7..c751147 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,8 +16,9 @@ permissions: jobs: test: - # Skip on the template repo itself; consumer repos have is_template: false. - if: github.event.repository.is_template == false + # Runs on the template too — the template now ships a working demo + # passthrough pipeline + fixture so the harness gets exercised here + # before consumer repos inherit it. uses: dryvist/cc-edge-pack-template/.github/workflows/cribl-pack-test.yml@main with: # CHANGE per pack: 'edge' for Cribl Edge packs, 'stream' for Cribl Stream packs. diff --git a/default/pipelines/passthrough/conf.yml b/default/pipelines/passthrough/conf.yml new file mode 100644 index 0000000..54f8347 --- /dev/null +++ b/default/pipelines/passthrough/conf.yml @@ -0,0 +1,20 @@ +output: default +streamtags: [] +groups: {} +asyncFuncTimeout: 1000 +description: >- + Demo passthrough pipeline. Stamps Splunk-canonical fields + (sourcetype, index, datatype) on every event. Replace this + with your real pipeline logic when scaffolding a new pack. +functions: + - id: eval + filter: "true" + disabled: false + conf: + add: + - name: sourcetype + value: "'cribl:demo'" + - name: index + value: "'main'" + - name: datatype + value: "'cribl-demo'" diff --git a/default/pipelines/route.yml b/default/pipelines/route.yml index 0ba8123..5098a82 100644 --- a/default/pipelines/route.yml +++ b/default/pipelines/route.yml @@ -2,19 +2,19 @@ id: default groups: {} comments: [] routes: - # Replace this placeholder route with your real routes. + # Demo route. Replace with your real routes when scaffolding a new pack. # Validator rules: # - id and pipeline must be descriptive (no 'main', no 'route1') # - filter must be a real expression (not literally 'false' / '0') # - output MUST be __group (not input_id) - - id: REPLACE_ROUTE_ID - name: Replace With Route Name + - id: passthrough + name: Demo Passthrough final: true disabled: false - pipeline: REPLACE_PIPELINE_NAME - description: "Placeholder — replace id, name, pipeline, and filter." + pipeline: passthrough + description: "Demo route — replace when scaffolding a new pack." enableOutputExpression: false targetContext: group - filter: "datatype=='replace-with-your-datatype'" + filter: "datatype=='cribl-demo'" clones: [] output: __group diff --git a/tests/fixtures/passthrough/sample.expected.json b/tests/fixtures/passthrough/sample.expected.json new file mode 100644 index 0000000..9573b8b --- /dev/null +++ b/tests/fixtures/passthrough/sample.expected.json @@ -0,0 +1,8 @@ +[ + { + "sourcetype": "cribl:demo", + "index": "main", + "datatype": "cribl-demo", + "_raw": "demo event" + } +] diff --git a/tests/fixtures/passthrough/sample.json b/tests/fixtures/passthrough/sample.json new file mode 100644 index 0000000..ec57193 --- /dev/null +++ b/tests/fixtures/passthrough/sample.json @@ -0,0 +1,7 @@ +[ + { + "_raw": "demo event", + "_time": 1714137600, + "datatype": "cribl-demo" + } +] From 4eabbe436ba6efd68b7cfb28cfb415e73cd080c8 Mon Sep 17 00:00:00 2001 From: JacobPEvans <20714140+JacobPEvans@users.noreply.github.com> Date: Sun, 26 Apr 2026 14:37:00 -0400 Subject: [PATCH 2/4] fix(template): give package.json a real name so harness can install pack The Vitest harness installs the pack and then queries it by name; with 'REPLACE-WITH-PACK-NAME' it 404s. Switch to 'cc-edge-demo-io' which satisfies the cc-{edge,stream}--io validator convention and makes it obvious it's demo content for consumers to replace. --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 63dabf7..e86ba3d 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "REPLACE-WITH-PACK-NAME", + "name": "cc-edge-demo-io", "version": "0.0.1", "minLogStreamVersion": "4.17.0", - "author": "Your Name ", - "description": "REPLACE: Brief description of what this pack does.", - "displayName": "REPLACE With Display Name", + "author": "dryvist ", + "description": "Demo passthrough pack — replace name/displayName/description/author when scaffolding from this template.", + "displayName": "Cribl Edge Demo Pack", "tags": { "streamtags": [ "replace", From 60835a4010cd5b0f1daab788c935acf72cf32d41 Mon Sep 17 00:00:00 2001 From: JacobPEvans <20714140+JacobPEvans@users.noreply.github.com> Date: Sun, 26 Apr 2026 14:38:26 -0400 Subject: [PATCH 3/4] test: deliberately mutate expected fixture to verify CI catches drift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit will be reverted in the next push. Pushing it to confirm the Vitest assertion produces a useful diff and the test job exits non-zero in GitHub Actions — proving the harness has teeth instead of passing tautologically. --- tests/fixtures/passthrough/sample.expected.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/passthrough/sample.expected.json b/tests/fixtures/passthrough/sample.expected.json index 9573b8b..47f6f5f 100644 --- a/tests/fixtures/passthrough/sample.expected.json +++ b/tests/fixtures/passthrough/sample.expected.json @@ -1,6 +1,6 @@ [ { - "sourcetype": "cribl:demo", + "sourcetype": "cribl:WRONG-VALUE-FOR-TEETH-TEST", "index": "main", "datatype": "cribl-demo", "_raw": "demo event" From 3ed16d9ca9da869adc6eeef03096c27a7b3953f1 Mon Sep 17 00:00:00 2001 From: JacobPEvans <20714140+JacobPEvans@users.noreply.github.com> Date: Sun, 26 Apr 2026 14:39:58 -0400 Subject: [PATCH 4/4] Revert "test: deliberately mutate expected fixture to verify CI catches drift" This reverts commit 60835a4010cd5b0f1daab788c935acf72cf32d41. --- tests/fixtures/passthrough/sample.expected.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/passthrough/sample.expected.json b/tests/fixtures/passthrough/sample.expected.json index 47f6f5f..9573b8b 100644 --- a/tests/fixtures/passthrough/sample.expected.json +++ b/tests/fixtures/passthrough/sample.expected.json @@ -1,6 +1,6 @@ [ { - "sourcetype": "cribl:WRONG-VALUE-FOR-TEETH-TEST", + "sourcetype": "cribl:demo", "index": "main", "datatype": "cribl-demo", "_raw": "demo event"