About API code comments and some behavior.
Mads Kiilerich
mads at kiilerich.com
Tue Dec 27 20:22:16 UTC 2022
On 18/12/2022 10:48, toras wrote:
> >> Attachment: fix-update_repo_group-2.patch
> >
> > Lots of things happening in that patch. Can you explain in more
> details what is changed and why ... and perhaps do it in several
> > simpler changesets?
...
> The second is to modify the log output.
> Sorry for the confusion, the change to the f string was just for my
> own viewing pleasure, not related to the issue.
Ok. But I will just start out by making this piece of code use lazy %s
expansion for logging like we do in all other places.
> The entities enumerated by recursive_groups_and_repos() to update the
> full path of the child elements are processed with log output, but the
> starting repository group has already had its entities updated before
> the loop.
> So, for example, updating the name from 'GroupA' to 'GroupB' will
> result in the following log output
> (Only the origin entity. Child elements are correct logs.)
>
> [kallithea.model.repo_group] Fixing group GroupB to new name GroupB
>
> The following logs should be correct.
>
> [kallithea.model.repo_group] Fixing group GroupA to new name GroupB
>
> For the purpose of logging the name before the change, the patch
> outputs the log before updating the entity and skips the originating
> entity in a loop process.
Right - thanks for clarifying. I applied fix doing just that, but also
made sure we don't do excessive logging when parameters specified
without changing.
Thanks for the contribution.
/Mads
More information about the kallithea-general
mailing list