Skip to content

fix: validate file input before network calls in jtk and cfl#86

Merged
rianjs merged 1 commit intomainfrom
fix/update-validate-first
Feb 7, 2026
Merged

fix: validate file input before network calls in jtk and cfl#86
rianjs merged 1 commit intomainfrom
fix/update-validate-first

Conversation

@rianjs
Copy link
Copy Markdown
Contributor

@rianjs rianjs commented Feb 7, 2026

Summary

  • jtk auto update: Move file read and JSON validation before opts.APIClient() — same fix applied to auto create in 2cef041
  • cfl page create/edit: Add early file existence check before config loading and API client creation when --file is provided
  • Add update_test.go with invalid JSON and file-not-found test cases

Without these fixes, passing a bad file path gives confusing config/network errors instead of a clear "failed to read file" message.

Test plan

  • go test ./tools/jtk/... passes
  • go test ./tools/cfl/... passes
  • Release pipeline test: This is a fix: commit touching Go code in both tools/jtk/ and tools/cfl/ — merging will trigger auto-release for both tools, validating the release build fixes from fix: fix release builds for monorepo #85

Fixes #82
Fixes #83

jtk auto update: move file read and JSON validation before
opts.APIClient() so bad input fails fast without needing network access
or config. Same fix applied to auto create in 2cef041.

cfl page create/edit: add early file existence check before config
loading and API client creation when --file is provided.

Add jtk update_test.go with invalid JSON and file-not-found test cases.
@rianjs rianjs force-pushed the fix/update-validate-first branch from 422c4ab to 21c97ae Compare February 7, 2026 13:01
@rianjs rianjs changed the title fix: validate file before creating API client in auto update fix: validate file input before network calls in jtk and cfl Feb 7, 2026
@rianjs rianjs merged commit b602b12 into main Feb 7, 2026
7 checks passed
@rianjs rianjs deleted the fix/update-validate-first branch February 7, 2026 13:03
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.

fix: Release tag mismatch — chocolatey/winget can't find GoReleaser releases fix: Remove GoReleaser Pro-only alternative_names from jtk cask config

1 participant