Use any custom WebFinger domain for page metadata #442

Closed
hufman wants to merge 0 commits from hufman/akkoma:metadata_webfinger into develop
First-time contributor

Updates the og:title and twitter:title properties to use the WebFinger domain instead of the server hostname, which should make url previews show up a little more correctly in certain applications.

Updates the og:title and twitter:title properties to use the WebFinger domain instead of the server hostname, which should make url previews show up a little more correctly in certain applications.
hufman added 1 commit 2023-01-23 02:30:55 +00:00
Use any custom WebFinger domain for page metadata
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
54fdf3a5de
First-time contributor

any reason why this hasn't been merged yet?
discord embeds show the hostname instead of the webfinger domain, as do embeds elsewhere

image

any reason why this hasn't been merged yet? discord embeds show the hostname instead of the webfinger domain, as do embeds elsewhere ![image](https://img.birb.cc/lxsr1cca.png)

yes, the reason is that this PR has no tests in any form

it only passes because in test the config has the webfinger domain the same as the endpoint

without tests this cannot be merged

yes, the reason is that this PR has no tests in any form it only passes because in test the config has the webfinger domain the same as the endpoint without tests this cannot be merged

i left it thinking the OP would add them at some point, and seems they never did

i left it thinking the OP would add them at some point, and seems they never did
Author
First-time contributor

That would have been helpful to know, I instead had the impression that the project was dead :)
I'll try to figure out how to add tests, Erlang is new to me so it will take a while.

That would have been helpful to know, I instead had the impression that the project was dead :) I'll try to figure out how to add tests, Erlang is new to me so it will take a while.

eh? dead? there's activity constantly

eh? dead? there's activity constantly
hufman added 2 commits 2023-07-27 16:02:13 +00:00
Add a unit test for custom WebFinger domain
Some checks are pending
ci/woodpecker/pr/build-amd64 Pipeline is pending
ci/woodpecker/pr/build-arm64 Pipeline is pending
ci/woodpecker/pr/docs Pipeline is pending
ci/woodpecker/pr/test Pipeline is pending
1377ec33fe
floatingghost reviewed 2023-07-27 16:06:50 +00:00
@ -8,6 +8,7 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
import ExUnit.CaptureLog
https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop/test/pleroma/web/metadata/utils_test.exs may be a more suitable place for this
Author
First-time contributor

I moved the unit tests as requested.

I moved the unit tests as requested.
hufman marked this conversation as resolved
hufman added 1 commit 2023-07-28 14:35:25 +00:00
Add unit tests for Utils.user_name_string
Some checks are pending
ci/woodpecker/pr/build-amd64 Pipeline is pending
ci/woodpecker/pr/build-arm64 Pipeline is pending
ci/woodpecker/pr/docs Pipeline is pending
ci/woodpecker/pr/test Pipeline is pending
c38f1aefb1
Author
First-time contributor

Is there any further feedback for this change?

Is there any further feedback for this change?

there's no need to bump, it's been the weekend and it's only just now the end of the work day, I'll look at it when i get a free moment

there's no need to bump, it's been the weekend and it's only just now the end of the work day, I'll look at it when i get a free moment
floatingghost requested changes 2023-08-02 10:57:08 +00:00
floatingghost left a comment
Owner

tests do not pass

suggestions:

  • Remove the change_config calls
  • on the "it uses the Endpoint by default" test, test that it returns @localhost
  • on the "it uses any custom WebFinger domain", you only need the WebFinger, :domain config, the Endpoint config can be removed
tests do not pass suggestions: - Remove the `change_config` calls - on the "it uses the Endpoint by default" test, test that it returns `@localhost` - on the "it uses any custom WebFinger domain", you only need the WebFinger, :domain config, the Endpoint config can be removed
@ -79,1 +79,4 @@
end
describe "user_name_string/1" do
test "it uses the Endpoint by default" do

this breaks all other tests that run after this one

this breaks all other tests that run after this one
@ -8,6 +8,7 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
import ExUnit.CaptureLog
import Pleroma.Factory
import Tesla.Mock
alias Pleroma.Web.Metadata.Utils

this is no longer required

this is no longer required

but DW i can fix that

but DW i can fix that

merged via babb4b9a8f

merged via babb4b9a8fc89445e485f8c2955b8ebd0e77bc55
floatingghost closed this pull request 2023-08-02 11:05:59 +00:00
Author
First-time contributor

Weird, MIX_ENV=test mix test test/pleroma/web/metadata/ worked fine for me.
Thanks for accepting!

Weird, `MIX_ENV=test mix test test/pleroma/web/metadata/` worked fine for me. Thanks for accepting!

the reason that worked is that that command only tests that particular subset of tests - changing the endpoint config fails other tests outside of that subset because config can persist between tests (and is actually a frequent pain point)

the reason that worked is that that command only tests that particular subset of tests - changing the endpoint config fails other tests outside of that subset because config can persist between tests (and is actually a frequent pain point)
Some checks are pending
ci/woodpecker/pr/build-amd64 Pipeline is pending
ci/woodpecker/pr/build-arm64 Pipeline is pending
ci/woodpecker/pr/docs Pipeline is pending
ci/woodpecker/pr/test Pipeline is pending

Pull request closed

Sign in to join this conversation.
No description provided.