Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

Add watchers #20

Merged
merged 21 commits into from
Aug 14, 2013
Merged

Add watchers #20

merged 21 commits into from
Aug 14, 2013

Conversation

milki
Copy link
Contributor

@milki milki commented Jun 24, 2013

A watcher or list of watchers can be assigned to pull requests. Watchers are listed as alternate owners of the request and are pinged wherever the original requester would be pinged.

This PR includes a new test framework for templates. In doing so, some templates were refactored for easier template testing.

Unfortunately, the javascript changes do not have automatic tests. They have been verified through smoke testing with a local test instance and IRC.

Note: This also encompasses the feature request in PR #16

ymilki added 11 commits June 27, 2013 09:39
TemplateTestCase provides the bare minimum needed to test
templates through rendering.
A watcher or list of watchers can be assigned to pull requests.
Watchers are listed as alternate owners of the request and are
pinged wherever the original requester would be pinged.
Additionally protect push buttons from random users
authorized_to_manage_requests returns True for:
	request owner
	request watchers
	pushmaster
class="mine" is a visual indicator for request ownership in the
request lists. Include watchers as well.
requester_edit_button_text = ['Edit', 'Delay', 'Discard']
edit_button_classes = ['edit-request']
edit_button_text = ['Edit']

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All these buttons need to be verified to be displayed on the website as well. Some of these don't show up because of CSS. For example, the push_button_classes aren't showing up for pushmaster.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only made un-pickme visible in the pickme state with 8a0e3a3. The other one's are redundant with the pushmaster-only buttons.

Copy link
Contributor

Choose a reason for hiding this comment

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

This might be testable with something like webdriver + phantomjs, which would be super cool but is probably out of scope for now.

@@ -87,7 +87,7 @@ $(function() {
});
$('.message-people').live('click', function() {
var contents = $(this).siblings('.item-count').text();
var people = (/(?:[a-z]+,?\s?)+/.exec(contents) || [""])[0];
var people = (/(?:[a-z]+(?:\s\((?:[a-z]+,?\s?)+\))?,?\s?)+/.exec(contents) || [""])[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

Uh... can we unpack this? This is crazypants.

Does js allow multi-line regex or anything else to make this easier to digest? At least can we separate the regex insanity from the other stuff that's going on (calling exec, assigning to people)?

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've found that vanilla javascript doesnt support the /x verbose mode of regexes though there is an alternative XRegexp.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine about /x. lol javascript.

Please still unpack the other complexity from the line.

@mrtyler
Copy link
Contributor

mrtyler commented Jul 10, 2013

This looks good, modulo my complaints above. I really like the template refactoring and template unit tests!

@baris
Copy link
Contributor

baris commented Jul 28, 2013

These changes look good to me. @milki++ for template tests! What's the plan to resolve the conflict & merge this in?

@milki
Copy link
Contributor Author

milki commented Jul 29, 2013

I'll merge master into watchers and fix conflicts.

@milki
Copy link
Contributor Author

milki commented Jul 29, 2013

Also, I need to provide a sqlscript for both sqlite3 and mysql and test an actual migration.

Conflicts:
	testing/testservlet.py
	tests/test_template_newrequest.py
var people_pat = new RegExp( // person, person (person, person), person (person), person
"(?:[a-z]+" + // A username, possibly followed by:
"(?:\\s\\(" + // a space and (
"(?:[a-z]+,?\\s?)+" + // and or more comma seperated usernames
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably meant to say one or more here. Also probably good to mention this in the form.

@milki
Copy link
Contributor Author

milki commented Jul 31, 2013

I've realized I've also forgotten to email watchers on request status changes.

@milki
Copy link
Contributor Author

milki commented Aug 7, 2013

There are two outstanding issues beyond are beyond the scope of this PR:

#26 Duplicate emails which needs to be investigated.

#25 Prevents testing for the CommentRequest servlet. Thus, it has not been included in this PR.

As mentioned above, javascript testing and template styling issues is beyond the scope of this PR as well.

Other than the above issues which can be addressed later, this PR is ready for review.

@@ -1,3 +1,14 @@
2013.07.29
AFFECTS: Users with existing installs before commit $add_watchers-merge$
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Update this to the merge commit sha after the merge.

@baris
Copy link
Contributor

baris commented Aug 12, 2013

Ship it!

@milki milki merged commit 1f473c8 into Yelp:master Aug 14, 2013
milki pushed a commit that referenced this pull request Aug 14, 2013
A watcher or list of watchers can be assigned to pull requests. Watchers
are listed as alternate owners of the request and are pinged wherever
the original requester would be pinged.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants