openfga / openfga/cli

Refine the logs emitted during the import process

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

Nobody has claimed this yet.

Dominant language
Go
Stars
102
Forks
49
Avg merge
1d 1h
Merged PRs (30d)
16

Description

When importing a store fga store import or writing tuples fga tuple write,

It would be nice if instead of logging to stdout in the end, we:

  • allow for an optional, opt-in output to files. E.g. folks can pass in --output-success-file and --failed-success-file to output to the files from the CLI at (without requiring shell redirection). We can make sure that the output format would be compatible with the read so that people can call read on that file again. It should also have metadata about each tuple, including the error message and the request ID to allow for debugging the failure later.
  • By default have the CLI output to STDOUT the failed tuples, could be hidden by (--show-failed-tuples=false) (and optionally the successful tuples, enabled by --show-successful-tuples=true) as they occur (not wait till the end). This will help in situations where e.g. the CLI stalls, encounters a bug or exits early for any reason. It will also help the user monitor the progress and don't have to sit wondering until the process is done.

Originally posted by @rhamzeh in https://github.com/openfga/cli/issues/511#issuecomment-3008604511

Contributor guide

Open the contributing guide

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

Start with the CLI entry points for fga store import and fga tuple write, then trace how they currently emit results to stdout and when output is produced. Done means optional success and failure files, compatible tuple output with error and request metadata, and streaming failed output by default with flags controlling success and failure visibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.