summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml28
-rw-r--r--changelog.d/amd64-runner.skip0
-rw-r--r--changelog.d/featured-collection-shouldnt-break-user-fetch.fix1
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex5
-rw-r--r--test/pleroma/web/activity_pub/activity_pub_test.exs8
5 files changed, 37 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8daa9f434..148cbe405 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -65,13 +65,21 @@ check-changelog:
- "**/*.exs"
- "mix.lock"
+.using-ci-base:
+ tags:
+ - amd64
+
build:
- extends: .build_changes_policy
+ extends:
+ - .build_changes_policy
+ - .using-ci-base
stage: build
script:
- mix compile --force
spec-build:
+ extends:
+ - .using-ci-base
stage: test
rules:
- changes:
@@ -85,6 +93,8 @@ spec-build:
- mix pleroma.openapi_spec spec.json
benchmark:
+ extends:
+ - .using-ci-base
stage: benchmark
when: manual
variables:
@@ -99,7 +109,9 @@ benchmark:
- mix pleroma.load_testing
unit-testing:
- extends: .build_changes_policy
+ extends:
+ - .build_changes_policy
+ - .using-ci-base
stage: test
cache: &testing_cache_policy
<<: *global_cache_policy
@@ -121,7 +133,9 @@ unit-testing:
path: coverage.xml
unit-testing-erratic:
- extends: .build_changes_policy
+ extends:
+ - .build_changes_policy
+ - .using-ci-base
stage: test
retry: 2
allow_failure: true
@@ -155,7 +169,9 @@ unit-testing-erratic:
# - mix test --trace --only federated
unit-testing-rum:
- extends: .build_changes_policy
+ extends:
+ - .build_changes_policy
+ - .using-ci-base
stage: test
cache: *testing_cache_policy
services:
@@ -186,7 +202,9 @@ lint:
- mix format --check-formatted
analysis:
- extends: .build_changes_policy
+ extends:
+ - .build_changes_policy
+ - .using-ci-base
stage: test
cache: *testing_cache_policy
script:
diff --git a/changelog.d/amd64-runner.skip b/changelog.d/amd64-runner.skip
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/changelog.d/amd64-runner.skip
diff --git a/changelog.d/featured-collection-shouldnt-break-user-fetch.fix b/changelog.d/featured-collection-shouldnt-break-user-fetch.fix
new file mode 100644
index 000000000..e8ce288cc
--- /dev/null
+++ b/changelog.d/featured-collection-shouldnt-break-user-fetch.fix
@@ -0,0 +1 @@
+Fix user fetch completely broken if featured collection is not in a supported form
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 1a10aef1d..c93288b79 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -1720,6 +1720,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end)
end
+ def pin_data_from_featured_collection(obj) do
+ Logger.error("Could not parse featured collection #{inspect(obj)}")
+ %{}
+ end
+
def fetch_and_prepare_featured_from_ap_id(nil) do
{:ok, %{}}
end
diff --git a/test/pleroma/web/activity_pub/activity_pub_test.exs b/test/pleroma/web/activity_pub/activity_pub_test.exs
index 54fc6ef0a..1e8c14043 100644
--- a/test/pleroma/web/activity_pub/activity_pub_test.exs
+++ b/test/pleroma/web/activity_pub/activity_pub_test.exs
@@ -2652,4 +2652,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
{:ok, user} = ActivityPub.make_user_from_ap_id("https://princess.cat/users/mewmew")
assert user.name == " "
end
+
+ test "pin_data_from_featured_collection will ignore unsupported values" do
+ assert %{} ==
+ ActivityPub.pin_data_from_featured_collection(%{
+ "type" => "OrderedCollection",
+ "first" => "https://social.example/users/alice/collections/featured?page=true"
+ })
+ end
end