diff --git a/CHANGELOG.md b/CHANGELOG.md index 92568026..54e24a63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - After a SAML login, `cloudsmith auth` saves the Workspace to `config.ini`. It writes to the `[profile:NAME]` section of the selected profile, or to `[default]` when you do not select a profile. The CLI writes to the file or directory that `--config-file` gives, or else to your user-level `config.ini`. If the `config.ini` does not exist, the CLI creates it. - Using `#!/usr/bin/env sh` as shebang path for unix credential helpers. - The minimum version of `cloudsmith-api` is now 2.0.42. +- The update notice and `cloudsmith update` now link to the version's entry in the Cloudsmith changelog (`https://cloudsmith.com/changelog/cli-v--`) instead of its GitHub release page. ### Deprecated diff --git a/cloudsmith_cli/core/installation.py b/cloudsmith_cli/core/installation.py index 45ed2c74..5a49ed4c 100644 --- a/cloudsmith_cli/core/installation.py +++ b/cloudsmith_cli/core/installation.py @@ -21,24 +21,23 @@ #: Where a user downloads a fresh standalone build when self-update cannot run. RELEASES_LATEST_URL = "https://github.com/cloudsmith-io/cloudsmith-cli/releases/latest" -#: Base for a version's GitHub release page. Each release is tagged ``v`` -#: and its page renders that version's changelog, so it answers "what do I gain -#: by upgrading?" for the exact version being offered. -_RELEASE_TAG_URL_TEMPLATE = ( - "https://github.com/cloudsmith-io/cloudsmith-cli/releases/tag/v{version}" -) +#: Base for a version's changelog entry on cloudsmith.com. Each entry's slug is +#: ``cli-v--``, so it answers "what do I gain by +#: upgrading?" for the exact version being offered. +_CHANGELOG_URL_TEMPLATE = "https://cloudsmith.com/changelog/cli-v{version}" def changelog_url(version=None): - """Return the changelog URL for ``version`` (its release page), or the list. + """Return the changelog URL for ``version``, or the releases listing. - With a version, points at that version's release page (tagged - ``v``), which shows exactly what changed. Without one, points at - the releases listing. + With a version, points at that version's changelog entry + (``cli-v--``), which shows exactly what changed. + Without one, points at the releases listing. """ if not version: return RELEASES_LATEST_URL - return _RELEASE_TAG_URL_TEMPLATE.format(version=str(version).lstrip("v")) + slug = str(version).lstrip("v").replace(".", "-") + return _CHANGELOG_URL_TEMPLATE.format(version=slug) _UPGRADE_INSTRUCTIONS = { diff --git a/cloudsmith_cli/core/tests/test_installation.py b/cloudsmith_cli/core/tests/test_installation.py index 0e1d7260..b8169552 100644 --- a/cloudsmith_cli/core/tests/test_installation.py +++ b/cloudsmith_cli/core/tests/test_installation.py @@ -140,10 +140,16 @@ def test_channels_return_instruction(self, channel): class TestChangelogUrl: @pytest.mark.parametrize("version", ["2.0.0", "v2.0.0"]) - def test_points_at_release_tag(self, version): + def test_points_at_changelog_entry(self, version): assert ( installation.changelog_url(version) - == "https://github.com/cloudsmith-io/cloudsmith-cli/releases/tag/v2.0.0" + == "https://cloudsmith.com/changelog/cli-v2-0-0" + ) + + def test_multi_digit_parts(self): + assert ( + installation.changelog_url("1.12.3") + == "https://cloudsmith.com/changelog/cli-v1-12-3" ) @pytest.mark.parametrize("version", [None, ""])