Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43256

SSE event subscription should be organization aware

    Details

    • Similar Issues:
    • Epic Link:
    • Sprint:
      Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2, Blue Ocean 1.1-beta4

      Description

      BlueOcean UI subscribes to SSE event without providing organization in the subscription filter.

      There are couple of places it needs to add jenkins_org in the sse subscription filter:

      For example:

      this.jobListener = this.connection.subscribe('job', (event) => {
                      this._handleJobEvent(event);
                  }, {
          jenkins_org: 'org-1'
      });
      

      See Tom FENNELLY comments for detail.

        Attachments

          Activity

          jamesdumay James Dumay created issue -
          jamesdumay James Dumay made changes -
          Field Original Value New Value
          Epic Link JENKINS-35737 [ 171801 ]
          Hide
          tfennelly Tom FENNELLY added a comment -

          The jenkins org is set as a property on all events (see screenshot), so should just be a case of tweaking the SSE subscription in the UI code to specify the org as a filter.

          Show
          tfennelly Tom FENNELLY added a comment - The jenkins org is set as a property on all events (see screenshot), so should just be a case of tweaking the SSE subscription in the UI code to specify the org as a filter .
          tfennelly Tom FENNELLY made changes -
          Attachment Screenshot 2017-03-31 07.18.12.png [ 36838 ]
          Hide
          tfennelly Tom FENNELLY added a comment - - edited

          So as an example:

          var sse = require('@jenkins-cd/sse-gateway');
          
          var connection = sse.connect();
          
          // Add a filter as the last parameter ...
          var jobSubs = connection.subscribe('job', function (event) {
              // the events coming through here are only from the "org-1" Jenkins org
          }, {
              jenkins_org: 'org-1'
          });
          

          So in the Blue 0cean code, we need to find out where the subscriptions are setup and then add that filter to them.

          Show
          tfennelly Tom FENNELLY added a comment - - edited So as an example: var sse = require( '@jenkins-cd/sse-gateway' ); var connection = sse.connect(); // Add a filter as the last parameter ... var jobSubs = connection.subscribe( 'job' , function (event) { // the events coming through here are only from the "org-1" Jenkins org }, { jenkins_org: 'org-1' }); So in the Blue 0cean code, we need to find out where the subscriptions are setup and then add that filter to them.
          vivek Vivek Pandey made changes -
          Summary SSE should be organization aware SSE event subscription should be organization aware
          vivek Vivek Pandey made changes -
          Description TBD Vivek to fill in BlueOcean UI subscribes to SSE event without providing organization in the subscription filter.

          There are couple of places it needs to add *jenkins_org* in the sse subscription filter:

          * [SseBus.js|https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean-core-js/src/js/sse/SseBus.js#L45]
          * [SSEService.js|https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean-core-js/src/js/services/SSEService.js#L11]

          For example:
          {code}
          this.jobListener = this.connection.subscribe('job', (event) => {
                          this._handleJobEvent(event);
                      }, {
              jenkins_org: 'org-1'
          });
          {code}

          See [~tfennelly] comments for detail.
          michaelneale Michael Neale made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          michaelneale Michael Neale made changes -
          Labels cloudbees-internal-steel techical-debt cloudbees-internal-steel technical-debt
          michaelneale Michael Neale made changes -
          Sprint Blue Ocean 1.1 [ 271 ] Blue Ocean - techdebt sprint 1 [ 291 ]
          vivek Vivek Pandey made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          vivek Vivek Pandey made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          michaelneale Michael Neale made changes -
          Sprint Blue Ocean - 1.1-beta-1 [ 291 ] Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2 [ 291, 306 ]
          jamesdumay James Dumay made changes -
          Sprint Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2 [ 291, 306 ] Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2, Blue Ocean 1.1-beta3 [ 291, 306, 316 ]
          vivek Vivek Pandey made changes -
          Status In Review [ 10005 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          jbriden Jenn Briden made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              vivek Vivek Pandey
              Reporter:
              jamesdumay James Dumay
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: