This commit is contained in:
mrT23
2024-02-25 10:45:15 +02:00
parent 984a2888ae
commit dad3d3429f
8 changed files with 22 additions and 27 deletions

View File

@ -51,15 +51,14 @@ class PRUpdateChangelog:
get_logger().info('Updating the changelog...')
relevant_configs = {'pr_update_changelog': dict(get_settings().pr_update_changelog),
'config': dict(get_settings().config)}
get_logger().debug("Relevant configs", configs=relevant_configs)
get_logger().debug("Relevant configs", artifacts=relevant_configs)
if get_settings().config.publish_output:
self.git_provider.publish_comment("Preparing changelog updates...", is_temporary=True)
await retry_with_fallback_models(self._prepare_prediction)
new_file_content, answer = self._prepare_changelog_update()
get_logger().debug(f"PR output", changlog=answer)
get_logger().debug(f"PR output", artifact=answer)
if get_settings().config.publish_output:
self.git_provider.remove_initial_comment()
@ -71,7 +70,7 @@ class PRUpdateChangelog:
async def _prepare_prediction(self, model: str):
self.patches_diff = get_pr_diff(self.git_provider, self.token_handler, model)
if self.patches_diff:
get_logger().debug(f"PR diff", diff=self.patches_diff)
get_logger().debug(f"PR diff", artifact=self.patches_diff)
self.prediction = await self._get_prediction(model)
else:
get_logger().error(f"Error getting PR diff")