Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors Publicize connection URL detection #17816

Merged
merged 7 commits into from
Jan 28, 2022

Conversation

frosty
Copy link
Contributor

@frosty frosty commented Jan 26, 2022

Following on from #17803, this PR refactors the code used to detect success or failure based on the authorization URL. In particular:

  • The code has now moved from the sharing web view controller to its own PublicizeConnectionURLMatcher
  • I've added unit tests for the URL matching and associated authorize actions
  • Most of the matches are now done based on URLQueryItems rather than just looking for substrings of the URL.

To test

  • Build and run tests and check they all pass
  • Build and run and test out adding as many different accounts in My Site > Sharing as you can. I was able to test Tumblr, Twitter, and Facebook, but I don't have a LinkedIn account to test with.

Regression Notes

  1. Potential unintended areas of impact

The ability to connect any of the social accounts that are part of Publicize.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

I added unit tests for the existing URL matching before I made any changes to that code, to verify that my changes didn't have any negative affect there.

  1. What automated tests I added (or what prevented me from doing so)

See above. I also added extra tests around the authorize actions too. I added these at the end once I'd moved the authorize action code out of the view controller, as the VC had a bunch of dependencies making it a bit more awkward to test.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@frosty frosty added this to the 19.2 milestone Jan 26, 2022
@frosty frosty requested a review from guarani January 26, 2022 13:33
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jan 26, 2022

You can trigger an installable build for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jan 26, 2022

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

Copy link
Contributor

@guarani guarani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @frosty, the changes look great! I check for regressions by connecting each of the four (Facebook, LinkedIn, Tumblr, and Twitter) and all connected as expected.
I left some code comments, but no blockers, so feel free to merge as-is.

@jkmassel
Copy link
Contributor

You can test the Jetpack changes on this Pull Request by downloading it from AppCenter here with build number: pr17816-0b54622. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@jkmassel
Copy link
Contributor

You can test the WordPress changes on this Pull Request by downloading it from AppCenter here with build number: pr17816-0b54622. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@frosty frosty merged commit 1efd4e4 into trunk Jan 28, 2022
@frosty frosty deleted the fix/publicize-connection-refactor branch January 28, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants