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

Add track by to notification drawer #1988

Conversation

benjaminapetersen
Copy link
Contributor

re issue #1981

Working on testing with a high volume of events to ensure it performs as expected.

@spadgett @jeff-phillips-18

@jeff-phillips-18
Copy link
Member

Working on getting patternfly/angular-patternfly#602 available to you in console.

@jeff-phillips-18
Copy link
Member

Did you have issue upgrading the angular patternfly version? I got bower install issues:

`Please note that,
origin-web-catalog#0.0.41, origin-web-console depends on angular-bootstrap#0.14.3 which resolved to angular-bootstrap#0.14.3
angular-patternfly#4.7.1, angular-patternfly#4.5.6 depends on angular-bootstrap#2.2.x which resolved to angular-bootstrap#2.2.0
Resort to using angular-bootstrap#0.14.3 which resolved to angular-bootstrap#0.14.3
Code incompatibilities may occur.

bower ECONFLICT Unable to find suitable version for angular-patternfly
`

I am trying to update origin-web-catalog first.

@spadgett
Copy link
Member

@benjaminapetersen You don't necessarily need a high volume. You just need one event that updates ("seen 23 times in the last 2 hours") like a crash looping pod.

if(EventsService.isImportantEvent(event) && !EventsService.isCleared(event)) {
ensureProjectGroupExists(filtered, event.metadata.namespace);
filtered[event.metadata.namespace].notifications.push({
unread: !EventsService.isRead(event),
uid: eventId,
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer event.metadata.uid here so it doesn't matter how the map is keyed. uid seems safest since it's globally unique.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, updating this.

@benjaminapetersen
Copy link
Contributor Author

@jeff-phillips-18 yup, i did. Prob need to update catalog & all too 😕
I wonder if, for common & catalog, we could set the bower dependencies with greater than:

"angular-patternfly": ">4.3.0",  # at least this, but later is fine!
"angular-patternfly": "~4.3.0",  # current form, tilde limits us to patches only...

This would still allow the origin-web-console to be the single source of truth & keep our builds consistent, but might get us out of the need to update the 2 secondary repos with change?

@@ -154,11 +154,12 @@
var formatAndFilterEvents = function(eventMap) {
var filtered = {};
ensureProjectGroupExists(filtered, $routeParams.project);
_.each(eventMap, function(event) {
_.each(eventMap, function(event, eventUID) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd still rather just use event.metadata.uid below instead of relying on the map being keyed by UID. Then if it ever changes later in eventWatchCallback, this function won't be affected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think the changes to the notification drawer allow for a nested field. @jeff-phillips-18

Code here looks like it has to be top level on the object:

ng-repeat="notification in notificationGroup.notifications track by $ctrl.notificationTrackField ? notification[$ctrl.notificationTrackField] || $index : $index"

If I'm following what you are saying.

@benjaminapetersen benjaminapetersen force-pushed the bpeterse/issue/1981/notification-drawer-flicker branch from 8bfd50b to 94d3de8 Compare August 31, 2017 18:13
@@ -159,6 +159,7 @@
ensureProjectGroupExists(filtered, event.metadata.namespace);
filtered[event.metadata.namespace].notifications.push({
unread: !EventsService.isRead(event),
uid: event.metadata.uid,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@spadgett fixed

eventsByNameData = eventData.by('metadata.name');
eventsMap = formatAndFilterEvents(eventsByNameData);
eventsByUID = eventData.by('metadata.uid');
eventsMap = formatAndFilterEvents(eventsByUID);
Copy link
Member

Choose a reason for hiding this comment

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

It's better to leave this as eventsByName unless we need it mapped by UID because data.by('metadata.name') is a no-op. data.by('metadata.uid') forces the map to be re-keyed.

Being a bit nit picky here because I'm afraid this might get called frequently.

Copy link
Member

Choose a reason for hiding this comment

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

I'd make it a local var to this function if it's not used outside the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can swap it back here (though I think I'm going to turn it right back to uid in my next PR adding the other kind of notifications, but will see if I can leave it .name 😄 )

Copy link
Member

Choose a reason for hiding this comment

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

OK that's fine then as long as it's needed

@benjaminapetersen benjaminapetersen force-pushed the bpeterse/issue/1981/notification-drawer-flicker branch from 94d3de8 to a7f96ff Compare September 1, 2017 13:31
@spadgett
Copy link
Member

spadgett commented Sep 1, 2017

[test]

@spadgett
Copy link
Member

spadgett commented Sep 1, 2017

@benjaminapetersen You also need to bump origin-web-catalog that @jeff-phillips-18 released to avoid the bower conflict

@benjaminapetersen benjaminapetersen force-pushed the bpeterse/issue/1981/notification-drawer-flicker branch from a7f96ff to 8dc5fca Compare September 1, 2017 14:31
@benjaminapetersen
Copy link
Contributor Author

bumped

[test] again

@spadgett
Copy link
Member

spadgett commented Sep 1, 2017

[merge][severity: bug]

@openshift-bot
Copy link

openshift-bot commented Sep 1, 2017

Origin Web Console Test Results: Waiting: Determining build queue position

@spadgett
Copy link
Member

spadgett commented Sep 1, 2017

[merge][severity: bug]

@spadgett
Copy link
Member

spadgett commented Sep 1, 2017

@benjaminapetersen We have a conflict in bower.json now :(

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 1, 2017
@benjaminapetersen
Copy link
Contributor Author

Heh, resolving....

@benjaminapetersen benjaminapetersen force-pushed the bpeterse/issue/1981/notification-drawer-flicker branch from 8dc5fca to 9b6611a Compare September 1, 2017 17:57
@benjaminapetersen
Copy link
Contributor Author

[test]

@benjaminapetersen
Copy link
Contributor Author

Welp, lets see...

@benjaminapetersen
Copy link
Contributor Author

Already fixed this:

        "CONFLICT (content): Merge conflict in dist/scripts/scripts.js", 
        "Auto-merging bower.json", 
        "CONFLICT (content): Merge conflict in bower.json", 

[test] again?

@benjaminapetersen
Copy link
Contributor Author

😐 😒

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 1, 2017
@spadgett
Copy link
Member

spadgett commented Sep 1, 2017

@benjaminapetersen Make sure you bower install again if you haven't. A couple bower updates went in today.

@benjaminapetersen
Copy link
Contributor Author

@spadgett yup, I'm rebased on master, hack/clean/install multiple times. Something is a little wonky, trying to figure out what.

@spadgett
Copy link
Member

spadgett commented Sep 1, 2017

@benjaminapetersen Make sure you've rebased on latest master, too, even if there aren't merge conflicts. Sometimes the uglified output changes.

@benjaminapetersen benjaminapetersen force-pushed the bpeterse/issue/1981/notification-drawer-flicker branch from 9b6611a to 362717c Compare September 5, 2017 14:41
@benjaminapetersen
Copy link
Contributor Author

Pretty sure this is a flake:

FAIL
   Error: cannot generate registry resources
   Caused By:
     Error: Docker exec error
     Details:
       Container: origin
       Command: [oc adm registry --dry-run --output=json --images=openshift/origin-${component}:latest --mount-host=/var/lib/origin/openshift.local.pv/registry]
       Result Code: 137

++ export status=FAILURE
++ status=FAILURE
+ set +o xtrace
########## FINISHED STAGE: FAILURE: START OPENSHIFT SERVER [00h 04m 16s] ##########
Build step 'Execute shell' marked build as failure
[PostBuildScript] - Execution post build scripts.

[test]

@spadgett
Copy link
Member

spadgett commented Sep 5, 2017

Tests will probably fail until #2003 merges

@openshift-bot
Copy link

Evaluated for origin web console test up to 362717c

@openshift-bot
Copy link

Origin Web Console Test Results: FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_web_console/128/) (Base Commit: 5709d8a) (PR Branch Commit: 362717c)

@spadgett
Copy link
Member

spadgett commented Sep 6, 2017

[merge][severity: blocker]

@openshift-bot
Copy link

Evaluated for origin web console merge up to 362717c

@openshift-bot openshift-bot merged commit 4d49437 into openshift:master Sep 6, 2017
@openshift-bot
Copy link

Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin_web_console/112/) (Base Commit: 6ff495e) (PR Branch Commit: 362717c) (Extended Tests: blocker, bug)

@benjaminapetersen benjaminapetersen deleted the bpeterse/issue/1981/notification-drawer-flicker branch September 6, 2017 14:02
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.

4 participants