diff --git a/CHANGELOG.md b/CHANGELOG.md index f688857a..1a843ca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file. This change The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 7.3.0 - 2024-04-23 + +### Added + +* added support for Cataclysm Classic. + +### Changed + +* dependencies bumped to latest versions. +* game track priority when 'strict' is off now has a proper and consistent strategy. + +### Fixed + +* bumps Clojure from 1.10 to 1.11.2 to fix CVE-2024-22871 + - https://github.com/advisories/GHSA-vr64-r9qj-h27f +* an Arch Linux AUR bug introduced with pacman 6.1 that stripped the binary down to nothing. + - thanks to @nickromanooo for reporting the bug and tracking down the pacman issue. + ## 7.2.0 - 2023-12-24 ### Added diff --git a/README.md b/README.md index 04bf66e3..89ab1f6f 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ I also maintain a list of [other addon managers](https://ogri-la.github.io/wow-a Strongbox is available as a standalone [AppImage](https://appimage.org) binary from the [releases](https://github.com/ogri-la/strongbox/releases/) page. - chmod +x strongbox - ./strongbox + chmod +x strongbox-x.x.x-x86_64.AppImage + ./strongbox-x.x.x-x86_64.AppImage ### Arch Linux and the AUR @@ -187,10 +187,11 @@ This will restrict the types of addons that can be installed in the current addo The `Strict` checkbox allows you to enforce or relax restrictions and mix together addons meant for different systems in the same addon directory. If an addon is available for multiple addon systems it will prefer one over another: -* `retail` will prefer `retail` addons, then `classic`, then `classic (TBC)` then `classic (WotLK)` -* `classic` will prefer `classic` addons, then `classic (TBC)` then `classic (WotLK)` then `retail` -* `classic (TBC)` will prefer `classic (TBC)` addons, then `classic (WotLK)` then `classic` then `retail` -* `classic (WotLK)` will prefer `classic (WotLK)` addons, then `classic (TBC)` then `classic` then `retail` +* `retail` will prefer `retail` addons, then `classic`, then `classic (TBC)` then `classic (WotLK)` then `classic (Cata)` +* `classic` will prefer `classic` addons, then `classic (TBC)`, then `classic (WotLK)`, then `classic (Cata)` then `retail` +* `classic (TBC)` will prefer `classic (TBC)` addons, then `classic (WotLK)`, then `classic (Cata)`, then `classic` then `retail` +* `classic (WotLK)` will prefer `classic (WotLK)` addons, then `classic (Cata)`, then `classic (TBC)`, then `classic` then `retail` +* `classic (Cata)` will prefer `classic (Cata)` addons, then `classic (WotLK)`, then `classic (TBC)`, then `classic` then `retail` If uncertain which addon system an installed addon supports, look at the `WoW` column value on the `installed` tab and compare it to the `Version` value in the list of WoW [public client builds](https://wowpedia.fandom.com/wiki/Public_client_builds). diff --git a/TODO.md b/TODO.md index 1c5dd7a3..28097d71 100644 --- a/TODO.md +++ b/TODO.md @@ -6,22 +6,24 @@ see CHANGELOG.md for a more formal list of changes by release ## done -* move Dockerfile* files into a CircleCI folder +* rename `strongbox` release to `strongbox.AppImage` + - re-submit + - update release scripts - done + - https://appimage.github.io/strongbox/ -* toc, what is the usage of 'x-github'. we're expecting a url but a foo/bar seems fine as well - - check the github catalogue - - I'm seeing more usage of 'x-website' +* update release script + - update references from 'strongbox' to 'strongbox.AppImage' - done -* *.sh, consolidate these root-level bash scripts into a manage.sh +* cataclysm classic support - done ## todo ## todo bucket (no particular order) -* cataclysm classic support +* gui, 'set-icon' is taking a long time to do it's thing. * nfo, replace the URL as the group-id with something random @@ -33,13 +35,6 @@ see CHANGELOG.md for a more formal list of changes by release * no errors displayed when installing from addon detail page -* rename `strongbox` release to `strongbox.AppImage` - - re-submit - - update release scripts - -* update release script - - update references from 'strongbox' to 'strongbox.AppImage' - * generate a `.flatpakref` file as an asset for release. - https://docs.flatpak.org/en/latest/repositories.html#flatpakref-files @@ -80,9 +75,6 @@ see CHANGELOG.md for a more formal list of changes by release - user can opt to install alpha/beta releases per-addon - make it a simple preference -* gui, 'set-icon' is taking a long time to do it's thing. - - * manually select the primary addon in a group of addons to prevent synthetic titles * http, add with-backoff support to download-file @@ -208,7 +200,6 @@ see CHANGELOG.md for a more formal list of changes by release * preference for 'fat rows' - increase the padding for each row a bit - * "developer warnings" - a preference that bumps certain debug messages to warnings and errors for developers - like if a release.json is missing assets diff --git a/pom.xml b/pom.xml index 87a19d37..90b6aec4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ ogri-la strongbox jar - 7.2.0 + 7.3.0 strongbox World Of Warcraft Addon Manager https://github.com/ogri-la/strongbox @@ -18,7 +18,7 @@ https://github.com/ogri-la/strongbox scm:git:git://github.com/ogri-la/strongbox.git scm:git:ssh://git@github.com/ogri-la/strongbox.git - b576cac556bd51217f1d0f1e5499c1a18a6c25e3 + 86204296a94b4e5b4621bd143daa693f1f4934de src @@ -78,22 +78,22 @@ org.clojure clojure - 1.10.3 + 1.11.2 org.clojure tools.cli - 1.0.219 + 1.1.230 org.clojure tools.namespace - 1.4.4 + 1.5.0 org.clojure data.json - 2.4.0 + 2.5.0 orchestra @@ -103,7 +103,7 @@ com.taoensso timbre - 5.1.2 + 6.5.0 clj-http @@ -113,7 +113,7 @@ clj-commons fs - 1.6.310 + 1.6.311 slugify @@ -133,7 +133,7 @@ clojure.java-time clojure.java-time - 1.2.0 + 1.4.2 envvar @@ -143,12 +143,12 @@ tolitius lasync - 0.1.24 + 0.1.25 cljfx cljfx - 1.7.23 + 1.8.0 javafx-web @@ -168,68 +168,68 @@ org.openjfx javafx-base - 19.0.2.1 + 20-ea+1 org.openjfx javafx-base - 19.0.2.1 + 20-ea+1 linux org.openjfx javafx-base - 19.0.2.1 + 20-ea+1 mac org.openjfx javafx-controls - 19.0.2.1 + 20-ea+1 org.openjfx javafx-controls - 19.0.2.1 + 20-ea+1 linux org.openjfx javafx-controls - 19.0.2.1 + 20-ea+1 mac org.openjfx javafx-graphics - 19.0.2.1 + 20-ea+1 org.openjfx javafx-graphics - 19.0.2.1 + 20-ea+1 linux org.openjfx javafx-graphics - 19.0.2.1 + 20-ea+1 mac org.ocpsoft.prettytime prettytime - 5.0.6.Final + 5.0.7.Final org.controlsfx controlsfx - 11.1.2 + 11.2.1 clj-http-fake clj-http-fake - 1.0.3 + 1.0.4 test diff --git a/project.clj b/project.clj index fd061bed..dfb2fc04 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject ogri-la/strongbox "7.2.0" +(defproject ogri-la/strongbox "7.3.0" :description "World Of Warcraft Addon Manager" :url "https://github.com/ogri-la/strongbox" :license {:name "GNU Affero General Public License (AGPL)" @@ -11,42 +11,42 @@ ;; https://github.com/technomancy/leiningen/issues/2769 :pedantic? false - :dependencies [[org.clojure/clojure "1.10.3"] - [org.clojure/tools.cli "1.0.219"] ;; cli arg parsing - [org.clojure/tools.namespace "1.4.4"] ;; reload code - [org.clojure/data.json "2.4.0"] ;; json handling + :dependencies [[org.clojure/clojure "1.11.2"] + [org.clojure/tools.cli "1.1.230"] ;; cli arg parsing + [org.clojure/tools.namespace "1.5.0"] ;; reload code + [org.clojure/data.json "2.5.0"] ;; json handling [orchestra "2021.01.01-1"] ;; improved clojure.spec instrumentation ;; see lein deps :tree - [com.taoensso/timbre "5.1.2"] ;; logging + [com.taoensso/timbre "6.5.0"] ;; logging [clj-http "3.12.3"] ;; better http slurping - [clj-commons/fs "1.6.310"] ;; file system wrangling + [clj-commons/fs "1.6.311"] ;; file system wrangling [slugify "0.0.1"] [trptcolin/versioneer "0.2.0"] ;; version number wrangling. it's more involved than you might suspect [org.flatland/ordered "1.15.11"] ;; better ordered map - [clojure.java-time "1.2.0"] ;; date/time handling library, https://github.com/dm3/clojure.java-time + [clojure.java-time "1.4.2"] ;; date/time handling library, https://github.com/dm3/clojure.java-time [envvar "1.1.2"] ;; environment variable wrangling - [tolitius/lasync "0.1.24"] ;; better parallel processing + [tolitius/lasync "0.1.25"] ;; better parallel processing - [cljfx "1.7.23" :exclusions [org.openjfx/javafx-web - org.openjfx/javafx-media]] + [cljfx "1.8.0" :exclusions [org.openjfx/javafx-web + org.openjfx/javafx-media]] [cljfx/css "1.1.0"] - [org.openjfx/javafx-base "19.0.2.1"] - [org.openjfx/javafx-base "19.0.2.1" :classifier "linux"] - [org.openjfx/javafx-base "19.0.2.1" :classifier "mac"] + [org.openjfx/javafx-base "20-ea+1"] + [org.openjfx/javafx-base "20-ea+1" :classifier "linux"] + [org.openjfx/javafx-base "20-ea+1" :classifier "mac"] - [org.openjfx/javafx-controls "19.0.2.1"] - [org.openjfx/javafx-controls "19.0.2.1" :classifier "linux"] - [org.openjfx/javafx-controls "19.0.2.1" :classifier "mac"] + [org.openjfx/javafx-controls "20-ea+1"] + [org.openjfx/javafx-controls "20-ea+1" :classifier "linux"] + [org.openjfx/javafx-controls "20-ea+1" :classifier "mac"] - [org.openjfx/javafx-graphics "19.0.2.1"] - [org.openjfx/javafx-graphics "19.0.2.1" :classifier "linux"] - [org.openjfx/javafx-graphics "19.0.2.1" :classifier "mac"] + [org.openjfx/javafx-graphics "20-ea+1"] + [org.openjfx/javafx-graphics "20-ea+1" :classifier "linux"] + [org.openjfx/javafx-graphics "20-ea+1" :classifier "mac"] ;; GPLv3 compatible dependencies. ;; these don't need an exception in LICENCE.txt - [org.ocpsoft.prettytime/prettytime "5.0.6.Final"] ;; Apache 2.0 licenced, pretty date formatting - [org.controlsfx/controlsfx "11.1.2"] ;; BSD-3 + [org.ocpsoft.prettytime/prettytime "5.0.7.Final"] ;; Apache 2.0 licenced, pretty date formatting + [org.controlsfx/controlsfx "11.2.1"] ;; BSD-3 ;; remember to update the LICENCE.txt ;; remember to update pom file (`lein pom`) @@ -65,7 +65,7 @@ :profiles {:repl {:source-paths ["repl"]} :dev {:resource-paths ["dev-resources" "resources"] ;; dev-resources take priority - :dependencies [[clj-http-fake "1.0.3"] ;; fake http responses for testing + :dependencies [[clj-http-fake "1.0.4"] ;; fake http responses for testing [gui-diff "0.6.7" :exclusions [net.cgrant/parsley]] ;; pops up a graphical diff for test results ]} diff --git a/repl/strongbox/user.clj b/repl/strongbox/user.clj index 49b7145e..3559e0bb 100644 --- a/repl/strongbox/user.clj +++ b/repl/strongbox/user.clj @@ -14,6 +14,7 @@ [catalogue :as catalogue] [http :as http] [core :as core] + [specs :as sp] [utils :as utils :refer [in?]]] [gui.diff :refer [with-gui-diff]])) @@ -89,7 +90,7 @@ (core/reset-logging!) (if ns-kw - (if (some #{ns-kw} [:main :utils :http + (if (some #{ns-kw} [:main :utils :http :specs :core :toc :nfo :zip :config :catalogue :addon :logging :joblib :cli :gui :jfx :curseforge-api :wowinterface-api :gitlab-api :github-api :tukui-api diff --git a/src/strongbox/addon.clj b/src/strongbox/addon.clj index 7afd5c09..a095da9b 100644 --- a/src/strongbox/addon.clj +++ b/src/strongbox/addon.clj @@ -7,6 +7,7 @@ [orchestra.core :refer [defn-spec]] [me.raynes.fs :as fs] [strongbox + [constants :as constants] [logging :as logging] [toc :as toc] [utils :as utils] @@ -181,12 +182,8 @@ ;; prefer the one for the given `game-track`, if it exists, otherwise do as we do with ;; the catalogue and use a list of priorities. (let [grouped-toc-data (group-by :-toc/game-track toc-data-list) - priority-map {:retail [:retail :classic :classic-tbc :classic-wotlk] - :classic [:classic :classic-tbc :classic-wotlk :retail] - :classic-tbc [:classic-tbc :classic-wotlk :classic :retail] - :classic-wotlk [:classic-wotlk :classic-tbc :classic :retail]} safe-fallback [game-track] - priorities (get priority-map game-track safe-fallback) + priorities (get constants/game-track-priority-map game-track safe-fallback) group (utils/first-nn #(get grouped-toc-data %) priorities)] ;; after grouping toc data by game-track we may have multiple `:retail` or `:classic` data sets. diff --git a/src/strongbox/catalogue.clj b/src/strongbox/catalogue.clj index 41b4c2c4..42a019e3 100644 --- a/src/strongbox/catalogue.clj +++ b/src/strongbox/catalogue.clj @@ -47,13 +47,13 @@ (defn-spec expand-summary (s/or :ok :addon/expanded, :error nil?) "fetches updates from the addon host for the given `addon` and `game-track`. when `strict?` is `false` and an addon fails to match for the given `game-track`, other game tracks will be checked. + the strategy is to assume the next-best game tracks are the ones updated most recently but no more than one classic release removed. + for example, if a release for wotlk classic is not available and a release for cata, bcc and vanilla are, which to choose? + this strategy chooses cata, then bcc and finally vanilla, hoping the cata version is backwards compatible rather than the bcc one is + forwards-compatible. vanilla is just a far out wild guess. emits warnings to user when no release found." [addon :addon/expandable, game-track :addon-dir/game-track, strict? ::sp/strict?] (let [strict? (boolean strict?) - track-map {:retail [:retail :classic :classic-tbc :classic-wotlk] - :classic [:classic :classic-tbc :classic-wotlk :retail] - :classic-tbc [:classic-tbc :classic-wotlk :classic :retail] - :classic-wotlk [:classic-wotlk :classic-tbc :classic :retail]} game-track* game-track game-track (some #{game-track} sp/game-tracks)] ;; :retail => :retail, :unknown-game-track => nil (cond @@ -70,7 +70,7 @@ :else (if-let [source-updates (if strict? (-expand-summary addon game-track) - (utils/first-nn (partial -expand-summary addon) (get track-map game-track)))] + (utils/first-nn (partial -expand-summary addon) (get constants/game-track-priority-map game-track)))] source-updates ;; "no 'Retail' release found on github" @@ -80,7 +80,7 @@ multi-template "no '%s', '%s', '%s' or '%s' release found on %s." msg (if strict? (format single-template (sp/game-track-labels-map game-track) (:source addon)) - (apply format multi-template (conj (mapv #(sp/game-track-labels-map %) (get track-map game-track)) + (apply format multi-template (conj (mapv #(sp/game-track-labels-map %) (get constants/game-track-priority-map game-track)) (:source addon))))] (warn msg)))))) diff --git a/src/strongbox/constants.clj b/src/strongbox/constants.clj index c67fed93..6dc4affc 100644 --- a/src/strongbox/constants.clj +++ b/src/strongbox/constants.clj @@ -20,6 +20,7 @@ (def latest-classic-game-version "1.14.3") (def latest-classic-tbc-game-version "2.5.4") (def latest-classic-wotlk-game-version "3.4.0") +(def latest-classic-cata-game-version "4.0.1") ;; interface version to use if .toc file is missing one. ;; assume addon is compatible with the most recent version of retail (see above). @@ -27,6 +28,25 @@ (def default-interface-version 100000) (def default-interface-version-classic 11400) +;; take all of the game tracks to the right of your position +;; then all to the left. +;; [1 2 3 4 5 6] => 6 => [6 5 4 3 2 1] +;; [1 2 3 4 5 6] => 5 => [5 6 4 3 2 1] +;; [1 2 3 4 5 6] => 4 => [4 5 6 3 2 1] +;; [1 2 3 4 5 6] => 3 => [3 4 5 6 2 1] +;; [1 2 3 4 5 6] => 2 => [2 3 4 5 6 1] +;; [1 2 3 4 5 6] => 1 => [1 2 3 4 5 6] +(def game-track-priority-map + "when `strict?` is `false` and an addon fails to match against a given `game-track`, other game tracks will be checked. + the strategy is to assume the next-best game tracks are the ones 'closest' to the given `game-track`, newest to oldest. + for example, if a release for wotlk classic is not available and releases for cata, bcc and vanilla are, which to choose? + this strategy prioritises cata, then bcc and finally vanilla." + {:retail [:retail :classic :classic-tbc :classic-wotlk :classic-cata] + :classic [:classic :classic-tbc :classic-wotlk :classic-cata :retail] + :classic-tbc [:classic-tbc :classic-wotlk :classic-cata :classic :retail] + :classic-wotlk [:classic-wotlk :classic-cata :classic-tbc :classic :retail] + :classic-cata [:classic-cata :classic-wotlk :classic-tbc :classic :retail]}) + (def bullet "\u2022") ;; • ;; used when a placeholder datetime is needed. diff --git a/src/strongbox/core.clj b/src/strongbox/core.clj index b9a5343e..51856299 100644 --- a/src/strongbox/core.clj +++ b/src/strongbox/core.clj @@ -987,7 +987,7 @@ (catalogue/read-catalogue catalogue-path {:bad-data? (fn [] - ;; "catalogue 'full failed to load again, it might be corrupt at it's source: https://path/to/online/catalogue.json" + ;; "catalogue 'full' failed to load again, it might be corrupt at it's source: https://path/to/online/catalogue.json" (let [msg (format "catalogue '%s' failed to load again, it might be corrupt at it's source: %s" catalogue-label catalogue-source)] (error (utils/reportable-error msg))))})) diff --git a/src/strongbox/specs.clj b/src/strongbox/specs.clj index befe7a57..58c0cc8a 100644 --- a/src/strongbox/specs.clj +++ b/src/strongbox/specs.clj @@ -87,10 +87,11 @@ (def game-track-labels [[:retail "Retail"] [:classic "Classic"] [:classic-tbc "Classic (TBC)"] - [:classic-wotlk "Classic (WotLK)"]]) + [:classic-wotlk "Classic (WotLK)"] + [:classic-cata "Classic (Cata)"]]) (def game-track-labels-map (into {} game-track-labels)) ;; {:retail "WoW Retail", ...} -(def game-track-labels-map-inv (map-invert game-track-labels)) ;; {"WoW Retail" :retail, ...} +(def game-track-labels-map-inv (map-invert game-track-labels-map)) ;; {"WoW Retail" :retail, ...} (def game-tracks (->> game-track-labels-map keys set)) ;; #{:retail, :classic, ...} ;; needed to update config diff --git a/src/strongbox/toc.clj b/src/strongbox/toc.clj index 76754fec..b441f50a 100644 --- a/src/strongbox/toc.clj +++ b/src/strongbox/toc.clj @@ -54,7 +54,7 @@ "returns a list of file names as `[[game-track, filename.toc], ...]` in the given `addon-dir`. `game-track` is `nil` if it can't be guessed from the filename (and not 'retail')." [addon-dir ::sp/extant-dir] - (let [pattern (Pattern/compile "(?u)^(.+?)(?:[\\-_]{1}(Mainline|Classic|Vanilla|TBC|BCC|Wrath){1})?\\.toc$") + (let [pattern (Pattern/compile "(?u)^(.+?)(?:[\\-_](Mainline|Classic|Vanilla|TBC|BCC|Wrath|Cata))?\\.toc$") matching-toc-pattern (fn [filename] (let [toc-bname (str (fs/base-name filename)) [toc-bname-match game-track-match] (rest (re-matches pattern toc-bname))] diff --git a/src/strongbox/utils.clj b/src/strongbox/utils.clj index 83c5a9b4..e8abe3c5 100644 --- a/src/strongbox/utils.clj +++ b/src/strongbox/utils.clj @@ -331,6 +331,8 @@ "2." :classic-tbc ;; 3.x.x == classic (wrath of the lich king) "3." :classic-wotlk + ;; 4.x.x == classic (cataclysm) + "4." :classic-cata :retail))) (defn-spec interface-version-to-game-track (s/or :ok ::sp/game-track, :err nil?) @@ -347,7 +349,8 @@ :retail constants/latest-retail-game-version :classic constants/latest-classic-game-version :classic-tbc constants/latest-classic-tbc-game-version - :classic-wotlk constants/latest-classic-wotlk-game-version)) + :classic-wotlk constants/latest-classic-wotlk-game-version + :classic-cata constants/latest-classic-cata-game-version)) ;; https://stackoverflow.com/questions/13789092/length-of-the-first-line-in-an-utf-8-file-with-bom (defn debomify @@ -630,12 +633,14 @@ (map #(zipmap (map keyword head) %1) lines)) (defn-spec guess-game-track (s/nilable ::sp/game-track) - "returns the first game track it finds in the given string, preferring `:classic-wotlk`, then `:classic-tbc`, then `:classic`, then `:retail` (most to least specific). + "returns the first game track it finds in the given string, preferring most to least specific. returns `nil` if no game track found." [string (s/nilable string?)] (when string - (let [;; matches 'classic-wotlk', 'classic_wotlk', 'classic-wrath', 'classic_wrath', 'wotlk', 'wrath' - classic-wotlk-regex #"(?i)(classic[\W_])?(wrath|wotlk){1}\W?" + (let [;; matches 'cata'. less variation this time around. + classic-cata-regex #"(?i)[\W_]?cata([\W_]?|$)" + ;; matches 'classic-wotlk', 'classic_wotlk', 'classic-wrath', 'classic_wrath', 'wotlk', 'wrath' + classic-wotlk-regex #"(?i)(classic[\W_])?(wrath|wotlk)([\W_]|$)?" ;; matches 'classic-tbc', 'classic-bc', 'classic-bcc', 'classic_tbc', 'classic_bc', 'classic_bcc', 'tbc', 'tbcc', 'bc', 'bcc' ;; but not 'classictbc' or 'classicbc' or 'classicbcc' ;; see tests. @@ -643,6 +648,7 @@ classic-regex #"(?i)classic|vanilla" retail-regex #"(?i)retail|mainline"] (cond + (re-find classic-cata-regex string) :classic-cata (re-find classic-wotlk-regex string) :classic-wotlk (re-find classic-tbc-regex string) :classic-tbc (re-find classic-regex string) :classic diff --git a/test/fixtures/everyaddon--1-2-3--multi-toc.zip b/test/fixtures/everyaddon--1-2-3--multi-toc.zip index 8f7fd377..588c7df1 100644 Binary files a/test/fixtures/everyaddon--1-2-3--multi-toc.zip and b/test/fixtures/everyaddon--1-2-3--multi-toc.zip differ diff --git a/test/strongbox/github_api_test.clj b/test/strongbox/github_api_test.clj index 7d1c2803..1a668036 100644 --- a/test/strongbox/github_api_test.clj +++ b/test/strongbox/github_api_test.clj @@ -444,11 +444,19 @@ {:browser_download_url "https://example.org" :content_type "application/zip" :state "uploaded" - :name "1.2.3-Classic-WotLK"}]} - expected [{:download-url "https://example.org", :game-track :retail, :version "Release 1.2.3"} + :name "1.2.3-Classic-WotLK"} + {:browser_download_url "https://example.org" + :content_type "application/zip" + :state "uploaded" + :name "1.2.3-cata"}]} + expected [;; this is the sole remaining asset, classified as `:retail` (the sole remaining classification) + ;; because all other assets had their game tracks guessed.. + {:download-url "https://example.org", :game-track :retail, :version "Release 1.2.3"} + {:download-url "https://example.org", :game-track :classic, :version "Release 1.2.3"} {:download-url "https://example.org", :game-track :classic-tbc, :version "Release 1.2.3"} - {:download-url "https://example.org", :game-track :classic-wotlk, :version "Release 1.2.3"}] + {:download-url "https://example.org", :game-track :classic-wotlk, :version "Release 1.2.3"} + {:download-url "https://example.org", :game-track :classic-cata, :version "Release 1.2.3"}] known-game-tracks []] (is (= expected (github-api/parse-assets release known-game-tracks)))))) diff --git a/test/strongbox/gitlab_api_test.clj b/test/strongbox/gitlab_api_test.clj index 554af28c..858428b5 100644 --- a/test/strongbox/gitlab_api_test.clj +++ b/test/strongbox/gitlab_api_test.clj @@ -304,6 +304,10 @@ :link_type "other" :name "Foo-Wrath" :direct_asset_url "http://example.org"} + {:external false + :link_type "other" + :name "Foo-Cata" + :direct_asset_url "http://example.org"} {:external false :link_type "other" :name "Foo" @@ -312,6 +316,7 @@ expected [{:download-url "http://example.org", :game-track :classic, :version "1.2.3"} {:download-url "http://example.org", :game-track :classic-tbc, :version "1.2.3"} {:download-url "http://example.org", :game-track :classic-wotlk, :version "1.2.3"} + {:download-url "http://example.org", :game-track :classic-cata, :version "1.2.3"} {:download-url "http://example.org", :game-track :retail, :version "1.2.3"}] known-game-tracks []] (is (= expected (gitlab-api/parse-release release known-game-tracks)))))) diff --git a/test/strongbox/jfx_test.clj b/test/strongbox/jfx_test.clj index b16d5972..cc8ce0d2 100644 --- a/test/strongbox/jfx_test.clj +++ b/test/strongbox/jfx_test.clj @@ -131,7 +131,7 @@ Installed from curseforge Supports Retail -Last updated 7 years ago (2016-09-08)"] +Last updated 8 years ago (2016-09-08)"] (is (= expected (jfx/addon-as-text-for-installed given))))) (testing "with overrides" @@ -167,7 +167,7 @@ Available from curseforge Supports -Last updated 7 years ago (2016-09-08)"] +Last updated 8 years ago (2016-09-08)"] (is (= expected (jfx/addon-as-text-for-catalogue given))))) (testing "with overrides" diff --git a/test/strongbox/specs_test.clj b/test/strongbox/specs_test.clj new file mode 100644 index 00000000..bfd2f239 --- /dev/null +++ b/test/strongbox/specs_test.clj @@ -0,0 +1,13 @@ +(ns strongbox.specs-test + (:require + [clojure.test :refer [deftest testing is use-fixtures]] + [strongbox + [specs :as specs]])) + +(deftest game-tracks-label-map + (let [expected {"Classic" :classic, + "Classic (Cata)" :classic-cata, + "Classic (TBC)" :classic-tbc, + "Classic (WotLK)" :classic-wotlk, + "Retail" :retail}] + (is (= expected specs/game-track-labels-map-inv)))) diff --git a/test/strongbox/toc_test.clj b/test/strongbox/toc_test.clj index 3a6cc836..fa686abd 100644 --- a/test/strongbox/toc_test.clj +++ b/test/strongbox/toc_test.clj @@ -242,6 +242,7 @@ SomeAddon.lua") (deftest find-toc-files (let [expected [[:classic-tbc "EveryAddon-BCC.toc"] + [:classic-cata "EveryAddon-Cata.toc"] [:classic "EveryAddon-Classic.toc"] [:retail "EveryAddon-Mainline.toc"] [:classic-tbc "EveryAddon-TBC.toc"] diff --git a/test/strongbox/utils_test.clj b/test/strongbox/utils_test.clj index 22408312..c6d4f7d5 100644 --- a/test/strongbox/utils_test.clj +++ b/test/strongbox/utils_test.clj @@ -50,7 +50,7 @@ ;; so '101', '201' become '10.' and '20.', minor '01' becomes '00' and '0' is still '0' "101010" "10.0.0" - ;; ambiguous/broken cases + ;; ambiguous/broken cases "00010" "0.0.0" "01000" "0.0.0" "10100" "1.1.0" ;; ambiguous, also, 1.10.0, 10.1.0, 10.10.0 @@ -295,9 +295,15 @@ ["3.foo.bar" :classic-wotlk] [constants/latest-classic-wotlk-game-version :classic-wotlk] + ;; cata + ["4." :classic-cata] + ["4.3.0" :classic-cata] + ["4.foo.bar" :classic-cata] + [constants/latest-classic-cata-game-version :classic-cata] + ;; everything else - ["4.3.0" :retail] ["5.0.4" :retail] + ["6.0.4" :retail] ;; ...etc ["9.0.1" :retail] ["10.0.2" :retail] @@ -374,6 +380,15 @@ ["classic_bcc" :classic-tbc] ["1.2.3_classic_bcc_no-lib" :classic-tbc] + ["cata" :classic-cata] + ["cata.no-lib" :classic-cata] + ["1.2.3-cata" :classic-cata] + ["1.2.3_cata" :classic-cata] + ["1.2.3.cata" :classic-cata] + ["1.2.3-cata-no-lib" :classic-cata] + ["1.2.3.cata.no-lib" :classic-cata] + ["1.2.3_cata.no_lib" :classic-cata] + ;; classic ["classic" :classic] ["vanilla" :classic] @@ -400,6 +415,8 @@ ["Classic-TBC" :classic-tbc] ;; priority (classic-tbc > classic > retail) + ["retail-classic-tbc-classic-wotlk-cata" :classic-cata] + ["retail-classic-tbc-classic-wotlk" :classic-wotlk] ["retail-classic-tbc-classic" :classic-tbc] ["retail-classic-classic-tbc" :classic-tbc] ["classic-classic-tbc" :classic-tbc] @@ -472,7 +489,8 @@ (let [cases [[10123 :classic] [20123 :classic-tbc] [30123 :classic-wotlk] - [40123 :retail] ;; for now + [40123 :classic-cata] + [50123 :retail] ;; for now ;; bad interface versions [0 nil]