Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,13 @@
}
]
},
{
"id": "Requirement 4.3.10",
"machine_id": "requirement_4_3_10",
"content": "The `evaluation context` in the `hook context` of every hook that runs after one or more `before` hooks, including subsequent `before` hooks and the `after`, `error`, and `finally` hooks, MUST include the `evaluation context` returned by each of those `before` hooks, merged in hook execution order (later hooks take precedence) as described in Requirement 3.2.3.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 4.4.1",
"machine_id": "requirement_4_4_1",
Expand Down
9 changes: 9 additions & 0 deletions specification/assets/gherkin/hooks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,12 @@ Feature: Evaluation details through hooks
| string | variant | null |
| string | reason | ERROR |
| string | error_code | GENERAL |

@spec-4.3.10
Scenario: Context added by a before hook is visible to later hooks
Given a client with added hook
And the "before" hook adds a context entry with key "hook-key" and value "hook-value"
And a boolean-flag with key "boolean-flag" and a fallback value "false"
When the flag was evaluated with details
Then the "before" hook should have been executed
And the "after, finally" hooks should be called with a context entry with key "hook-key" and value "hook-value"
7 changes: 7 additions & 0 deletions specification/sections/04-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ The evaluation details passed to the `finally` stage matches the evaluation deta

> Instead of `finally`, `finallyAfter` **SHOULD** be used.

#### Requirement 4.3.10

> The `evaluation context` in the `hook context` of every hook that runs after one or more `before` hooks, including subsequent `before` hooks and the `after`, `error`, and `finally` hooks, **MUST** include the `evaluation context` returned by each of those `before` hooks, merged in hook execution order (later hooks take precedence) as described in Requirement 3.2.3.

Requirement 4.3.5 defines the context the flag is resolved with, but not what later hooks see.
This requirement makes them see the same context, so that, for example, a logging or telemetry hook in the `after` or `finally` stage reports the attributes a `before` hook added.

### 4.4. Hook registration & ordering

#### Requirement 4.4.1
Expand Down
Loading