Skip to content

scalar: add --<verb>-cache-server-url options - #849

Merged
Johannes Schindelin (dscho) merged 2 commits into
microsoft:vfs-2.53.0from
derrickstolee:scalar-gvfs-verb
Feb 11, 2026
Merged

Johannes Schindelin (dscho) merged 2 commits into
microsoft:vfs-2.53.0from
derrickstolee:scalar-gvfs-verb

Conversation

@derrickstolee

@derrickstolee Derrick Stolee (derrickstolee) commented Jan 25, 2026 •

Copy link
Copy Markdown

In #836, we implemented custom gvfs..cache-server config options that allow existing enlistments to point specific GVFS Protocol verbs at different cache servers. However, that did not help at clone time.

This change adds ---cache-server-url options to 'scalar clone' to allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server infrastructure as each protocol endpoint is deployed independently.

  • This change only applies to interactions with Azure DevOps and the
    GVFS Protocol.

@derrickstolee
Derrick Stolee (derrickstolee) changed the base branch from vfs-2.52.0 to vfs-2.53.0 February 3, 2026 13:29
In git#836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Now that we are testing the --<verb>-cache-server options in t9210, we need
to be more careful about our variable names to ensure those created in
t9210-scalar.sh are different from those set in lib-gvfs-helper.sh. For this
we:

* Rename variables to use ORIGIN_* for those that host Git repo data.
* Update server output files to have more specific names.
* Avoid using the default test server port when possible, in preference for
  a positive shift-by-10k.

Signed-off-by: Derrick Stolee <stolee@gmail.com>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one suggestion, but that can easily be a follow-up instead of holding up this here PR.

Comment thread t/t9210-scalar.sh
'

test_expect_success 'fetch <non-existent> does not hang in gvfs-helper' '
test_expect_success EXPENSIVE 'fetch <non-existent> does not hang in gvfs-helper' '

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use a special prereq here that tests for either GIT_TEST_LONG or another variable that we then set in our CI, so that this test case is exercised in the CI builds?

@dscho
Johannes Schindelin (dscho) merged commit bea18f5 into microsoft:vfs-2.53.0 Feb 11, 2026
122 of 123 checks passed
Johannes Schindelin (dscho) added a commit that referenced this pull request Apr 12, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
Johannes Schindelin (dscho) added a commit that referenced this pull request Apr 17, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
Johannes Schindelin (dscho) added a commit that referenced this pull request Apr 17, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
Johannes Schindelin (dscho) added a commit that referenced this pull request Apr 20, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
Johannes Schindelin (dscho) added a commit that referenced this pull request Apr 20, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
Johannes Schindelin (dscho) added a commit that referenced this pull request Apr 20, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
Johannes Schindelin (dscho) added a commit that referenced this pull request Jun 12, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
Johannes Schindelin (dscho) added a commit that referenced this pull request Jun 12, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
Johannes Schindelin (dscho) added a commit that referenced this pull request Jun 17, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
Derrick Stolee (derrickstolee) added a commit to microsoft/VFSForGit that referenced this pull request Sep 4, 2026
## Why This Matters

The microsoft/git GVFS helper can route protocol endpoints to dedicated cache servers, but VFS for Git previously sent every protocol request to one global cache URL. Supporting the same endpoint-specific preferences lets cache infrastructure migrate incrementally without making a dedicated endpoint a hard dependency.

The `/gvfs/sizes` endpoint is unique to VFS for Git, so this change adds the corresponding `gvfs.sizes.cache-server` setting alongside the prefetch, GET, and POST settings used by Scalar.

## Commit Narrative

1. **Route GVFS endpoints to dedicated cache servers**: load, persist, and validate endpoint overrides; add matching `gvfs clone` options; preserve overrides during mount-time cache resolution.
2. **Fall back safely from dedicated cache endpoints**: retry failed endpoint requests through the global cache, preserve circuit-breaker budgets, distinguish network body failures from local processing errors, propagate cancellation unchanged, and emit authority-only telemetry.
3. **Explain endpoint-specific cache routing**: document configuration, precedence, fallback order, and troubleshooting.
4. **Cover prefetch failure telemetry redaction**: exercise terminal prefetch failures at the production entry point and ensure diagnostics retain only URI authority.

## Routing and Fallback Behavior

- `gvfs.prefetch.cache-server` routes `/gvfs/prefetch`.
- `gvfs.get.cache-server` routes object GET requests.
- `gvfs.post.cache-server` routes object POST requests.
- `gvfs.sizes.cache-server` routes `/gvfs/sizes`.
- If an endpoint-specific route is absent or fails, the request uses `gvfs.cache-server`.
- Sizes requests can additionally fall back from the global cache to origin.
- Existing repositories without endpoint overrides retain their previous behavior.

Endpoint-to-global transitions do not consume the process-wide circuit-breaker budget. Response-body transport failures can trigger fallback, while local processing failures remain on the current route. `OperationCanceledException` propagates without retry or fallback. Fallback and terminal prefetch diagnostics include only URI authority, excluding credentials, paths, queries, and fragments.

## Clone and Configuration Surface

`gvfs clone` accepts `--prefetch-cache-server-url`, `--get-cache-server-url`, `--post-cache-server-url`, and `--sizes-cache-server-url`. Values are stored in local Git config and malformed absolute URLs are rejected.

`gvfs cache-server --get` and `--set` continue to operate only on the global cache setting. Endpoint-specific values can be inspected or changed with `git config --local`.

## Related microsoft/git Changes

- [microsoft/git#836: gvfs-helper: add config to incrementally replace cache servers](microsoft/git#836)
- [microsoft/git#849: scalar: add endpoint cache-server clone options](microsoft/git#849)

## Tests

Coverage includes configuration precedence and persistence, mount-time resolution, clone option parsing and URL validation, endpoint/global/origin routing, HTTP and transport failures, response-body failures, local handler failures, cancellation propagation, telemetry redaction, terminal endpoint reporting, and circuit-breaker accounting.
Johannes Schindelin (dscho) added a commit that referenced this pull request Sep 22, 2026
In #836, we implemented custom gvfs.<verb>.cache-server config options
that allow existing enlistments to point specific GVFS Protocol verbs at
different cache servers. However, that did not help at clone time.

This change adds --<verb>-cache-server-url options to 'scalar clone' to
allow initial clones to take advantage of different cache servers.

The intended use here is to take advantage of new cache server
infrastructure as each protocol endpoint is deployed independently.

* [X] This change only applies to interactions with Azure DevOps and the
      GVFS Protocol.
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.

2 participants