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

Changing Colt parsing to use Subject and remove ICal #105

Merged
merged 3 commits into from
Nov 2, 2021

Conversation

pke11y
Copy link
Contributor

@pke11y pke11y commented Nov 1, 2021

This PR is an update for Colt notifications to accommodate maintenance notification status updates, which do not contain .ics files. All info is in the email subject.

Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

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

Can you clarify why you've removed ICalParserColt1? Based on my limited understanding it seems like this PR should be adding a new processor/parser option, not removing/replacing the iCal support.

@pke11y
Copy link
Contributor Author

pke11y commented Nov 2, 2021

@glennmatthews the objective was to consolidate the number of parsers. Update notifications do no contain an ICal attachment. Most of the useful information is contained in the subject for all notifications. So we're extracting the account number from the CSV file now instead of the ICal attachment and all of the rest is in the subject.

chadell
chadell previously approved these changes Nov 2, 2021
Copy link
Collaborator

@chadell chadell left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -87,11 +87,6 @@
# Path(dir_path, "data", "cogent", "cogent2_result.json"),
# ),
# Colt
(
ICalParserColt1,
Path(dir_path, "data", "colt", "colt1"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we are removing this parser, why do we keep the test data file?

Copy link
Contributor Author

@pke11y pke11y Nov 2, 2021

Choose a reason for hiding this comment

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

Seems to be an old version. The test has been removed. The data file is still in the repo as the colt1 is an .ics attachment included in the colt3.eml.

@glennmatthews
Copy link
Contributor

@glennmatthews the objective was to consolidate the number of parsers. Update notifications do no contain an ICal attachment. Most of the useful information is contained in the subject for all notifications. So we're extracting the account number from the CSV file now instead of the ICal attachment and all of the rest is in the subject.

Hm, okay. I had thought that a goal of this library was to prefer the standard iCal format where possible since it's an emerging standard. Disregarding a (standardized, easy-to-parse) iCal attachment from this specific provider in favor of (fragile, error-prone) HTML parsing feels like a step backwards to me. I'll defer to you and @chadell on this point though.

@chadell
Copy link
Collaborator

chadell commented Nov 2, 2021

@glennmatthews the objective was to consolidate the number of parsers. Update notifications do no contain an ICal attachment. Most of the useful information is contained in the subject for all notifications. So we're extracting the account number from the CSV file now instead of the ICal attachment and all of the rest is in the subject.

Hm, okay. I had thought that a goal of this library was to prefer the standard iCal format where possible since it's an emerging standard. Disregarding a (standardized, easy-to-parse) iCal attachment from this specific provider in favor of (fragile, error-prone) HTML parsing feels like a step backwards to me. I'll defer to you and @chadell on this point though.

@glennmatthews you are right about the preference for the icalendar standard format, but this one is not following the BCOP, just using icalendar and the point from the PR (if I understand correctly) was to use the email subject to get all the information that was part of the icalendar part because the Status info was not part of the icalendar one and the subject parser was also needed, so it gets rid of one parser that was providing info that was available on the other parts, and was useless alone. does it sound accurate @pke11y ?

@pke11y
Copy link
Contributor Author

pke11y commented Nov 2, 2021

@glennmatthews the objective was to consolidate the number of parsers. Update notifications do no contain an ICal attachment. Most of the useful information is contained in the subject for all notifications. So we're extracting the account number from the CSV file now instead of the ICal attachment and all of the rest is in the subject.

Hm, okay. I had thought that a goal of this library was to prefer the standard iCal format where possible since it's an emerging standard. Disregarding a (standardized, easy-to-parse) iCal attachment from this specific provider in favor of (fragile, error-prone) HTML parsing feels like a step backwards to me. I'll defer to you and @chadell on this point though.

@glennmatthews you are right about the preference for the icalendar standard format, but this one is not following the BCOP, just using icalendar and the point from the PR (if I understand correctly) was to use the email subject to get all the information that was part of the icalendar part because the Status info was not part of the icalendar one and the subject parser was also needed, so it gets rid of one parser that was providing info that was available on the other parts, and was useless alone. does it sound accurate @pke11y ?

That's correct. We need the subject parser to get update Status and it turns out all of the other major data can be retrieved from the subject too.

Copy link
Collaborator

@chadell chadell left a comment

Choose a reason for hiding this comment

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

LGTM

@pke11y pke11y merged commit 06eb0b2 into networktocode:develop Nov 2, 2021
@pke11y pke11y deleted the pk_colt_html branch November 2, 2021 15:09
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.

3 participants