Skip to content

refactor: organize the Sources in different files for easier development#339

Open
chadell wants to merge 12 commits intodevelopfrom
refactor-source-notifications
Open

refactor: organize the Sources in different files for easier development#339
chadell wants to merge 12 commits intodevelopfrom
refactor-source-notifications

Conversation

@chadell
Copy link
Contributor

@chadell chadell commented Apr 26, 2025

What's Changed

This PR only refactored the sources.py into a sources module breaking down the features per file. Only necessary refactor changes done.

To Do

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

Copy link
Contributor

@gsnider2195 gsnider2195 left a comment

Choose a reason for hiding this comment

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

Looks good!

…l.py

Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com>
@jvanderaa
Copy link
Collaborator

@chadell what do we want to do with this?

@chadell
Copy link
Contributor Author

chadell commented Jul 28, 2025

@chadell what do we want to do with this?

housekeeping, organize the Sources in different files now that we have 4 different types

@jvanderaa
Copy link
Collaborator

Looks like pylint has some issues with the changes @chadell

@jvanderaa jvanderaa self-requested a review as a code owner December 9, 2025 17:58
@github-actions
Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  nautobot_circuit_maintenance
  forms.py
  views.py 424, 494
  nautobot_circuit_maintenance/handle_notifications
  handler.py
  nautobot_circuit_maintenance/handle_notifications/sources
  __init__.py
  base.py 26, 42, 55, 59, 74, 78
  email.py 63-70, 90-91, 100, 118-126, 130-135
  ews.py 12-13, 41
  exceptions.py 9-11
  factory.py 17-18, 57-60, 85, 127-133, 154-160
  gmail.py 50, 54, 58-59, 67-79, 116-120, 127-137, 161-175, 184-220, 231-250, 258-262
  imap.py 57-60, 66-116
  maintenance_notification.py
Project Total  

This report was generated by python-coverage-comment-action

@jvanderaa
Copy link
Collaborator

@chadell what do you think with this? I made a few updates in to help get past the test failures.

@jvanderaa
Copy link
Collaborator

@gsnider2195 I'd like to get your eyes on this one more time.

@chadell
Copy link
Contributor Author

chadell commented Dec 12, 2025

@chadell what do you think with this? I made a few updates in to help get past the test failures.

looks good to me



class CircuitMaintenanceBulkEditForm(TagsBulkEditFormMixin, NautobotBulkEditForm):
class CircuitMaintenanceBulkEditForm(NautobotBulkEditForm, TagsBulkEditFormMixin):
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this not working properly?

Comment on lines +28 to +29
from nautobot_circuit_maintenance.handle_notifications.sources.email import EmailSource
from nautobot_circuit_maintenance.handle_notifications.sources.gmail import GmailAPI
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make these importable from nautobot_circuit_maintenance.handle_notifications.sources?


from .sources import MaintenanceNotification, get_notifications
from .sources import get_notifications
from .sources.maintenance_notification import MaintenanceNotification
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this importable from .sources?

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