Le 26/11/2018 à 07:04, Xavier a écrit :
> Le 25/11/2018 à 23:25, Raphael Hertzog a écrit :
>> On Sun, 25 Nov 2018, Xavier wrote:
>>> My last change produces this bug. Fixed now, I pushed a new .deb in the
>>> same place.
>>
>> Next try with a package whose HEAD points to the wrong branch (upstream)
>> but that already has the desired target branch (debian/master)
>>
>> $ salsa --conf-file +./salsa-pkg-security.conf update_safe radare2-cutter 
>> --verbose --debug
>> salsa info: Project radare2-cutter => pkg-security-team/radare2-cutter
>> salsa info: pkg-security-team/radare2-cutter id is 29721
>> radare2-cutter:
>>      bad description: Packaging for cutter from radare project
>>      Default branch is upstream
>> 1 packages misconfigured, update them ? (Y/n)
>> salsa info: Project radare2-cutter => pkg-security-team/radare2-cutter
>> salsa info: Configuring radare2-cutter
>> salsa warn: Error POSTing 
>> https://salsa.debian.org/api/v4/projects/29721/repository/branches (HTTP 
>> 400): Bad Request {"message":"Branch already exists"} at 
>> /usr/share/perl5/Devscripts/Salsa/update_repo.pm line 51.
>>
>> Now a well configured repository but I inversed SOURCE_BRANCH and 
>> DEST_BRANCH. The operation
>> seems to work:
>> $ salsa --conf-file +./salsa-pkg-security.conf update_safe acct --verbose 
>> --debug
>> salsa info: Project acct => pkg-security-team/acct
>> salsa info: pkg-security-team/acct id is 6641
>> acct:
>>      Default branch is debian/master
>> 1 packages misconfigured, update them ? (Y/n) 
>> salsa info: Project acct => pkg-security-team/acct
>> salsa info: Configuring acct
>> salsa warn: Deleting old email-on-push (redirected to 
>> dispa...@tracker.debian.org)
>> salsa info: Email-on-push hook added to project 6641 (recipients: 
>> dispa...@tracker.debian.org)
>> salsa warn: Deleting old tagpending (was 
>> https://webhook.salsa.debian.org/tagpending/acct)
>> salsa info: Tagpending hook added to project 6641
>> salsa info: Project 6641 updated
>>
>> Now I put SOURCE_BRANCH and DEST_BRANCH to their desired value and the next 
>> run doesn't work:
>> $ salsa --conf-file +./salsa-pkg-security.conf update_safe acct --verbose 
>> --debug
>> salsa info: Project acct => pkg-security-team/acct
>> salsa info: pkg-security-team/acct id is 6641
>> acct:
>>      Default branch is master
>> 1 packages misconfigured, update them ? (Y/n) 
>> salsa info: Project acct => pkg-security-team/acct
>> salsa info: Configuring acct
>> salsa warn: Error POSTing 
>> https://salsa.debian.org/api/v4/projects/6641/repository/branches (HTTP 
>> 400): Bad Request {"message":"Branch already exists"} at 
>> /usr/share/perl5/Devscripts/Salsa/update_repo.pm line 51.
>>
>> Maybe you should separate the "rename branch" operation from the "set HEAD 
>> to"
>> operation. Because we want to fix HEAD pointing to the wrong branch even when
>> there's nothing to rename. And it could be useful for example to rename all
>> "upstream" into "upstream/latest" for example (without changing HEAD).
>>
>> SALSA_RENAME_BRANCH="upstream:upstream/latest master:debian/master"
>> SALSA_SET_HEAD="debian/master"
>>
>> Cheers,
> 
> Hello,
> 
> half fixed:
>  - "rename head" is tried even if branch already exists
>  - original branch is deleted only if new branch creation was successful
>  - I'll write a separate "rename" command to rename another branch.
>  - .deb updated
> 
> Cheers,

Done: I added a "rename_branch" command:
 - rename_head:
   * tries to create new branch and ignores failures
   * move default_branch to new value
   * deletes old branch only if creation succeeds
 - rename_branch:
   * creates new_branch and deletes oldest. Fails on first error

If '--no-fail' is used, both continues with next repo.

New .deb is building, I'll push it at ~12:00 GMT+1

Reply via email to