swagger.json file should be saved to user's local config dir, not next to the code#119
Open
shreyb wants to merge 13 commits into
Open
swagger.json file should be saved to user's local config dir, not next to the code#119shreyb wants to merge 13 commits into
shreyb wants to merge 13 commits into
Conversation
shreyb
force-pushed
the
issue-113
branch
4 times, most recently
from
June 15, 2026 21:48
a7793ac to
2cd89f1
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates Ferry CLI’s swagger caching behavior so swagger.json is stored in a user-owned location (XDG config dir when available, otherwise a temp directory) rather than alongside the installed source, addressing #113.
Changes:
- Add
get_configfile_dir()and refactor config path helpers to separate “config dir” vs “config.ini path”. - Update
FerryAPIto compute a per-server swagger filename and store it under the user config dir (or temp dir), fetching it when missing. - Refactor
DebugLevelinto its own module and update affected imports; expand/update tests and CI/pre-commit config accordingly.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
src/ferry_cli/helpers/api.py |
Implements new swagger file location + hashed filename and fetch-on-missing behavior. |
src/ferry_cli/config/config.py |
Adds get_configfile_dir() and adjusts config path derivation. |
src/ferry_cli/ferry_cli.py |
Updates swagger loading to use FerryAPI.swagger_file and introduces setup_FerryAPI(). |
src/ferry_cli/helpers/auth.py |
Moves DebugLevel import to new module and removes old enum definition. |
src/ferry_cli/helpers/debug_level.py |
New DebugLevel enum module. |
src/ferry_cli/helpers/supported_workflows/* |
Updates DebugLevel imports to new module. |
tests/test_api.py |
Adds unit/integration coverage for swagger file selection and fetching. |
tests/test_config.py |
Updates tests for new config dir/path helpers. |
tests/test_main.py |
Updates swagger fixture to use FerryAPI.swagger_file and adjusts server-flag test. |
tests/conftest.py |
Adds a test auth stub class used by new tests. |
.pre-commit-config.yaml |
Attempts to add validators for pylint hook (currently invalid YAML). |
.github/workflows/Ferry-CLI.yml |
Splits CI into pre-commit + unit-test jobs (currently invalid YAML indentation). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…use. Also, get_latest_swagger_file now stores the swagger file in the config directory as returned by config.get_configfile_dir, or in $TMPDIR
…he FerryCLI instance, and generates the endpoints. This simplifies the API
…can switch between servers without overwriting swagger.json
…ck, and then run unit tests in separate job
shreyb
force-pushed
the
issue-113
branch
2 times, most recently
from
June 16, 2026 16:47
eaedacf to
8a567f0
Compare
…th import it without causing an import cycle
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
.github/workflows/Ferry-CLI.yml:17
- The
steps:lists are not indented understeps:(e.g.- uses: ...is aligned withsteps:). This makes the workflow YAML invalid and will prevent GitHub Actions from running the job.
steps:
- uses: actions/checkout@v4
- name: setup Python
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.
This PR updates Ferry CLI’s swagger caching behavior so swagger.json is stored in a user-owned location (
$XDG_CONFIG_DIR/ferry-cliwhen available, otherwise$HOME/.config/ferry-cli, else a temp directory) rather than alongside the installed source, addressing #113.Changes:
(Edited from Copilot-generated summary)
All unit and integration tests pass.
Closes #113