Skip to content

Conversation

Copy link

Copilot AI commented Jan 27, 2026

xts alias caches files from URLs and local paths but provided no mechanism to update them when sources change. Additionally, --list showed cached paths instead of original sources, making it unclear where configs originated.

Changes

New JSON structure for aliases.json:

{
  "alias_name": {
    "cached_path": "/home/user/.xts/cache/file.xts",
    "source": "https://example.com/file.xts"
  }
}
  • --refresh command: Re-downloads from URLs or re-copies from local files

    xts --alias --refresh myalias
  • Source tracking: All aliases now store original source (URL or resolved file path) alongside cached path

  • Updated listing: --list displays source location instead of cache path

    $ xts --alias --list
    myalias -> https://example.com/config.xts
  • Automatic migration: Old format ({"name": "/path"}) migrates to new format on first load. Migrated aliases show helpful error when refresh is attempted since original source is unknown.

  • Helper functions: _get_cached_path() and _get_source() abstract format differences throughout codebase

All existing functionality preserved. Alias resolution still returns cached path for execution.

Original prompt

This section details on the original issue you should resolve

<issue_title>Task: Refresh option for xts alias</issue_title>
<issue_description>### Goal

When xts alias is used with urls, the files downloaded from these urls are cached. Therefore, a method needs to be in place for users to manually refresh their cached files. For this, a --refresh option could be used with xts alias. e.g. xts alias --refresh <alias name> to cause the cached file to be updated with the latest from the url.</issue_description>

Comments on the Issue (you are @copilot in this section)

@TB-1993 As part of this we should also fix the caching/listing system. For refresh to work the xts_aliases.json will need to contain the original path/url of the .xts file. That's how it will know where to get the new version of the file from. Similarly, when `xts --alias --list` is used it should print out the .xts files original location, not the cached files location.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 27, 2026 16:58
Co-authored-by: Ulrond <131959864+Ulrond@users.noreply.github.com>
… messages

Co-authored-by: Ulrond <131959864+Ulrond@users.noreply.github.com>
Copilot AI changed the title [WIP] Add refresh option for xts alias to update cached files Add --refresh option for xts alias with source tracking Jan 27, 2026
Copilot AI requested a review from Ulrond January 27, 2026 17:03
@zghp zghp marked this pull request as ready for review February 2, 2026 10:17
@zghp zghp requested a review from a team as a code owner February 2, 2026 10:17
Copilot AI review requested due to automatic review settings February 2, 2026 10:17
@zghp zghp merged commit 2e928c6 into develop Feb 2, 2026
4 checks passed
@zghp zghp deleted the copilot/add-refresh-option-for-xts-alias branch February 2, 2026 10:18
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants