Skip to content

refactor: refresh git cache remote URL on fetch - #1738

Draft
Skisocks wants to merge 1 commit into
jenkins-x:mainfrom
spring-financial-group:refactor/GitCacheTokens
Draft

Skisocks wants to merge 1 commit into
jenkins-x:mainfrom
spring-financial-group:refactor/GitCacheTokens

Conversation

@Skisocks

@Skisocks Skisocks commented Dec 1, 2026

Copy link
Copy Markdown
Member

Changelog

  • Point a cached repo's origin at a freshly resolved URL before fetching, so the fetch uses the current token.
  • Covers the v2 mirror cache (RemoteUpdate) and the v1 client (Clone, SparseClone).

Context

Groundwork for GitHub App support. Follow-up to #1728, which noted that repos already in a git cache keep the token they were cloned with.

The cache stores the URL it was cloned from, token included (https://bot:<token>@github.com/org/repo). git remote update and git fetch reuse it. Installation tokens expire after an hour, so without this cached repos would stop fetching.

@jenkins-x-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
The changes made require 1 more approval(s).
To complete the pull request process, please assign skisocks
You can assign the PR to them by writing /assign @skisocks in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants