Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GitHub Packages filenames. #11092

Merged

Conversation

MikeMcQuaid
Copy link
Member

They don't need escaped like the Bintray ones did.

Fixes #11090 (but note this may require the cache entry to be cleared and the package to be redownloaded).

They don't need escaped like the Bintray ones did.

Fixes #11090 (but note this may
require the cache entry to be cleared and the package to be
redownloaded).
@MikeMcQuaid MikeMcQuaid added the critical Critical change which should be shipped as soon as possible. label Apr 9, 2021
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

@MikeMcQuaid MikeMcQuaid merged commit b24581e into Homebrew:master Apr 9, 2021
@MikeMcQuaid MikeMcQuaid deleted the github_packages_bottle_filename branch April 9, 2021 15:54
@@ -281,6 +281,10 @@ def bintray
ERB::Util.url_encode("#{name}-#{version}#{extname}")
end

def github_packages
"#{name}--#{version}#{extname}"
Copy link
Member

@scpeters scpeters Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses two dashes, while the bintray name format only uses one dash. We have been following the bintray naming pattern in the osrf/simulation tap and upload our bottles with one dash to s3 (all bottles viewable at gazebosim.org/distributions/bottles-simulation).

Since this PR was merged, our bottles are being uploaded with two dashes, since we currently upload them using the bottle.tags.filename field in the json file (logic in upload script here).

I saw #11097 was made to fix bintray uploads via the upload_bottles method in bintray.rb, but the bottle.tags.filename json field still has two dashes.

So how many dashes are expected in bottle filenames?

Copy link
Member

@Bo98 Bo98 Apr 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So how many dashes are expected in bottle filenames?

This doesn't answer your question (you raise a good quesetion about handling backwards compatbility), but I can at least give some background:

The single dash has mostly been for backwards compatbility - it only applied to the remote filename. When dowloaded, it is actually stored with two dashes. There's no backwards compatibility concern with GitHub Packages, so we do not support single dash on that platform.

Copy link
Member

@carlocab carlocab Apr 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: #11106

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: #11106

thanks for pointing that out; that resolves the issue for me

Comment on lines -452 to +460
["#{image_name}/blobs/sha256:#{checksum}", filename]
["#{image_name}/blobs/sha256:#{checksum}", filename&.github_packages]
else
# TODO: this can be removed when we no longer use Bintray
filename
filename&.bintray

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using an internal tap and I think because of the change in this PR, I am now getting the following output in brew info --json=v1 <formula>:

...
    "bottle": {
      "stable": {
        "rebuild": 0,
        "root_url": "https://<domain>/homebrew/bottles",
        "files": {
          "catalina": {
            "cellar": "/usr/local/Cellar",
            "url": "https://<domain>/homebrew/bottles/",
            "sha256": "..."
          }
        }
      }
    },
 ...

Notice the bottle's URL is missing the actual full path and only contains the base URL. Is there a way we can restore this for third-party taps?

@github-actions github-actions bot added the outdated PR was locked due to age label May 13, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub packages: versioned formulae bottle names are displayed with escape characters when pouring bottle
6 participants