Skip to content

pactffi_get_plugin_logs requires a plugin_instance_id that no FFI function exposes #545

Description

@JP-Ellis

Affects: pact-ffi 0.5.5 (introduced by #537)

Summary

const char *pactffi_get_plugin_logs(const char *plugin_instance_id);

There is no way for an FFI consumer to obtain a plugin_instance_id. Searching the full 0.5.5
pact.h (280 exported functions), the only occurrences of "instance_id" are in this function's
own signature and doc comment. pactffi_using_plugin / pactffi_using_plugin_with_delay return
only a c_uint status code, not an instance ID.

Internally the buffer is a HashMap keyed by entry.plugin_instance_id (from the plugin
driver), which is never surfaced across the FFI boundary.

Interaction with Issue 1

The only place a plugin_instance_id is ever exposed to a C caller is the first parameter of
the log callback
registered via pactffi_register_plugin_log_callback. The intended flow
appears to be:

  1. register the callback,
  2. learn instance IDs as entries arrive,
  3. call pactffi_get_plugin_logs for a given instance.

Since Issue 1 makes step 1 impossible, the entire plugin-observability surface added in #537 is
unreachable from a C consumer. Fixing Issue 1 unblocks this one.

Suggested fix

Fix Issue 1 (which makes this reachable), and/or add an accessor that returns the plugin instance
ID — for example an out-parameter on pactffi_using_plugin — so that pactffi_get_plugin_logs
is independently usable without registering a callback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions