summaryrefslogtreecommitdiff
path: root/web/src/containers/project/ProjectVariant.jsx
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2022-10-11 16:34:29 -0700
committerJames E. Blair <jim@acmegating.com>2022-10-13 10:31:19 -0700
commite2a472bc9708c8f7b222b43a75540d64bef77d82 (patch)
treeb29ef2ba1cc7af429e68365cb126473389d2c046 /web/src/containers/project/ProjectVariant.jsx
parent4bda3e1969313d7046e54a4fbcb347217121aeeb (diff)
downloadzuul-e2a472bc9708c8f7b222b43a75540d64bef77d82.tar.gz
Change merge mode default based on driver
The default merge mode is 'merge-resolve' because it has been observed that it more closely matches the behavior of jgit in Gerrit (or, at least it did the last time we looked into this). The other drivers are unlikely to use jgit and more likely to use the default git merge strategy. This change allows the default to differ based on the driver, and changes the default for all non-gerrit drivers to 'merge'. The implementation anticipates that we may want to add more granularity in the future, so the API accepts a project as an argument, and in the future, drivers could provide a per-project default (which they may obtain from the remote code review system). That is not implemented yet. This adds some extra data to the /projects endpoint in the REST api. It is currently not easy (and perhaps not possible) to determine what a project's merge mode is through the api. This change adds a metadata field to the output which will show the resulting value computed from all of the project stanzas. The project stanzas themselves may have null values for the merge modes now, so the web app now protects against that. Change-Id: I9ddb79988ca08aba4662cd82124bd91e49fd053c
Diffstat (limited to 'web/src/containers/project/ProjectVariant.jsx')
-rw-r--r--web/src/containers/project/ProjectVariant.jsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/src/containers/project/ProjectVariant.jsx b/web/src/containers/project/ProjectVariant.jsx
index 51a093a32..36d2c09ce 100644
--- a/web/src/containers/project/ProjectVariant.jsx
+++ b/web/src/containers/project/ProjectVariant.jsx
@@ -22,7 +22,9 @@ function ProjectVariant(props) {
const { tenant, variant } = props
const rows = []
- rows.push({label: 'Merge mode', value: variant.merge_mode})
+ if (variant.merge_mode) {
+ rows.push({label: 'Merge mode', value: variant.merge_mode})
+ }
if (variant.templates.length > 0) {
const templateList = (