Skip to content

Commit

Permalink
Replace git.io links
Browse files Browse the repository at this point in the history
git.io is shutting down, so we can no longer use it for short links to
documentation. See
https://github.blog/changelog/2022-04-25-git-io-deprecation

Fixes #826, #764
  • Loading branch information
tobias committed Apr 27, 2022
1 parent efd37c7 commit 7af70a6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/clojars/db.clj
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,11 @@

;; group doesn't exist, reject since we no longer auto-create groups
(empty? actives)
(err (format "Group '%s' doesn't exist (see https://git.io/JOs8J)" groupname))
(err (format "Group '%s' doesn't exist. See https://bit.ly/3MuKGXO" groupname))

;; group isn't verified, so new jars/projects can't be deployed to it
(not (find-group-verification db groupname))
(err (format "Group '%s' isn't verified, so can't contain new projects (see https://git.io/JOs8J)" groupname)))))
(err (format "Group '%s' isn't verified, so can't contain new projects. See https://bit.ly/3MuKGXO" groupname)))))

(defn add-group
"Adds a new group entry without any checks other than if it exists
Expand Down
14 changes: 7 additions & 7 deletions src/clojars/routes/repo.clj
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
(when (and (not (maven/snapshot-version? version))
(db/find-jar db group-id artifact-id version))
(throw-invalid :non-snapshot-redeploy
"redeploying non-snapshots is not allowed (see https://git.io/v1IAs)")))
"redeploying non-snapshots is not allowed. See https://bit.ly/3EYzhwT")))

(defn assert-non-central-shadow [group-id artifact-id]
(when-not (maven/can-shadow-maven? group-id artifact-id)
Expand All @@ -212,10 +212,10 @@
:report? true}]
(if (= ret :failure)
(throw-invalid :central-shadow-check-failure
"failed to contact Maven Central to verify project name (see https://git.io/vMUHN)"
"failed to contact Maven Central to verify project name. See https://bit.ly/3rTLqxZ"
(assoc meta :status 503))
(throw-invalid :central-shadow
"shadowing Maven Central artifacts is not allowed (see https://git.io/vMUHN)"
"shadowing Maven Central artifacts is not allowed. See https://bit.ly/3rTLqxZ"
meta))))))

(defn assert-jar-uploaded [artifacts pom]
Expand Down Expand Up @@ -258,7 +258,7 @@
;; OSes, URLs and tools.
(validate-regex name #"^[a-z0-9_.-]+$"
(str "project names must consist solely of lowercase "
"letters, numbers, hyphens and underscores (see https://git.io/v1IAl)"))
"letters, numbers, hyphens and underscores. See https://bit.ly/3MuL20A"))

;; Maven's pretty accepting of version numbers, but so far in 2.5 years
;; bar one broken non-ascii exception only these characters have been used.
Expand All @@ -267,7 +267,7 @@
;; compatible for everyone let's lock it down.
(validate-regex version #"^[a-zA-Z0-9_.+-]+$"
(str "version strings must consist solely of letters, "
"numbers, dots, pluses, hyphens and underscores (see https://git.io/v1IA2)")))
"numbers, dots, pluses, hyphens and underscores. See https://bit.ly/3Kf5KzX")))

(defn validate-deploy [db dir pom {:keys [group name version]}]
(validate-jar-name+version name version)
Expand Down Expand Up @@ -376,7 +376,7 @@
[session group artifact]
(when-not (token-session-matches-group-artifact? session group artifact)
(throw-forbidden
"The provided token's scope doesn't allow deploying this artifact (see https://git.io/JfwjM)"
"The provided token's scope doesn't allow deploying this artifact. See https://bit.ly/3LmCclv"
{:group group
:artifact artifact})))

Expand Down Expand Up @@ -494,7 +494,7 @@
(if (auth/unauthed-or-token-request? req)
(f req)
(let [{:keys [username]} (auth/parse-authorization-header (get-in req [:headers "authorization"]))
message "a deploy token is required to deploy (see https://git.io/JfwjM)"]
message "a deploy token is required to deploy. See https://bit.ly/3LmCclv"]
(log/audit db {:tag :deploy-password-rejection
:message message
:username username})
Expand Down
26 changes: 13 additions & 13 deletions test/clojars/integration/uploads_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@
(register-as "dantheman" "[email protected]" "password"))
(let [token (create-deploy-token (session (help/app-from-system)) "dantheman" "password" "testing")]
(is (thrown-with-msg? DeploymentException
#"Forbidden - Group 'new-group' doesn't exist \(see https://git.io/JOs8J\)"
#"Forbidden - Group 'new-group' doesn't exist. See https://bit.ly/3MuKGXO"
(deploy
{:coordinates '[new-group/test "0.0.1"]
:jar-file (io/file (io/resource "test.jar"))
Expand All @@ -447,7 +447,7 @@
:group_name "new-group"
:jar_name "test"
:version "0.0.1"
:message "Group 'new-group' doesn't exist (see https://git.io/JOs8J)"
:message "Group 'new-group' doesn't exist. See https://bit.ly/3MuKGXO"
:tag "deploy-forbidden"})))

(deftest user-can-deploy-a-new-version-to-an-existing-project-in-a-non-verified-group
Expand Down Expand Up @@ -494,7 +494,7 @@
(db/add-admin help/*db* "legacy-group" "dantheman" "testing")

(is (thrown-with-msg? DeploymentException
#"Forbidden - Group 'legacy-group' isn't verified, so can't contain new projects \(see https://git.io/JOs8J\)"
#"Forbidden - Group 'legacy-group' isn't verified, so can't contain new projects. See https://bit.ly/3MuKGXO"
(deploy
{:coordinates '[legacy-group/test "0.0.1"]
:jar-file (io/file (io/resource "test.jar"))
Expand All @@ -507,7 +507,7 @@
:group_name "legacy-group"
:jar_name "test"
:version "0.0.1"
:message "Group 'legacy-group' isn't verified, so can't contain new projects (see https://git.io/JOs8J)"
:message "Group 'legacy-group' isn't verified, so can't contain new projects. See https://bit.ly/3MuKGXO"
:tag "deploy-forbidden"})))

(deftest user-cannot-redeploy
Expand All @@ -532,7 +532,7 @@
:group_name "org.clojars.dantheman"
:jar_name "test"
:version "0.0.1"
:message "redeploying non-snapshots is not allowed (see https://git.io/v1IAs)"
:message "redeploying non-snapshots is not allowed. See https://bit.ly/3EYzhwT"
:tag "non-snapshot-redeploy"})))

(deftest deploy-cannot-shadow-central
Expand All @@ -556,7 +556,7 @@
:group_name "org.tcrawley"
:jar_name "dynapath"
:version "0.0.1"
:message "shadowing Maven Central artifacts is not allowed (see https://git.io/vMUHN)"
:message "shadowing Maven Central artifacts is not allowed. See https://bit.ly/3rTLqxZ"
:tag "central-shadow"})))

(deftest deploy-cannot-shadow-central-unless-allowlisted
Expand Down Expand Up @@ -742,12 +742,12 @@
{:coordinates '[org.clojars.dantheman/test "1.0.0"]
:jar-file (io/file (io/resource "test.jar"))
:pom-file (io/file (io/resource "test-0.0.1/test.pom"))
:password "password"})
:password "password"})))

(help/match-audit {:username "guest"}
{:user "guest"
:message "a deploy token is required to deploy (see https://git.io/JfwjM)"
:tag "deploy-password-rejection"}))))
(help/match-audit {:username "dantheman"}
{:user "dantheman"
:message "a deploy token is required to deploy. See https://bit.ly/3LmCclv"
:tag "deploy-password-rejection"}))

(deftest deploy-requires-path-to-match-pom
(-> (session (help/app-from-system))
Expand Down Expand Up @@ -822,7 +822,7 @@
:group_name "org.clojars.dantheman"
:jar_name "teST"
:version "0.0.1"
:message "project names must consist solely of lowercase letters, numbers, hyphens and underscores (see https://git.io/v1IAl)"
:message "project names must consist solely of lowercase letters, numbers, hyphens and underscores. See https://bit.ly/3MuL20A"
:tag "regex-validation-failed"})))

(deftest deploy-requires-ascii-version
Expand All @@ -843,7 +843,7 @@
:group_name "org.clojars.dantheman"
:jar_name "test"
:version "1.α.0"
:message "version strings must consist solely of letters, numbers, dots, pluses, hyphens and underscores (see https://git.io/v1IA2)"
:message "version strings must consist solely of letters, numbers, dots, pluses, hyphens and underscores. See https://bit.ly/3Kf5KzX"
:tag "regex-validation-failed"})))

(deftest put-on-html-fails
Expand Down

0 comments on commit 7af70a6

Please sign in to comment.