`pactffi_get_plugin_logs` requires a `plugin_instance_id` that no FFI function exposes

Open
#545 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

Start with the pact.h declarations and documentation for pactffi_get_plugin_logs, pactffi_using_plugin, pactffi_using_plugin_with_delay, and pactffi_register_plugin_log_callback, then review the related Issue 1. Determine how a C consumer can obtain a plugin_instance_id without an unreachable callback path. Done means the FFI exposes a usable, documented route to retrieve plugin logs for a plugin instance.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Rust
Stars
106
Forks
59
Avg merge
9d 7h
Merged PRs (30d)
12

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pact-foundation/pact-reference

All issues in pact-foundation/pact-reference

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.