Error parsing /devel/website/stats folders in check_trans.pl (was: Re: website check_trans.pl cronjob for Italian not running)

Laura Arjona Reina <[email protected]>
Newsgroups gmane.linux.debian.devel.www
Message-ID <[email protected]>
Hello


El 3/7/24 a las 12:09, Laura Arjona Reina escribió:
> Hello
> El 3/7/24 a las 9:43, Giuseppe Sacco escribió:
>> Hello,
>> as an Italian translator of the web site, I used to receive weekly 
>> reports
>> about the translation status, but this is not working since the 17th of
>> November. That's not just me: none of the Italian translators receive 
>> them,
>> neither the italian-l10n list.
>>
>> Does it still works for other countries? Could anyone check what's 
>> going on?
>>
>> Thank you,
>> Giuseppe
>>
> I have checked that the cron jobs for check_trans.pl in www-master are 
> still scheduled.
>
> I have run it manually (the "daily" version) and found several 
> errors/warnings:
>
> ---
>
> count_changes() ERROR: commit rev2 HEAD not found in revisions of 
> english/xxxx (wml files in english folder)
>
> Use of uninitialized value $delta in numeric ge (>=) at 
> ./check_trans.pl line 401.
>
> syntax error at ./chinese/international/chinese/translator.db.pl line 
> 45, near "compress"
> syntax error at ./chinese/international/chinese/translator.db.pl line 
> 111, near "}"
> Compilation failed in require at ./check_trans.pl line 1024.
>
> Undefined subroutine &main::croak called at ./check_trans.pl line 1238.
> Can't use an undefined value as a HASH reference at 
> /srv/www.debian.org/webwml/Perl/Local/VCS_git.pm line 559.
>
> ---
>
> but the script goes on and seems to finish without any more errors.
>
> I'll try to fix these errors (not sure if they are the cause of the 
> issues).

I have reduced the errors of the check_trans.pl script to:

Can't use an undefined value as a HASH reference at 
/srv/www.debian.org/webwml/Perl/Local/VCS_git.pm line 559.

This indeed seems to be the cause of the script not sending mails; I 
have run in www-master a manual check for Spanish with -g option (that 
would output the mails to the screen instead of sending them) and after 
the error no output is shown, but if I add a -s subfolder option I have 
tried with several subfolders and mails would be sent, except for the 
"devel" folder. I have narrowed the issue to the /devel/website/stats 
folder, adding it to the global .transignore file avoids the error so 
the script can continue (at least for Spanish) until the step of sending 
mails.

I guess the issue was introduced around mid-November when the generation 
of those pages (website stats) was changed/simplified, and the 
check_trans.pl script tries to get the diff of the VCS revisions and 
fails because those files have no commit history.

I am not sure about the best way of solving this, several options come 
to mind:

1.- Ideally we should update /Perl/Local/VCS_git.pm line 559 and 
sorroundings adding code to avoid the use of undefined value, but that 
Perl Module is used in a lot of other places/scripts and I'm not a Perl 
expert so I fear to break other things. CC'ing Steve McIntyre because he 
did the invaluable task of porting that code in the CVS->git migration 
for the case he can help (but first look at the other options I see, 
maybe they are better than this).

2.- Adding some more code to the check_trans.pl file around Line 184:

     # Global .transignore
     my $transignore = Webwml::TransIgnore->new($VCS->get_topdir());

to add "/devel/website/stats" to the list of the $transignore variable 
(in addition to what it gets from the global .transignore file in webwml 
top folder).

I don't know how to do this either, but if nobody steps ahead and this 
is the preferred solution, I can try to figure out :-)

3.- Just add /devel/website/stats to the global webwml/.transignore file 
so it's taken into account by the script (as I have done temporarily in 
www-master to do the tests (changes undone)). I don't know what it would 
mean for the rest of translation scripts (I guess it should be safe 
because the files under /devel/website/stats are generated and 
translation of those strings depends on the stats.$ll.po files and those 
files are in $ll/po folder so their status is taken into account. But 
CC'ing Thomas Lange who did the last important research on the 
transignore files for the case he can help).

4.- Any other?

If there is not resolution of this issue in several days, I will open a 
bug report with the status quo so it does not get forgotten.

Kind regards
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.