dune-release icon indicating copy to clipboard operation
dune-release copied to clipboard

Weird URL leading to 404 on "dune-release publish distrib"

Open rlepigre opened this issue 5 years ago • 2 comments

The command dune-release publish distrib weirdly fails for me (on https://github.com/patoline/patoline), with a seemingly invalid value for user and repo (referring to the source code variable names).

# dune-release publish distrib --verbosity=debug
dune-release: [INFO] dune-release 1.1.0 running
dune-release: [EXEC:10690] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:10691] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [INFO] Parsing opam file patoline.opam
dune-release: [EXEC:10692] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:10693] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:10694] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:10695] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:10696] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:10697] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                            '0.2']
dune-release: [EXEC:10698] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:10699] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:10700] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:10701] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                            '0.2']
dune-release: [EXEC:10702] ['git' '--git-dir' '.git' 'push' '--force'
                            '[email protected]:patoline/patoline.git' '0.2']
Everything up-to-date
dune-release: [EXEC:10704] ['curl' '-L' '-s' '-S' '-K' '-' '-D' '-' '--data'
                            '{ "tag_name" : "0.2", "body" : "CHANGES:\n\nFirst reasonable release of Patoline, although it is still hard to use.\nHere are some of the latest changes:\n - Patoline is now built using dune,\n - the package structure has been cleaned,\n - GNU make wizardry has disappeared,\n - libraries are wrapped (use Typography.Document, Patoraw.RawContents, ...),\n - many things have been cleaned.\n" }'
                            'https://api.github.com/repos/releases/patoline-0.2/releases']
dune-release: [ERROR] Could not find release id in response:
                      HTTP/1.1 404 Not Found
                      Server: GitHub.com
                      Date: Fri, 23 Nov 2018 10:33:45 GMT
                      Content-Type: application/json;
                      charset=utf-8
                      Content-Length: 120
                      Status: 404 Not Found
                      X-RateLimit-Limit: 5000
                      X-RateLimit-Remaining: 4974
                      X-RateLimit-Reset: 1542971246
                      X-OAuth-Scopes: public_repo
                      X-Accepted-OAuth-Scopes: repo
                      X-GitHub-Media-Type: github.v3;
                      format=json
                      Access-Control-Expose-Headers: ETag, Link, Location,
                      Retry-After, X-GitHub-OTP, X-RateLimit-Limit,
                      X-RateLimit-Remaining, X-RateLimit-Reset,
                      X-OAuth-Scopes, X-Accepted-OAuth-Scopes,
                      X-Poll-Interval,
                      X-GitHub-Media-Type
                      Access-Control-Allow-Origin:
                      *
                      Strict-Transport-Security: max-age=31536000;
                      includeSubdomains; preload
                      X-Frame-Options: deny
                      X-Content-Type-Options: nosniff
                      X-XSS-Protection: 1; mode=block
                      Referrer-Policy: origin-when-cross-origin,
                      strict-origin-when-cross-origin
                      Content-Security-Policy: default-src
                      'none'
                      X-GitHub-Request-Id: E6C1:358E:252B44:69F1B6:5BF7D789
                      
                      {
                        "message": "Not Found",
                        "documentation_url":
                      "https://developer.github.com/v3/repos/releases/#create-a-release"
                      }
                      .

The corresponding dry-run yields:

# dune-release publish distrib --dry-run
=> must exists _build/patoline-0.2.tbz
-: exec: git --git-dir .git rev-parse --verify 0.2
-: exec: git --git-dir .git rev-parse --verify 0.2
-: exec:
     git --git-dir .git push --force [email protected]:patoline/patoline.git 0.2
=> read /home/rodolphe/.config/dune/github.token
=> read /home/rodolphe/.config/dune/github.token
-: exec:
     curl -L -s -S -K - -D - --data   { "tag_name" : "0.2", "body" : "CHANGES:\n\nFirst reasonable release of Patoline, although it is still hard to use.\nHere are some of the latest changes:\n - Patoline is now built using dune,\n - the package structure has been cleaned,\n - GNU make wizardry has disappeared,\n - libraries are wrapped (use Typography.Document, Patoraw.RawContents, ...),\n - many things have been cleaned.\n" }   https://api.github.com/repos/releases/patoline-0.2/releases
=> read /home/rodolphe/.config/dune/github.token
-: exec:
     curl -L -s -S -K - -H Content-Type:application/x-tar --data-binary   @_build/patoline-0.2.tbz   https://uploads.github.com/repos/releases/patoline-0.2/releases/0/assets?name=patoline-0.2.tbz

In particular, the url https://api.github.com/repos/releases/patoline-0.2/releases does not seem to be correct. The user is releases while it should be patoline and the repo is patoline-0.2 while it should be patoline.

All lints are good, and my patoline.opam file seems sensible:

synopsis: "Patoline typesetting system and libraries"
description:
"""
Patoline is a collection of typesetting libraries designed to be combined into
a variety of possible applications. Its primary goal is not to offer the
definitive answer to all typesetting problems, but rather to write the painful
and boring parts of the job, so that interesting tools could be written
easily. Obviously, a related (but much smaller) project is the Patoline
compiler, which compiles a mixed Wiki/LaTeX/Ocaml syntax into a variety of
output formats, including traditional PDF files, but also web servers that
deliver dynamic contents.
"""

opam-version: "2.0"
maintainer: "Rodolphe Lepigre <[email protected]>"
bug-reports: "https://github.com/patoline/patoline/issues"
homepage: "http://patoline.org"
dev-repo: "git+https://github.com/patoline/patoline.git"
authors: [
  "Pierre-Étienne Meunier"
  "Christophe Raffalli <[email protected]>"
  "Rodolphe Lepigre <[email protected]>"
  "Tom Hirschowitz" ]
license: "GPLv2"
doc: "https://patoline.github.io/patoline/"

depends: [
  "ocaml" { >= "4.03.0" }
  "dune" { build & >= "1.2.0" }
  "ocamlfind"
  "earley"  { >= "2.0.0"  }
  "camlzip"
  "sqlite3"
  "imagelib"
]

depopts: [
  "lablgl"
  "cairo2"
  "kryptokit"
]

build: [ [ "dune" "build" "-p" name "-j" jobs ] ]
run-test: [ [ "dune" "runtest" "-p" name "-j" jobs ] ]

Do you guys have any idea?

I don't know if this is a problem, but my GitHub token was generated while publishing a package hosted on my personal GitHub account. Here, the package is hosted on an organization that I am a part of.

There was no problem uploading the documentation to the correct location.

rlepigre avatar Nov 23 '18 10:11 rlepigre

Thanks for reporting and sorry for the delay. There has been quite a few changes since then. I'm closing this but please feel free to re-open should the issue arise again with the latest version!

NathanReb avatar Nov 22 '19 13:11 NathanReb

I'm running into this as well, with dune-release 1.4.0. Like @rlepigre, the problem happens with an organization-owned repository:

$ dune-release publish -t 0.1.1 --dry-run
[-] Skipping documentation publication for package clarity: no doc field in clarity.opam
[-] Publishing distribution
=> must exists _build/clarity-0.1.1.tbz
[-] Publishing to github
-: exec: git --git-dir .git rev-parse --verify 0.1.1
-: exec: git --git-dir .git rev-parse --verify 0.1.1
[?] Push tag 0.1.1 to [email protected]:weavery/clarity.ml.git? [Y/n] Y
[-] Pushing tag 0.1.1 to [email protected]:weavery/clarity.ml.git
-: exec:
     git --git-dir .git push --force [email protected]:weavery/clarity.ml.git 0.1.1
=> read /Users/arto/.config/dune/github.token
[?] Create release 0.1.1 on [email protected]:weavery/clarity.ml.git? [Y/n] Y
[-] Creating release 0.1.1 on [email protected]:weavery/clarity.ml.git via github's API
-: exec: curl --user weavery:${token} --location --silent --show-error --config
     - --dump-header - --data
     { "tag_name" : "0.1.1", "body" : "CHANGES:\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n" }
dune-release: [ERROR] Could not retrieve release ID from response

A clue could be that the credentials for the GitHub API are given as weavery:${token} in the curl command. Probably that should be artob:${token}? (In this case, @weavery is the organization in question, and @artob is my personal user account that the personal access token belongs to.)

artob avatar Sep 30 '20 20:09 artob