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

refactor: contexts and builders #579

Merged
merged 4 commits into from
Aug 6, 2024

Commits on Aug 1, 2024

  1. refactor: contexts and builders

    introduces the NotificationContext and ContextBuilder classes.
    the only specialization currently is for the PR comment.
    
    the context builders generate the context details necessary to create and
    send the message later on. Each step is called in order, and if one step fails
    we bail with an exception. This means the notification can't be sent.
    giovanni-guidini committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    1c41841 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. address review comments

    Create a descriptor for notification context fields so that we fail with a
    custom exception if that field was not loaded but we are trying to access it.
    
    With the added benefit of reducing the amount of code a little bit :E
    
    I added typehints to the fields (e.g. `pull: EnrichedPull = NotificationContextField[EnrichedPull]()`) because my VSCode langauge server was not being helpful with the generics... but leaving the generics in any case.
    giovanni-guidini committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    670dd89 View commit details
    Browse the repository at this point in the history
  2. feat: add ability to re-use contexts

    This lets us only load the necessary info once and re-use the calculations for subsequent contexts that need to be built.
    giovanni-guidini committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    53daee6 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2024

  1. address review comments:

    * improve docstrings
    * change bundle analysis PR comment context name
    giovanni-guidini committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    f4f8e97 View commit details
    Browse the repository at this point in the history