About API code comments and some behavior.

toras toras9000 at gmail.com
Thu Dec 29 17:02:17 UTC 2022


Hi

Thank you for your time and taking care of this.


On 2022/12/28 5:22, Mads Kiilerich wrote:
> 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
> 
-- 
toras9000



More information about the kallithea-general mailing list