Skip to content

[CP] Fix "dart pub publish" to 3rd-party package repository with path in the hosted-url #47815

Description

@jonasfj

commit(s) to merge: sdk/+/221626 adds the following commit dart-lang/pub@b9edfa5 to pub (on-top of the previous cherry-pick).

merge instructions: Should merge clean.

What is the issue: Running dart pub publish with a custom pub package server that has a URL containing a path will not work.

What is the fix: Instead of uri.resolve('/api/versions/new') we do uri.resolve('api/versions/new'). Such that PUB_HOSTED_URL=https://pub.example.com/user becomes https://pub.example.com/user/api/versions/new.
Note, we've already normalized PUB_HOSTED_URL and publish_to URLs to always end in slash, if path is non-empty, see validateAndNormalizeHostedUrl.

Why cherrypick: Efforts of cloudsmith to finish support for publishing from pub command line is blocked this, as they have organization and repository embedded in the URL.

Risk: Small, the official pub repository URL doesn't have path segments so the change has no effect there.

/cc @mit-mit @whesse @athomas @vsmenon @devoncarew

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.cherry-pick-approvedLabel for approved cherrypick requestmerge-to-stable

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions