purescript-contrib / governance

Guidelines and resources for the PureScript Contributors organization
15 stars 3 forks source link

`contrib-updater` looking for releases in the wrong spot #29

Closed maxdeviant closed 4 years ago

maxdeviant commented 4 years ago

I ran into this while migrating purescript-media-types to follow the Contributors library guidelines.

I had previously done much of the work to migrate the library by hand (before learning about contrib-updater), so I went back to run contrib-updater to fill in the gaps (mainly by generating the changelog).

Here is the command I ran:

contrib-updater generate --maintainer garyb --maintainer thomashoneyman

And I received this error:

Creating directory 'backups' for conflicting files.
/home/maxdeviant/projects/governance/updater/bin/index.js:1
module.exports=function(n,t){"use strict";var e={};function __webpack_require__(t){if(e[t]){return e[t].exports}var r=e[t]={i:t,l:false,exports:{}};var a=true;try{n[t].call(r.exports,r,r.exports,__webpack_require__);a=false}finally{if(a)delete e[t]}r.l=true;return r.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(932)}return startup()}({68:function(n,t,e){(function(){var t,r,a,o,u,i,c,l,s,f,v,p;c=function(){class XMLHttpRequestEventTarget{constructor(){this.onloadstart=null;this.onprogress=null;this.onabort=null;this.onerror=null;this.onload=null;this.ontimeout=null;this.onloadend=null;this._listeners={}}addEventListener(n,t){var e;n=n.toLowerCase();(e=this._listeners)[n]||(e[n]=[]);this._listeners[n].push(t);return void 0}removeEventListener(n,t){var e;n=n.toLowerCase();if(this._listeners[n]){e=this._listeners[n].indexOf(t);if(e!==-1){this._listeners[n].splice(e,1)}}return void 0}dispatchEvent(n){var t,e,

Error: Failed to fetch releases. Status 404
    at Object.n.error (/home/maxdeviant/projects/governance/updater/bin/index.js:1:101207)
    at /home/maxdeviant/projects/governance/updater/bin/index.js:1:346796
    at run (/home/maxdeviant/projects/governance/updater/bin/index.js:1:88053)
    at /home/maxdeviant/projects/governance/updater/bin/index.js:1:88546
    at drain (/home/maxdeviant/projects/governance/updater/bin/index.js:1:86988)
    at Object.enqueue (/home/maxdeviant/projects/governance/updater/bin/index.js:1:87117)
    at /home/maxdeviant/projects/governance/updater/bin/index.js:1:88500
    at /home/maxdeviant/projects/governance/updater/bin/index.js:1:100931
    at XMLHttpRequest.o.onload (/home/maxdeviant/projects/governance/updater/bin/index.js:1:15231)
    at XMLHttpRequest.dispatchEvent (/home/maxdeviant/projects/governance/updater/bin/index.js:1:1107)

After some debugging I realized that it was using the wrong repository name when trying to list the releases:

https://api.github.com/repos/purescript-contrib/media-types/releases?per_page=100&page=1 

It should be purescript-media-types, not just media-types. I suspect the fact that I partially ported the library by hand before running contrib-updater could be the source of this issue.

Running contrib-updater with the repo name didn't make a difference either:

contrib-updater generate --owner purescript-contrib --repo purescript-media-types --maintainer garyb --maintainer thomashoneyman

It looks like the issue is here:

appendReleaseInfoToChangelog { owner: variables.owner, repo: spago.name }

Should we be passing variables.repo as the repo instead of spago.name?

JordanMartinez commented 4 years ago

The repo argument needs to be the same as REPO in https://github.com/owner/REPO. Otherwise, the URLs will be wrong. I'm not sure whether that was my fault or or not.

maxdeviant commented 4 years ago

Based on that it seems like using spago.name would be incorrect, as we typically drop the purescript- prefix for Spago.

thomashoneyman commented 4 years ago

That argument ought to be variables.repo, which either uses the user's provided --repo argument or falls back to purescript-{{ spago.name }} and which is defined a few lines above.