Skip to content

Label JSON export files with .json extension - #428

Open
chrisx9z wants to merge 2 commits into
stellar:masterfrom
chrisx9z:fix/json-output-filenames
Open

Label JSON export files with .json extension#428
chrisx9z wants to merge 2 commits into
stellar:masterfrom
chrisx9z:fix/json-output-filenames

Conversation

@chrisx9z

Copy link
Copy Markdown

Summary

  • change generated JSON-line batch export filenames from .txt to .json
  • update the default archive export filename extension to .json
  • align command help text and README examples with the JSON output extension
  • add a regression test for batch export filename generation

Fixes #327.

Testing

  • git diff --check
  • rg -n "\{start\}-\{end\}.*\.txt|exported_(ledgers|transactions|operations|effects|assets|trades).*\.txt|export_diagnostic_events\.txt|exported_.*\.txt" cmd internal README.md --glob "!*test.go"

go test was not run locally because Go is not installed in this environment.

@chrisx9z
chrisx9z requested a review from a team as a code owner May 26, 2026 18:02
Copilot AI review requested due to automatic review settings May 26, 2026 18:02
Comment: Updates JSON-line export filenames and command docs from .txt to .json, with a regression check for batch names.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates Stellar ETL’s export output naming to use the .json extension (instead of .txt) for JSON-line exports, and aligns CLI help text + README examples accordingly, with a regression test for batch export filename generation.

Changes:

  • Update default archive export output filename to .json
  • Rename batch export filenames from *.txt to *.json across commands/help text
  • Add a regression test to ensure exportFilename(...) emits .json

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/utils/main.go Changes default --output filename extension to .json for archive exports.
cmd/command_utils.go Updates exportFilename(...) to generate .json filenames.
cmd/command_utils_test.go Adds regression test covering .json filename generation.
cmd/export_transactions.go Updates command help text example filename to .json.
cmd/export_trades.go Updates command help text example filename to .json.
cmd/export_token_transfers.go Updates command help text example filename to .json.
cmd/export_operations.go Updates command help text example filename to .json.
cmd/export_ledgers.go Updates command help text example filename to .json.
cmd/export_ledger_transaction.go Updates command help text example filename to .json.
cmd/export_effects.go Updates command help text example filename to .json.
cmd/export_contract_events.go Updates command help text example filename to .json.
cmd/export_assets.go Updates command help text example filename to .json.
README.md Updates README command examples to use .json output filenames.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/export_trades.go Outdated
Comment on lines +19 to +21
Long: `Exports trade data within the specified range. Ledgers are
processed in batches of batch-size; each batch produces one file named
{start}-{end}-trades.txt in the output folder.`,
{start}-{end}-trades.json in the output folder.`,
Comment thread internal/utils/main.go Outdated
func AddArchiveFlags(objectName string, flags *pflag.FlagSet) {
flags.Uint32P("start-ledger", "s", 2, "The ledger sequence number for the beginning of the export period. Defaults to genesis ledger")
flags.StringP("output", "o", "exported_"+objectName+".txt", "Filename of the output file")
flags.StringP("output", "o", "exported_"+objectName+".json", "Filename of the output file")
Comment: Clarifies that .json exports are newline-delimited JSON files and updates related help text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output files should be labelled with .json instead of .txt

2 participants