git: Suggest merge commit message in remote (#36430)

Closes #ISSUE

Adds `merge_message` field to the `UpdateRepository` proto message so
that suggested merge messages are displayed in remote projects.

Release Notes:

- git: Fixed an issue where suggested merge commit messages would not
appear for remote projects
This commit is contained in:
Ben Kunkle 2025-08-18 21:08:20 -05:00 committed by GitHub
parent 6ee06bf2a0
commit 4abfcbaff9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 14 additions and 2 deletions

View file

@ -116,6 +116,7 @@ CREATE TABLE "project_repositories" (
"scan_id" INTEGER NOT NULL,
"is_deleted" BOOL NOT NULL,
"current_merge_conflicts" VARCHAR,
"merge_message" VARCHAR,
"branch_summary" VARCHAR,
"head_commit_details" VARCHAR,
PRIMARY KEY (project_id, id)

View file

@ -0,0 +1 @@
ALTER TABLE "project_repositories" ADD COLUMN "merge_message" VARCHAR;

View file

@ -349,11 +349,11 @@ impl Database {
serde_json::to_string(&repository.current_merge_conflicts)
.unwrap(),
)),
// Old clients do not use abs path, entry ids or head_commit_details.
// Old clients do not use abs path, entry ids, head_commit_details, or merge_message.
abs_path: ActiveValue::set(String::new()),
entry_ids: ActiveValue::set("[]".into()),
head_commit_details: ActiveValue::set(None),
merge_message: ActiveValue::set(None),
}
}),
)
@ -502,6 +502,7 @@ impl Database {
current_merge_conflicts: ActiveValue::Set(Some(
serde_json::to_string(&update.current_merge_conflicts).unwrap(),
)),
merge_message: ActiveValue::set(update.merge_message.clone()),
})
.on_conflict(
OnConflict::columns([
@ -515,6 +516,7 @@ impl Database {
project_repository::Column::AbsPath,
project_repository::Column::CurrentMergeConflicts,
project_repository::Column::HeadCommitDetails,
project_repository::Column::MergeMessage,
])
.to_owned(),
)
@ -990,6 +992,7 @@ impl Database {
head_commit_details,
scan_id: db_repository_entry.scan_id as u64,
is_last_update: true,
merge_message: db_repository_entry.merge_message,
});
}
}

View file

@ -793,6 +793,7 @@ impl Database {
abs_path: db_repository.abs_path,
scan_id: db_repository.scan_id as u64,
is_last_update: true,
merge_message: db_repository.merge_message,
});
}
}

View file

@ -16,6 +16,8 @@ pub struct Model {
pub is_deleted: bool,
// JSON array typed string
pub current_merge_conflicts: Option<String>,
// The suggested merge commit message
pub merge_message: Option<String>,
// A JSON object representing the current Branch values
pub branch_summary: Option<String>,
// A JSON object representing the current Head commit values