Skip to content

feat: add hook and media ready expression context#32

Merged
wizzomafizzo merged 1 commit into
mainfrom
feat/hook-media-ready-expr-env
May 31, 2026
Merged

feat: add hook and media ready expression context#32
wizzomafizzo merged 1 commit into
mainfrom
feat/hook-media-ready-expr-env

Conversation

@wizzomafizzo

@wizzomafizzo wizzomafizzo commented May 31, 2026

Copy link
Copy Markdown
Member

Summary

  • add hook context to ArgExprEnv with name and first_boot_start fields
  • add media_ready expression environment field
  • cover expression evaluation and JSON serialization for new fields
  • ignore local .pi agent state

Tests

  • task lint-fix
  • task test

Summary by CodeRabbit

  • New Features

    • Added hook context information with name and first boot start tracking.
    • Added media readiness status field.
  • Tests

    • Extended test coverage to verify new fields in JSON serialization and round-trip conversion.
    • Added expression evaluation tests for hook and media readiness variables.
  • Chores

    • Updated repository ignore patterns.

@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f023780a-3647-4268-ab3d-5dbd2aa5ffa3

📥 Commits

Reviewing files that changed from the base of the PR and between eb2ddc5 and df53045.

📒 Files selected for processing (4)
  • .gitignore
  • exprenv_test.go
  • expressions.go
  • parser_test.go

📝 Walkthrough

Walkthrough

The PR extends the expression evaluation environment by introducing hook context and media readiness support. A new ExprEnvHook struct and corresponding fields are added to ArgExprEnv, with comprehensive tests validating JSON serialization and expression evaluation of the new fields.

Changes

Hook and media readiness support

Layer / File(s) Summary
Data contract for hook and media context
expressions.go
New ExprEnvHook struct with Name and FirstBootStart fields. ArgExprEnv extended with optional Hook field and MediaReady boolean field, both with snake_case JSON and expression tags.
JSON serialization tests
exprenv_test.go
Test data and assertions added for JSON serialization/deserialization of Hook and MediaReady. New TestExprEnvHook_JSONSerialization validates hook struct encoding to JSON with name and first_boot_start fields.
Expression evaluation tests
parser_test.go
TestPostProcess extended with test cases for hook.name, hook.first_boot_start, and media_ready expressions. ArgExprEnv setup populated with Hook and MediaReady values for test validation.
Build artifact configuration
.gitignore
Added .pi/ directory to ignore rules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A hook appears, media shines bright,
New fields added to expressions so right,
JSON tests dance, evaluations gleam,
Zapscript grows with a hooking dream! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding hook and media_ready fields to the expression context (ArgExprEnv) with full support for expression evaluation and JSON serialization.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/hook-media-ready-expr-env

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

@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wizzomafizzo wizzomafizzo merged commit a063fa4 into main May 31, 2026
12 checks passed
@wizzomafizzo wizzomafizzo deleted the feat/hook-media-ready-expr-env branch May 31, 2026 11:10
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