dev-preprod-prod logic
This commit is contained in:
@@ -335,6 +335,21 @@ export const gitService = {
|
||||
if (envId) params.append('env_id', String(envId));
|
||||
if (params.toString()) endpoint += `?${params.toString()}`;
|
||||
return requestApi(endpoint);
|
||||
},
|
||||
|
||||
/**
|
||||
* [DEF:promote:Function]
|
||||
* @purpose Promotes changes between branches via MR or direct merge.
|
||||
* @pre Dashboard repository must be initialized.
|
||||
* @post Returns promotion metadata (MR URL or direct merge status).
|
||||
* @param {string|number} dashboardRef - Dashboard slug or id.
|
||||
* @param {Object} payload - {from_branch,to_branch,mode,title,description,reason,draft,remove_source_branch}
|
||||
* @param {string|null} envId - Environment id for slug resolution.
|
||||
* @returns {Promise<Object>} Promotion result.
|
||||
*/
|
||||
async promote(dashboardRef, payload, envId = null) {
|
||||
console.log(`[promote][Action] Promoting ${payload?.from_branch} -> ${payload?.to_branch} for dashboard ${dashboardRef} mode=${payload?.mode}`);
|
||||
return requestApi(buildDashboardRepoEndpoint(dashboardRef, '/promote', envId), 'POST', payload);
|
||||
}
|
||||
};
|
||||
// [/DEF:gitService:Action]
|
||||
|
||||
Reference in New Issue
Block a user