-
Found as apart of regression test of 1.9.3 release. Fixing it directly on mainline (wolsonsc).
Fix in Sztabina Go service:
func (s *Service) prepareRepo( ctx context.Context, gitURL string, username string, token string, ) (string, error) { authURL, err := util.CreateAuthenticatedURL(gitURL, username, token) if err != nil { return "", err } // ... existing code ... // Check if repo already exists if _, err := os.Stat(repoDir); err == nil { // CRITICAL FIX: Update remote URL with new credentials engine, err := exec.NewLocalGitEngine(repoDir, &exec.OSRunner{}) if err == nil { // Update the remote URL with current credentials engine.Git("remote", "set-url", "origin", authURL) } return s.refreshExistingRepo(repoDir) } // ... rest of existing code ... } -
| Type |
Bug
|
| Priority |
Major
|
| Assignee | |
| Version |
1.9.2
|
| Sprints |
n/a
|
| Customer |
n/a
|
Issue Votes (0)
Summary
Sztabina caches repository authentication credentials (PAT) during initial clone/prepare operations and does not refresh the token on subsequent operations (e.g., merge, push).
If the PAT is updated in Sztab (backend/DB), Sztabina continues using the stale cached credentials, leading to authentication failures during push.
This causes merge operations to fail even after credentials are corrected in the database.
Environment
Version: 1.9.2
Component: Sztabina (LocalGitEngine / prepareRepo logic)
Scenario: External Git repository (GitHub/OneDev) using PAT
Steps to Reproduce
Actual Behavior
/tmp/sztabina/{repo-id}.Expected Behavior
prepareRepoinvocation must ensure:Root Cause
Sztabina caches repository clone and does not reconfigure remote authentication on subsequent operations.
Credential state is effectively sticky inside cached clone.
Proposed Fix
In
prepareRepo(or equivalent initialization logic):GitUsernameandGitToken.Example conceptual change:
git remote set-url origin <authenticated-url>Impact
Blocks external Git workflows until manual intervention.
Estimated Fix Time
~30 minutes
prepareRepoto reapply credentials