OpenFn / OpenFn/adaptors

dhis2: expose the underlying request in debug mode

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

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
24
Forks
41
Avg merge
3d 13h
Merged PRs (30d)
12

Description

dhis2 can be very hard to debug when things go wrong, and there's some uncertainty about what's happening under the hood when calling out to a dhis2 function.

A really useful debugging tool would be to SOMEHOW log the actual HTTP request that gets sent to dhis2.

By the same token, it may be useful to see the actual raw response as well.

Assorted notes

  • dhis2 does a lot of work to scrub sensitive values. How can we override that when working in the CLI? Would we want to push the same option to lightning? This would have to be an explicit opt-in designed for debugging
  • The request and response may be large and it can be hard to read and manipulate these data structures in stdout. What, if anything, can we do about that?
  • What IS the request and response? A JSON object? A curl compatible string?
  • Serialisation is a fairly big worry - first off request and response objects have a lot of junk which just clutters the output (right now we get a lot of internal axios noise and circular structures), and secondly any data structures in there which don't serialise well - include stuff like dates or sets - will be lost when we serialize

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

No file or test is named. Start by locating the dhis2 adaptor's HTTP request path and its CLI or debug handling, then clarify the representation and explicit opt-in behavior for raw requests and responses. Done means sensitive-value scrubbing, large output, and serialization concerns have defined behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.