Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !1675

Merged
Created Oct 10, 2012 by Administrator@rootOwner

Separate observing of Note and MergeRequests

  • Overview 6
  • Commits 2
  • Changes 11

Created by: robbkidd

It's been awhile since I tackled the observers. Note and MergeRequest had not seen any love yet and were still mashed together in MailerObserver. Here is my latest on fixing that with separate observers for Note and MergeRequest.

  • Move is_assigned? and is_being_xx? methods to IssueCommonality

    This is behavior merge requests have in common with issues. Moved methods to IssueCommonality role. Put specs directly into merge_request_spec.rb because setup differs for issues and MRs specifically in the "closed" factory to use.

  • Add MergeRequestObserver. Parallels IssueObserver in almost every way.

    Ripe for refactoring, but tricky because of the different mailer methods and views.

  • Rename MailerObserver to NoteObserver

    With merge request observing moved out of MailerObserver, all that was left was Note logic. Renamed to NoteObserver, added tests and updated application config for new observer names. Refactored NoteObserver to use the note's author and not rely on current_user.

  • Set current_user for MergeRequestObserver

    IssueObserver and MergeRequestObserver are the only observers that need a reference to the current_user that they cannot look up on the objects they are observing.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/robbkidd/separate_mr_observer