Fix #70: Implement HTTP caching for offline mode #71
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
Fixes #70 - Offline mode now properly handles HTTP-referenced requirements/constraints files through caching.
Problem
Previously, offline mode (
-o/--offline) only skipped VCS operations but still fetched HTTP-referenced requirements/constraints files. This created an inconsistent "offline" experience where network requests were still made despite the flag.Solution
Implemented HTTP content caching:
.mxdev_cache/Changes
Implementation
_get_cache_key(),_cache_http_content(),_read_from_cache()resolve_dependencies()to acceptofflineandcache_dirparametersprocess_io()andprocess_line()read()to pass offline state from configurationDocumentation
-n/--no-fetch,-f/--fetch-only,-o/--offlineTesting
test_http_cache_online_mode: Verify caching during online fetchtest_http_cache_offline_mode_hit: Verify cache read in offline modetest_http_cache_offline_mode_miss: Verify error on cache misstest_cache_key_generation: Verify deterministic cache keystest_http_cache_revalidates_in_online_mode: Verify cache updatesTest Results
All 190 tests pass (including 5 new HTTP caching tests).
Checklist
.mxdev_cache/added to.gitignore