WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Site help, bugs, suggestions/questions (https://www.wowinterface.com/forums/forumdisplay.php?f=18)
-   -   Duplicated changelog uploading via API (https://www.wowinterface.com/forums/showthread.php?t=58302)

LudiusMaximus 10-16-20 02:36 PM

Duplicated changelog uploading via API
 
When I use https://github.com/BigWigsMods/packager to upload my newest versions, I end up getting the provided changelog twice on my addon pages.

E.g.:
https://www.wowinterface.com/downloa...html#changelog

The code executed by the packager is this:

curl -sS --retry 3 --retry-delay 10 -w "%{http_code}" -o "/cygdrive/c/Program Files (x86)/Ludius/World of Warcraft/_retail_/Interface/AddOns/Bagnon_RequiredLevel/.release/wi_result.json" -H "x-api-token: NotPastingMyTokenHere" -F "id=24849" -F "version=1.16" -F "compatible=9.0.1" "-F changelog=</cygdrive/c/Program Files (x86)/Ludius/World of Warcraft/_retail_/Interface/AddOns/Bagnon_RequiredLevel/.release/WOWI-1.16-CHANGELOG.txt" -F "[email protected]/cygdrive/c/Program Files (x86)/Ludius/World of Warcraft/_retail_/Interface/AddOns/Bagnon_RequiredLevel/.release/Bagnon_RequiredLevel_1.16.zip" "https://api.wowinterface.com/addons/update"

The WOWI-1.16-CHANGELOG.txt file is not the problem. It includes the changelog only once.

What's going wrong here?


Also: Does the "compatible" tag have any purpose at all? If I use it like that, the client version of my addons do not get updated on WOWI.


Thanks!

Dolby 10-16-20 03:13 PM

2 Attachment(s)
Hmmm compatible seems to be working fine for my test addon...

just changing compatibility (it was previously at some 6.x release)
Code:

curl -H "x-api-token: <token>" -F "id=8163" -F "version=1234567899" -F "compatible=9.0.1" https://api.wowinterface.com/addons/update


This seems to be working for me.

What happens if you just only set the compatible tag? Wonder if something related to the changelog is messing up the setting of the compatible version?
Code:

curl -H "x-api-token: <your token>" -F "id=24849" -F "compatible=9.0.1" https://api.wowinterface.com/addons/update
I don't seem to be getting a double changelog either.

Code:

curl -H "x-api-token: <token>" -F "id=8163" -F "changelog=This is a test" https://api.wowinterface.com/addons/update


Maybe you need to cat out the .txt instead $(cat /path/to/changelog.txt)? I'll try doing it the way you are doing it and see if I can reproduce the issue.

Dolby 10-16-20 03:17 PM

I see funkydude has updated his addons via the api and the packager script and it doesnt look like there are any issues https://www.wowinterface.com/downloa...oice.html#info

I guess what could be different I am trying to think.

LudiusMaximus 10-16-20 03:25 PM

Thanks so far. Looking again at the curl call I posted:
Isn't it odd that the -F for my changelog is within the quotation marks??

Dolby 10-16-20 03:28 PM

Oh yeah, that might be it.

LudiusMaximus 10-16-20 03:49 PM

Hm, I'm not sure.

This seems to be the normal way this is done by the packager...

Code:

_wowi_args=()
    if [ -f "$wowi_changelog" ]; then
      _wowi_args+=("-F changelog=<$wowi_changelog")
    elif [ -n "$manual_changelog" ]; then
      _wowi_args+=("-F changelog=<$pkgdir/$changelog")
    fi


Code:

result=$( curl -sS --retry 3 --retry-delay 10 \
          -w "%{http_code}" -o "$resultfile" \
          -H "x-api-token: $wowi_token" \
          -F "id=$addonid" \
          -F "version=$archive_version" \
          "${_wowi_args[@]}" \
          -F "[email protected]$archive" \
          "https://api.wowinterface.com/addons/update" )


What else could it be?

LudiusMaximus 10-16-20 06:23 PM

It's getting more and more strange. I just updated
https://www.wowinterface.com/downloa...html#changelog
and this time the double changelog did not occur...

LudiusMaximus 10-17-20 06:21 PM

I also updated the addon I gave as an example above (https://www.wowinterface.com/downloa...html#changelog). This time the changelog was also only pasted once.

But the compatibility has still not been set automatically...

Dolby 10-17-20 06:26 PM

I haven't changed anything on my end.

Could it maybe be the content of the changelog that is not being escaped properly and causing the curl command to have issues?

Just trying to think of what would be different between addons where this is working just fine.

LudiusMaximus 10-17-20 06:28 PM

Possible. Is there a way I could experiment with this without messing with any of my actual addons?

Dolby 10-17-20 06:36 PM

1 Attachment(s)
If you'd like to upload a test addon I can keep it in the queue for awhile?

I did remember we are logging what we get from the API endpoint and yeah for some reason its not getting the compatibility number from you...


LudiusMaximus 10-17-20 06:48 PM

Oh damn, my bad!!

I forgot that I had commented out the "compatible" tag in my packager script for my classic addons (as you told me here: https://www.wowinterface.com/forums/...220#post336220). Guess I should make this such that it is at least applied for my retail addons.

(The curl instruction I posted above was a dump created by my script, in which I did not comment out the "compatibile" tag...)

Regarding the duplicate changelog: Let's see if it comes up again...


Sorry for the fuss and thank you so much for your support!


All times are GMT -6. The time now is 09:04 PM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI