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

Respect new strict parsing of email.utils.getaddresses #4023

Merged
merged 5 commits into from
Oct 16, 2024

Conversation

petschki
Copy link
Member

@petschki petschki commented Oct 9, 2024

preferred solution for #4020 ... successor of #4021

@mister-roboto
Copy link

@petschki thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

@jenkins-plone-org please run jobs

@petschki petschki force-pushed the getaddresses_strict_parsing_fix branch from 4504573 to ad95869 Compare October 9, 2024 07:14
@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

@jenkins-plone-org please run jobs

Copy link
Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. I have a few suggestions.
PloneTool.py has these methods:

  • validateEmailAddresses: validate a string with possibly multiple email addresses. For each address this calls validateSingleNormalizedEmailAddress.
  • validateSingleEmailAddress: validate a string with at most ONE email address. For this address this calls validateSingleNormalizedEmailAddress.
  • validateSingleNormalizedEmailAddress only needs to handle one address, obviously.
  • In all three methods: after checking if it is a string, can we do a .strip()?
  • In the two methods handling only a single address, can we do address.splitlines() and exit when this returns more than one line? In both cases this can replace the use of EMAIL_CUTOFF_RE.

BTW, I agree with your removing this line from the valid inputs:

 user@example.org\n user2@example.org",  # omitting comma is ok

Products/CMFPlone/PloneTool.py Show resolved Hide resolved
@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

BTW, I agree with your removing this line from the valid inputs:

 user@example.org\n user2@example.org",  # omitting comma is ok

I first moved this line to the invalid inputs but then it fails on current py3.10 jenkins with no strict parsing.

@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

@jenkins-plone-org please run jobs

@petschki
Copy link
Member Author

petschki commented Oct 9, 2024

Currently its hard to get a green jenkins ...

@petschki
Copy link
Member Author

@jenkins-plone-org please run jobs

@petschki
Copy link
Member Author

@jenkins-plone-org please run jobs

1 similar comment
@rohnsha0
Copy link
Contributor

@jenkins-plone-org please run jobs

@rohnsha0
Copy link
Contributor

Is Node4 experiencing flakiness again, or could the issues be related to code changes?

@petschki
Copy link
Member Author

@rohnsha0 please see progress here #4019

@rohnsha0
Copy link
Contributor

Ah, I understood... thanks for providing more info!

@petschki
Copy link
Member Author

Currently the build is broken because of this strict parsing which got backported to 3.10 too (see https://jenkins.plone.org/job/plone-6.1-python-3.10/371/) ... anyone willing to approve here?

Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for working on this

Copy link
Contributor

@rohnsha0 rohnsha0 left a comment

Choose a reason for hiding this comment

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

LGTM

@petschki
Copy link
Member Author

petschki commented Oct 16, 2024

I assume the 6.1-3.12 jenkins job will fail due to the flaky robottests ... if the 3.10 job is green I'll merge.

EDIT: I do not have permissions to merge

@petschki petschki merged commit abd111b into master Oct 16, 2024
4 checks passed
@petschki petschki deleted the getaddresses_strict_parsing_fix branch October 16, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants