From 57d739a848dc96a4d38b7ae6f8d3a61b69c2467c Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Mon, 15 Aug 2022 15:43:37 +0200 Subject: [PATCH 1/4] Move source of truth for latest.json url into ApplicationMetadata.py and out of the Uranium repository. CURA-9272 --- cura/ApplicationMetadata.py | 8 ++++++++ cura/CuraApplication.py | 1 + 2 files changed, 9 insertions(+) diff --git a/cura/ApplicationMetadata.py b/cura/ApplicationMetadata.py index 60d9201d8e..678f8b7e4a 100644 --- a/cura/ApplicationMetadata.py +++ b/cura/ApplicationMetadata.py @@ -9,12 +9,20 @@ DEFAULT_CURA_DISPLAY_NAME = "Ultimaker Cura" DEFAULT_CURA_VERSION = "dev" DEFAULT_CURA_BUILD_TYPE = "" DEFAULT_CURA_DEBUG_MODE = False +DEFAULT_CURA_LATEST_URL = "https://raw.githubusercontent.com/Ultimaker/Uranium/CURA-9272_semver_postfix/tests/latest.json" # Each release has a fixed SDK version coupled with it. It doesn't make sense to make it configurable because, for # example Cura 3.2 with SDK version 6.1 will not work. So the SDK version is hard-coded here and left out of the # CuraVersion.py.in template. CuraSDKVersion = "8.1.0" +try: + from cura.CuraVersion import CuraLatestURL + if CuraLatestURL == "": + CuraLatestURL = DEFAULT_CURA_LATEST_URL +except ImportError: + CuraLatestURL = DEFAULT_CURA_LATEST_URL + try: from cura.CuraVersion import CuraAppName # type: ignore if CuraAppName == "": diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index eeaead4f71..94492d22c8 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -152,6 +152,7 @@ class CuraApplication(QtApplication): super().__init__(name = ApplicationMetadata.CuraAppName, app_display_name = ApplicationMetadata.CuraAppDisplayName, version = ApplicationMetadata.CuraVersion if not ApplicationMetadata.IsAlternateVersion else ApplicationMetadata.CuraBuildType, + latest_url = ApplicationMetadata.CuraLatestURL, api_version = ApplicationMetadata.CuraSDKVersion, build_type = ApplicationMetadata.CuraBuildType, is_debug_mode = ApplicationMetadata.CuraDebugMode, From a20e7bf8d9792c81e655c2003e55d7f12daa6ff2 Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Mon, 15 Aug 2022 15:59:08 +0200 Subject: [PATCH 2/4] Add cura latest.json url to template so it can be set from the conanfile. CURA-9272 --- CuraVersion.py.jinja | 1 + conanfile.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CuraVersion.py.jinja b/CuraVersion.py.jinja index 1c30a0b5af..1c8ff0551c 100644 --- a/CuraVersion.py.jinja +++ b/CuraVersion.py.jinja @@ -11,3 +11,4 @@ CuraCloudAPIVersion = "{{ cura_cloud_api_version }}" CuraCloudAccountAPIRoot = "{{ cura_cloud_account_api_root }}" CuraMarketplaceRoot = "{{ cura_marketplace_root }}" CuraDigitalFactoryURL = "{{ cura_digital_factory_url }}" +CuraLatestURL = "{{ cura_latest_url }}" diff --git a/conanfile.py b/conanfile.py index a07500e17a..87dfd175ad 100644 --- a/conanfile.py +++ b/conanfile.py @@ -100,6 +100,10 @@ class CuraConan(ConanFile): def _digital_factory_url(self): return "https://digitalfactory-staging.ultimaker.com" if self._staging else "https://digitalfactory.ultimaker.com" + @property + def _cura_latest_url(self): + return "https://raw.githubusercontent.com/Ultimaker/Uranium/CURA-9272_semver_postfix/tests/latest.json" + @property def requirements_txts(self): if self.options.devtools: @@ -161,7 +165,8 @@ class CuraConan(ConanFile): cura_cloud_api_version = self.options.cloud_api_version, cura_cloud_account_api_root = self._cloud_account_api_root, cura_marketplace_root = self._marketplace_root, - cura_digital_factory_url = self._digital_factory_url)) + cura_digital_factory_url = self._digital_factory_url, + cura_latest_url = self._cura_latest_url)) def _generate_pyinstaller_spec(self, location, entrypoint_location, icon_path, entitlements_file): pyinstaller_metadata = self._um_data()["pyinstaller"] From 5900cac9c8b7bd7a7885a221084e7b41140a61de Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Mon, 15 Aug 2022 16:00:14 +0200 Subject: [PATCH 3/4] Default the prerelease number to 1 when it is not set in the github tags. CURA-9272 --- .github/workflows/conan-recipe-version.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/conan-recipe-version.yml b/.github/workflows/conan-recipe-version.yml index 5a24754f03..3ab3d59547 100644 --- a/.github/workflows/conan-recipe-version.yml +++ b/.github/workflows/conan-recipe-version.yml @@ -135,6 +135,9 @@ jobs: user = "_" channel = "_" else: + if not latest_branch_version.prerelease.contains("."): + # The prerealese did not contain a version number, default it to 1 + latest_branch_version.prerelease.append(".1") if event_name == "pull_request": actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{buildmetadata}pr_{issue_number}_{no_commits}" else: From 3413caab6218d550bbc9f0ebc9d266394a0ca686 Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Mon, 22 Aug 2022 16:29:08 +0200 Subject: [PATCH 4/4] Set latest.json location back to ultimaker website. CURA-9272 --- conanfile.py | 2 +- cura/ApplicationMetadata.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index ca835a53fc..bcdaeda5d9 100644 --- a/conanfile.py +++ b/conanfile.py @@ -102,7 +102,7 @@ class CuraConan(ConanFile): @property def _cura_latest_url(self): - return "https://raw.githubusercontent.com/Ultimaker/Uranium/CURA-9272_semver_postfix/tests/latest.json" + return "https://software.ultimaker.com/latest.json" @property def requirements_txts(self): diff --git a/cura/ApplicationMetadata.py b/cura/ApplicationMetadata.py index 678f8b7e4a..4938d569e7 100644 --- a/cura/ApplicationMetadata.py +++ b/cura/ApplicationMetadata.py @@ -9,7 +9,7 @@ DEFAULT_CURA_DISPLAY_NAME = "Ultimaker Cura" DEFAULT_CURA_VERSION = "dev" DEFAULT_CURA_BUILD_TYPE = "" DEFAULT_CURA_DEBUG_MODE = False -DEFAULT_CURA_LATEST_URL = "https://raw.githubusercontent.com/Ultimaker/Uranium/CURA-9272_semver_postfix/tests/latest.json" +DEFAULT_CURA_LATEST_URL = "https://software.ultimaker.com/latest.json" # Each release has a fixed SDK version coupled with it. It doesn't make sense to make it configurable because, for # example Cura 3.2 with SDK version 6.1 will not work. So the SDK version is hard-coded here and left out of the