Skip to content

Commit 3fa4351

Browse files
committed
feat: Inline context for migration events
1 parent 491edd8 commit 3fa4351

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

.github/workflows/ci.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
strategy:
4646
matrix:
47-
php-version: [8.1.26, 8.2.13]
47+
php-version: ['8.1', '8.2']
4848

4949
env:
5050
LD_INCLUDE_INTEGRATION_TESTS: 1
@@ -54,15 +54,14 @@ jobs:
5454
with:
5555
fetch-depth: 0 # If you only need the current version keep this.
5656

57+
- name: Setup PHP
58+
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35
59+
with:
60+
php-version: ${{ matrix.php-version }}
61+
5762
- name: Install java support
5863
run: choco install -y javaruntime
5964

60-
- name: Install php support
61-
run: choco install -y php --version=${{ matrix.php-version }} --force
62-
63-
- name: Install composer
64-
run: choco install -y composer
65-
6665
- name: Download wiremock
6766
run: Invoke-WebRequest -Uri https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.31.0/wiremock-jre8-standalone-2.31.0.jar -UseBasicParsing -OutFile wiremock.jar
6867

src/LaunchDarkly/Migrations/OpTracker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function build(): array|string
140140
$event = [
141141
'kind' => 'migration_op',
142142
'creationDate' => Util::currentTimeUnixMillis(),
143-
'contextKeys' => $this->context->getKeys(),
143+
'context' => $this->context,
144144
'operation' => $this->operation->value,
145145
'evaluation' => [
146146
'key' => $this->key,

test-service/TestService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getStatus(): array
7676
'secure-mode-hash',
7777
'migrations',
7878
'event-sampling',
79-
'inline-context',
79+
'inline-context-all',
8080
'anonymous-redaction',
8181
'client-prereq-events',
8282
'big-segments'

tests/Migrations/OpTrackerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testCanBuildSuccessfully(): void
4747
$this->assertIsArray($result, 'tracker failed to build event');
4848
$this->assertEquals('migration_op', $result['kind']);
4949
$this->assertEquals('read', $result['operation']);
50-
$this->assertSame(['user' => 'user-key'], $result['contextKeys']);
50+
$this->assertEquals(LDContext::create('user-key'), $result['context']);
5151

5252
$evaluation = $result['evaluation'];
5353
$this->assertEquals('flag', $evaluation['key']);

0 commit comments

Comments
 (0)