Label JSON export files with .json extension - #428
Open
chrisx9z wants to merge 2 commits into
Open
Conversation
Comment: Updates JSON-line export filenames and command docs from .txt to .json, with a regression check for batch names.
There was a problem hiding this comment.
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
*.txtto*.jsonacross 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 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.`, |
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.txtto.json.jsonFixes #327.
Testing
git diff --checkrg -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 testwas not run locally because Go is not installed in this environment.