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

Adding support for URL shortener in email 5.x #12128

Conversation

christian-krieg
Copy link
Contributor

@christian-krieg christian-krieg commented Mar 27, 2023

This PR migrates PR #12111 from 4.x to 5.x. Compared to #12111, this PR adds:

  • Adding assertions to unit test
  • Twig template instead of PHP template

Please note that CS Fixer introduced whitespace in some files in order to align assignment characters ('=', '=>'), so the committed changes are distorted (compared to the functional changes).

Q A
Bug fix? (use the a.b branch) No
New feature/enhancement? (use the a.x branch)
Deprecations? No
BC breaks? (use the c.x branch) No
Automated tests included?
Related user documentation PR URL mautic/mautic-documentation#...
Related developer documentation PR URL
Issue(s) addressed

Description:

Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)

* Adding assertions to unit test
* Twig template instead of PHP template
@cla-bot cla-bot bot added the cla-signed The PR contributors have signed the contributors agreement label Mar 27, 2023
@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Merging #12128 (0193d4a) into 5.x (1635d74) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##                5.x   #12128   +/-   ##
=========================================
  Coverage     58.00%   58.00%           
- Complexity    33536    33539    +3     
=========================================
  Files          2163     2163           
  Lines        101335   101341    +6     
=========================================
+ Hits          58777    58781    +4     
- Misses        42558    42560    +2     
Impacted Files Coverage Δ
app/bundles/CoreBundle/Form/Type/ConfigType.php 100.00% <100.00%> (ø)
...es/EmailBundle/EventListener/BuilderSubscriber.php 97.14% <100.00%> (+0.06%) ⬆️

... and 2 files with indirect coverage changes

@npracht npracht added ready-to-test PR's that are ready to test enhancement Any improvement to an existing feature or functionality email Anything related to email sms Anything related to SMS T2 Medium difficulty to fix (issue) or test (PR) labels Mar 27, 2023
@npracht
Copy link
Member

npracht commented Mar 27, 2023

🚀 thanks a lot !

@escopecz escopecz changed the title Migrated PR #12111 from 4.x to 5.x Adding support for URL shortener in email 5.x Mar 27, 2023
@escopecz escopecz mentioned this pull request Mar 28, 2023
55 tasks
@RCheesley RCheesley mentioned this pull request Mar 30, 2023
54 tasks
@RCheesley RCheesley mentioned this pull request Apr 6, 2023
53 tasks
escopecz
escopecz previously approved these changes Apr 13, 2023
Copy link
Sponsor Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

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

I see no issue with these changes. Quite elegant solution 👍

@escopecz escopecz added pending-test-confirmation PR's that require one test before they can be merged and removed ready-to-test PR's that are ready to test labels Apr 13, 2023
@escopecz
Copy link
Sponsor Member

But please fix the CI issues.

@christian-krieg
Copy link
Contributor Author

But please fix the CI issues.

@escopecz I cannot see where the 'CS Fixer' check fails, could you please provide assistance?

@escopecz
Copy link
Sponsor Member

Sure. It's visible when you scroll down that "Some checks were not successful" and you can click on details to see what's failed. Here is the direct link: https://github.com/mautic/mautic/actions/runs/4610697990/jobs/8305732563?pr=12128

@christian-krieg
Copy link
Contributor Author

Thanks @escopecz , I already managed to go that far :) I just can't see what causes the issue, or, more generally, what is the issue, or where to start bug hunting.

@escopecz
Copy link
Sponsor Member

escopecz commented Apr 14, 2023

I can help with that. The CS fixer makes sure that the code style is the same across the code base. We configured it to be very similar to what Symfony code style is plus some additional rules.

The output shows you lines of code. If the line starts with - then it wants to remove it and when it starts with + then it wants to add it. So you can manually fix your code and push it.

But the CI job also shows what command it runs on the first line. You can run it on your local like this:

bin/php-cs-fixer fix --config=.php-cs-fixer.php

and it will fix the code style issues for you. Then you just review it and push it.

@christian-krieg
Copy link
Contributor Author

christian-krieg commented Apr 14, 2023

Hmmm it seems CS Fixer is complaining about code I never edited...

EDIT: And now, all checks pass 😅

@RCheesley RCheesley mentioned this pull request Apr 21, 2023
54 tasks
@christian-krieg
Copy link
Contributor Author

Hey there, is there any chance to get this PR merged soon? Is there anything I can help with?

@escopecz
Copy link
Sponsor Member

@christian-krieg it needs to be tested and approved by a second person. Do you think you can do that?

@christian-krieg
Copy link
Contributor Author

Of course I tested before submitting, and I successfully have been using this feature for months now. However, I am not sure if it complies with the intended four-eyes principle if I am the one who tests and approves. But of course, I am willing to do so.

@escopecz
Copy link
Sponsor Member

Oh, you are the author. I thought this is from @kuzmany but I can see it's different PR:

#12299

@kuzmany can you please look into this PR and approve if it's OK with you? I don't want these 2 PRs to conflict not only in code but in UX.

@kuzmany
Copy link
Member

kuzmany commented May 25, 2023

@escopecz once If ready you can merge it and I will update my PR

But I see one issue. After this PR we will have a switch button for shortener URLs for emails, but on SMS it's automatically enabled. Probably we should have a switch button also for SMS. But in the end I can add it in my PR and cleanup

@christian-krieg
Copy link
Contributor Author

Probably we should add it for all available channels then? By the way, in my opinion it makes sense to auto-enable it for SMS, since the tracking links are ultra-long, likely to span multiple messages.

@escopecz
Copy link
Sponsor Member

Ok. I'll wait for the second approval

Copy link
Contributor

@volha-pivavarchyk volha-pivavarchyk left a comment

Choose a reason for hiding this comment

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

Works well as discribed in PR #12111.

image

@escopecz escopecz added this to the 5.0-alpha milestone Jun 5, 2023
@escopecz escopecz added ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed pending-test-confirmation PR's that require one test before they can be merged labels Jun 5, 2023
@escopecz
Copy link
Sponsor Member

escopecz commented Jun 5, 2023

@christian-krieg please resolve the conflict

@christian-krieg
Copy link
Contributor Author

christian-krieg commented Jun 5, 2023

@escopecz The "Mark as resolved" button is grayed out; It seems that I am not able to do this.

@escopecz
Copy link
Sponsor Member

escopecz commented Jun 6, 2023

It's better to do this on your local by either rebasing to the fresh 5.x branch or merging it. Rebase is a cleaner way if there are not many conflicts. Let me know if you need more details on how to do this.

@escopecz escopecz added the needs-rebase PR's that need to be rebased label Jun 20, 2023
@escopecz escopecz removed this from the 5.0-alpha milestone Jun 20, 2023
@escopecz
Copy link
Sponsor Member

@christian-krieg could you please resolve the conflict so this PR could be merged? It's also blocking #12299 which needs to go into 5.0.0-beta so it must get in within a week or so.

@escopecz escopecz added this to the 5.0-beta milestone Jul 20, 2023
@escopecz escopecz self-requested a review July 20, 2023 12:43
@escopecz escopecz merged commit 150bb60 into mautic:5.x Jul 20, 2023
14 checks passed
@mautibot
Copy link

This pull request has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/mautic-5-beyond-expectations-beyond-limits/30459/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The PR contributors have signed the contributors agreement email Anything related to email enhancement Any improvement to an existing feature or functionality needs-rebase PR's that need to be rebased ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged sms Anything related to SMS T2 Medium difficulty to fix (issue) or test (PR)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants