Fix git/storage workflows: repos-only page, default dev branch, robust pull/push, and storage path resolution

This commit is contained in:
2026-03-04 19:18:58 +03:00
parent 4fec2e02ad
commit 7ff0dfa8c6
10 changed files with 658 additions and 63 deletions

View File

@@ -146,6 +146,19 @@ export const gitService = {
});
},
/**
* [DEF:getRepositoryBinding:Function]
* @purpose Fetches repository binding metadata (config/provider) for dashboard.
* @pre Repository should be initialized for dashboard.
* @post Returns provider and config details for current repository.
* @param {string|number} dashboardRef - Dashboard slug or id.
* @returns {Promise<Object>} Repository binding payload.
*/
async getRepositoryBinding(dashboardRef, envId = null) {
console.log(`[getRepositoryBinding][Action] Fetching repository binding for dashboard ${dashboardRef}`);
return requestApi(buildDashboardRepoEndpoint(dashboardRef, '', envId));
},
/**
* [DEF:getBranches:Function]
* @purpose Retrieves the list of branches for a dashboard's repository.
@@ -219,6 +232,19 @@ export const gitService = {
return requestApi(buildDashboardRepoEndpoint(dashboardRef, '/push', envId), 'POST');
},
/**
* [DEF:deleteRepository:Function]
* @purpose Deletes local repository binding and workspace for dashboard.
* @pre Dashboard reference must resolve on backend.
* @post Repository record and local folder are removed.
* @param {string|number} dashboardRef - Dashboard slug or id.
* @returns {Promise<Object>} Deletion result.
*/
async deleteRepository(dashboardRef, envId = null) {
console.log(`[deleteRepository][Action] Deleting repository for dashboard ${dashboardRef}`);
return requestApi(buildDashboardRepoEndpoint(dashboardRef, '', envId), 'DELETE');
},
/**
* [DEF:pull:Function]
* @purpose Pulls changes from the remote repository.