Skip to content

Commit 26d0894

Browse files
committed
rename skills, update contrib
1 parent 05353cc commit 26d0894

4 files changed

Lines changed: 71 additions & 57 deletions

File tree

.github/skills/port-from-openinference/SKILL.md renamed to .github/skills/migrate-from-openinference/SKILL.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
name: port-from-openinference
3-
description: Port an openinference-instrumentation-* package from https://github.com/open-telemetry/donation-openinference into this repo. Creates a new package, or — when a package for the library already exists in the repo — augments it with the coverage OpenInference adds on top. Use when a user asks to migrate or port a package from OpenInference.
2+
name: migrate-from-openinference
3+
description: Migrate an openinference-instrumentation-* package from https://github.com/open-telemetry/donation-openinference into this repo. Creates a new package, or — when a package for the library already exists in the repo — augments it with the coverage OpenInference adds on top. Use when a user asks to migrate or port a package from OpenInference.
44
---
55

6-
# Port an OpenInference `instrumentation-*` package
6+
# Migrate an OpenInference `instrumentation-*` package
77

88
Migrate an `openinference-instrumentation-<source>` package from
99
https://github.com/open-telemetry/donation-openinference into this
@@ -12,15 +12,15 @@ repo. The result emits OTel GenAI semantic conventions through
1212

1313
Two modes, decided by the "Before you start" gate below:
1414

15-
- **Greenfield port** — no package for the library exists yet. Create a
15+
- **Greenfield migration** — no package for the library exists yet. Create a
1616
**new implementation** under `instrumentation/`. The default, and what the
1717
bulk of this skill describes.
1818
- **Augment an existing package** — the repo already ships
1919
`opentelemetry-instrumentation-genai-<lib>`. Don't re-create it; inventory
2020
what it covers, diff against OpenInference, and add **only the missing
2121
parts**. See [Augment mode](#augment-mode-the-package-already-exists).
2222

23-
For a greenfield port the major work items are: rewriting the patcher to
23+
For a greenfield migration the major work items are: rewriting the patcher to
2424
method-level (step 5), mapping every request/response shape into OTel
2525
`InputMessage`/`OutputMessage` parts (step 6), and migrating the unit-test
2626
corpus while filtering openinference-framework plumbing tests out (step 7).
@@ -55,7 +55,7 @@ ls instrumentation/opentelemetry-instrumentation-genai-<lib> 2>/dev/null
5555
- **Exists →** **augment mode**: don't scaffold a new package. OpenInference
5656
is now a *second* reference to mine for coverage the existing package
5757
lacks. Jump to [Augment mode](#augment-mode-the-package-already-exists).
58-
- **Doesn't exist →** greenfield port; continue below.
58+
- **Doesn't exist →** greenfield migration; continue below.
5959

6060
If a near-name sibling (a `-agents` / `-client` suffix) might instrument a
6161
*different* surface of the same vendor, confirm the target name with the user
@@ -64,7 +64,7 @@ before deciding.
6464
## Before you start: check for native OTel instrumentation
6565

6666
AI SDKs increasingly ship their **own** OpenTelemetry GenAI instrumentation.
67-
When they do, porting the OpenInference package is redundant. So
67+
When they do, migrating the OpenInference package is redundant. So
6868
before writing any code, determine whether the instrumented library is
6969
self-instrumenting.
7070

@@ -85,7 +85,7 @@ self-instrumented. Confirm empirically: set a **global** `TracerProvider`
8585
configured), make one call, and inspect the emitted spans' instrumentation
8686
scope.
8787

88-
**If the library is self-instrumented, do NOT port the OpenInference
88+
**If the library is self-instrumented, do NOT migrate the OpenInference
8989
package.** Pivot the work:
9090

9191
1. **Ignore the OpenInference instrumentation entirely** — the vendor owns
@@ -100,7 +100,7 @@ package.** Pivot the work:
100100
GenAI semconv: missing operations, wrong operation name, legacy/duplicate
101101
attributes, no metrics, no content-capture controls, no util-genai
102102
content modes / completion-hook / upload support, etc. Record each as an
103-
`expected_violation` or a documented skip, same as a normal port.
103+
`expected_violation` or a documented skip, same as a normal migration.
104104
4. **Write `MIGRATION_REPORT.md`** stating the library is self-instrumented,
105105
the conformance results, and the gap list — that report is the
106106
deliverable. **Stop and surface the finding to the user.** Do not build a
@@ -128,17 +128,17 @@ with the migration flow below.
128128
The repo-wide rules in [AGENTS.md](../../../AGENTS.md) already apply
129129
(telemetry through `opentelemetry-util-genai` public surface only, no
130130
`type: ignore`, semconv enums over string literals, re-raise caught
131-
exceptions). The rules below are the ones the port is most likely to
131+
exceptions). The rules below are the ones the migration is most likely to
132132
violate:
133133

134134
1. **Zero OpenInference dependencies.** No `openinference-instrumentation`,
135135
no `openinference-semantic-conventions`, no `openinference-*` anywhere
136-
in the port's `src/` or `tests/`. Verify with
136+
in the migrated package's `src/` or `tests/`. Verify with
137137
`rg openinference instrumentation/<target>` — output must be empty.
138-
2. **Public util-genai surface only.** Beyond the AGENTS.md rule, the port
138+
2. **Public util-genai surface only.** Beyond the AGENTS.md rule, the migrated package
139139
must not import any `opentelemetry.util.genai._*` module — the allowed
140140
modules are enumerated in step 4.
141-
3. **Ignore all other OpenInference instrumentations during the port.** The only
141+
3. **Ignore all other OpenInference instrumentations during the migration.** The only
142142
instrumentation code to read is the OpenInference package being migrated
143143
plus `opentelemetry-util-genai`. Build
144144
from first principles: original OpenInference code + util-genai public API +
@@ -193,7 +193,7 @@ conformance scenarios under `tests/conformance/`, and cassettes.
193193

194194
### B. Diff against OpenInference
195195

196-
Run the OpenInference analysis as a greenfield port would (the reading behind
196+
Run the OpenInference analysis as a greenfield migration would (the reading behind
197197
steps 5–6): every method it patches, every shape it parses. Subtract
198198
inventory A. The remainder is the work-list:
199199

@@ -222,12 +222,12 @@ Apply steps **5–10 to the new parts only**:
222222

223223
### D. Report and review
224224

225-
Write `MIGRATION_REPORT.md` via the `review-ported` skill as usual — it
225+
Write `MIGRATION_REPORT.md` via the `review-migration` skill as usual — it
226226
detects augment mode.
227227

228228
## Migration flow
229229

230-
> The numbered steps below are written for a **greenfield port**. In
230+
> The numbered steps below are written for a **greenfield migration**. In
231231
> [augment mode](#augment-mode-the-package-already-exists) skip steps 1–3,
232232
> and scope steps 5–10 to the delta from the inventory/diff (sections A–C
233233
> above).
@@ -353,7 +353,7 @@ Output must be empty.
353353
This is the largest behavioral change. OpenInference typically patches at
354354
the HTTP-transport layer (`OpenAI.request`, `AsyncOpenAI.request`,
355355
`HTTPClient._send_request`, etc.) and dispatches by `cast_to` response type.
356-
**That pattern does not survive the port.** util-genai's
356+
**That pattern does not survive the migration.** util-genai's
357357
`InferenceInvocation` model needs the request kwargs (`model`, `messages`,
358358
`tools`, `stream`, …) at call time, which only the API methods see.
359359

@@ -465,14 +465,14 @@ response shape — migrate it. A test that checks
465465
`using_attributes(session_id=…)` propagates into span attributes covers OpenInference
466466
framework behavior — skip it.
467467

468-
**Sanity check before committing step 7.** Count source vs ported tests:
468+
**Sanity check before committing step 7.** Count source vs migrated tests:
469469

470470
```sh
471471
rg -c '^\s*(async )?def test_' <source-path>/tests/
472472
rg -c '^\s*(async )?def test_' instrumentation/<target>/tests/
473473
```
474474

475-
A port that drops from 80 tests to 5 is a regression — go back to the
475+
A migration that drops from 80 tests to 5 is a regression — go back to the
476476
"migrate" and "migrate (rewrite)" buckets and finish them.
477477

478478
**Replace conftest boilerplate.** OpenInference conftests duplicate the
@@ -513,7 +513,7 @@ tiny constants (`DEFAULT_MODEL`, sample prompts) inline or in
513513
**Required unit-test coverage per wrapped method.** Apply the repo test
514514
matrix (sync/async × happy/error, plus streaming × happy/error where the
515515
method streams — see [AGENTS.md](../../../AGENTS.md) Tests section)
516-
to **every** method patched in step 5. For the port these are blockers for
516+
to **every** method patched in step 5. For the migration these are blockers for
517517
the migration PR, not follow-up. The error variants must verify the
518518
original exception is re-raised, `error.type` is recorded, and span status
519519
is ERROR.
@@ -528,18 +528,18 @@ Add current `util/opentelemetry-util-genai` and `instrumentation/opentelemetry-i
528528
Author conformance scenarios using the **`write-conformance-tests`** skill —
529529
it's the generic procedure (scenario modules, the `test_conformance.py`
530530
runner, declared gaps, lib-specific assertions, weaver policies) and applies
531-
to any instrumentation. Port-specific notes on top of that skill:
531+
to any instrumentation. Migration-specific notes on top of that skill:
532532

533533
- Drop OpenInference's `examples/` tree — its end-to-end demos are replaced
534-
by conformance scenarios, not ported.
534+
by conformance scenarios, not migrated.
535535
- For an operation blocked by a util-genai/semconv gap, point the
536536
`expected_violations` / `xfail` `reason=` at the gap row in
537537
`MIGRATION_REPORT.md`.
538538

539539
### 9. Cassettes (or a transport proxy)
540540

541541
- Copy cassettes from OpenInference's `tests/cassettes/` (or wherever the OpenInference package
542-
parks them) into the port's `tests/cassettes/`. Reuse names so existing
542+
parks them) into the migrated package's `tests/cassettes/`. Reuse names so existing
543543
unit tests keep loading them.
544544
- Reuse existing cassettes for conformance scenarios when they are applicable.
545545
- **AI-generated cassettes.** For a cassette OpenInference lacks and you
@@ -550,7 +550,7 @@ to any instrumentation. Port-specific notes on top of that skill:
550550

551551
**Transport proxy instead of cassettes.** If the OpenInference unit tests mock
552552
HTTP (e.g. `respx`, `httpx.MockTransport`) rather than replay recorded
553-
cassettes, you may do the same in the port's **unit** tests — build the SDK
553+
cassettes, you may do the same in the migrated package's **unit** tests — build the SDK
554554
client with an `httpx.MockTransport` (or equivalent) returning canned
555555
responses instead of `@pytest.mark.vcr`. When you go this route:
556556

@@ -563,17 +563,17 @@ responses instead of `@pytest.mark.vcr`. When you go this route:
563563
and ignore the injected `vcr` (see the `write-conformance-tests` skill).
564564
Pick one mechanism (cassettes *or* transport mock) and use it consistently
565565
across the whole package.
566-
- **Mention the choice in `MIGRATION_REPORT.md`** (the `review-ported` skill
566+
- **Mention the choice in `MIGRATION_REPORT.md`** (the `review-migration` skill
567567
flags missing cassettes; note that the package mocks the transport by
568568
design so the absence is not a gap).
569569

570570
### 10. Workspace integration
571571

572572
Wire the new package into the workspace, `tox.ini`, and pyright per the
573573
**Adding a package to the workspace** section of [AGENTS.md](../../../AGENTS.md)
574-
— it applies to any new package, not just ports. Port-specific note on top:
574+
— it applies to any new package, not just migrations. Migration-specific note on top:
575575

576-
- **Leave the package out of `[tool.pyright] include`.** A port over untyped
576+
- **Leave the package out of `[tool.pyright] include`.** A migration over untyped
577577
`wrapt` boundaries (`wrapped, instance, args, kwargs`) and vendor SDK members
578578
produces hundreds of strict-mode errors, so don't add it to `include` until
579579
typing lands — track that as a follow-up.
@@ -585,14 +585,14 @@ Run the pre-PR checks from the **Commands** section of
585585
the package's `-{oldest,latest}` (and `-conformance`) test envs.
586586

587587
Open the PR with the `migration:openinference` label. Run the
588-
`review-ported` skill locally to generate `MIGRATION_REPORT.md`; iterate
589-
until §4 (test coverage) is clean. The review skill compares the port
588+
`review-migration` skill locally to generate `MIGRATION_REPORT.md`; iterate
589+
until §4 (test coverage) is clean. The review skill compares the migrated package
590590
against OpenInference (or any upstreams you name), so coverage gaps
591591
surface in one report.
592592

593593
## See also
594594

595-
- [AGENTS.md](../../../AGENTS.md) — general repo rules that already apply to the port.
595+
- [AGENTS.md](../../../AGENTS.md) — general repo rules that already apply to the migration.
596596
- `util/opentelemetry-util-genai/AGENTS.md` — util-genai usage rules.
597597
- `.github/skills/write-conformance-tests/SKILL.md` — generic conformance-scenario authoring (step 8).
598-
- `.github/skills/review-ported/SKILL.md` — sister review skill (writes `MIGRATION_REPORT.md`).
598+
- `.github/skills/review-migration/SKILL.md` — sister review skill (writes `MIGRATION_REPORT.md`).

0 commit comments

Comments
 (0)