##// END OF EJS Templates
pull-requests: properly save merge failure metadata. Before this change...
marcink -
r4471:0186d5e2 default
parent child Browse files
Show More
@@ -4134,6 +4134,23 b' class _PullRequestBase(BaseModel):'
4134 4134 return json.dumps(self.reviewer_data)
4135 4135
4136 4136 @property
4137 def last_merge_metadata_parsed(self):
4138 metadata = {}
4139 if not self.last_merge_metadata:
4140 return metadata
4141
4142 if hasattr(self.last_merge_metadata, 'de_coerce'):
4143 for k, v in self.last_merge_metadata.de_coerce().items():
4144 if k in ['target_ref', 'source_ref']:
4145 metadata[k] = Reference(v['type'], v['name'], v['commit_id'])
4146 else:
4147 if hasattr(v, 'de_coerce'):
4148 metadata[k] = v.de_coerce()
4149 else:
4150 metadata[k] = v
4151 return metadata
4152
4153 @property
4137 4154 def work_in_progress(self):
4138 4155 """checks if pull request is work in progress by checking the title"""
4139 4156 title = self.title.upper()
@@ -1600,7 +1600,7 b' class PullRequestModel(BaseModel):'
1600 1600 'source_ref': pull_request.source_ref_parts,
1601 1601 }
1602 1602 if pull_request.last_merge_metadata:
1603 metadata.update(pull_request.last_merge_metadata)
1603 metadata.update(pull_request.last_merge_metadata_parsed)
1604 1604
1605 1605 if not possible and target_ref.type == 'branch':
1606 1606 # NOTE(marcink): case for mercurial multiple heads on branch
General Comments 0
You need to be logged in to leave comments. Login now