-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
backend db & API support to show how many comments exist for an issue #219
Conversation
- add function to Bounty model to pull github comments - extend refresh_bounties command to pull github comments & update Refs: gitcoinco#206
@@ -45,12 +45,15 @@ def search(q): | |||
return response.json() | |||
|
|||
|
|||
def get_issue_comments(owner, repo): | |||
def get_issue_comments(owner, repo, issue=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't find any existing usages of this function
method signature remains consistent but allows for retrieving comments of a single issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Some of the functionality has changed in the GH integration PR.
@@ -200,6 +200,10 @@ | |||
SECURE_HSTS_PRELOAD = True | |||
SECURE_HSTS_SECONDS = 3600 | |||
|
|||
# List of github usernames to not count as comments on an issue | |||
IGNORE_COMMENTS_FROM = ['gitcoinbot', ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put this here to make it easy to override
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very nice.. thanks
name='github_comments', | ||
field=models.IntegerField(default=0), | ||
), | ||
migrations.AlterField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added help_text to 2 of the fields -- keeping them here to avoid generating extra migrations
@@ -252,6 +254,30 @@ def fetch_issue_description(self): | |||
if body: | |||
self.issue_description = body | |||
|
|||
def fetch_issue_comments(self, save=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uses the app.github
method to pull comments via API vs parsing html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has changed in: #156
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure which PR will land first, easy enough to pull your changes in but I'll wait till this has had a 2nd review
digging what I see in #156
Travis CI failures are unrelated to this PR -- have a question about process to fix in Slack https://gitcoincommunity.slack.com/archives/C7BQHUPAN/p1515202126000159 |
@@ -252,6 +254,30 @@ def fetch_issue_description(self): | |||
if body: | |||
self.issue_description = body | |||
|
|||
def fetch_issue_comments(self, save=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has changed in: #156
app/dashboard/models.py
Outdated
github_user, github_repo, _, github_issue = parsed_url.path.split('/')[1:5] | ||
except ValueError: | ||
# TODO: update print statements to logger | ||
print('Invalid github url') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if it's worth logging and error here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably, the repo isn't setup for using the built-in logger that I saw -- easy enough to add but was aiming for a clean PR to make it easy to review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is some of the built in logging system being done in notifications.py
... not sure if that qualifies or helps or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
want me to throw a logging config into settings?
pretty much copy and paste, can dial it in later but will open up using logging.getLogger
@@ -45,12 +45,15 @@ def search(q): | |||
return response.json() | |||
|
|||
|
|||
def get_issue_comments(owner, repo): | |||
def get_issue_comments(owner, repo, issue=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Some of the functionality has changed in the GH integration PR.
hey @amites can you please merge the frontend code into this branch? looking fwd to getting it live |
I'll start building it out, @ethikz had a couple snippets but far from a complete solution wasn't sure what was in mind for process |
updated UI -- #156 is still open to hesitant to pull in changes |
thanks. screenshots look good! i will review once the mobile UI stuff has been committed |
ended up fixing the mobile UI last night -- merge conflicts |
app/assets/v2/css/base.css
Outdated
@@ -650,8 +650,12 @@ input[type=text].loading { | |||
width: 45%; | |||
display: inline-block; | |||
} | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amites merge conflict :)
app/assets/v2/css/base.css
Outdated
background: url(/static/v2/images/icon-msg-red-16.png) no-repeat left transparent; | ||
} | ||
body.bounty_details a.btn-darkGrey{ | ||
======= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few more down here too
pulled down the code and ran |
app/dashboard/models.py
Outdated
expires_date = models.DateTimeField() | ||
raw_data = JSONField() | ||
metadata = JSONField(default={}) | ||
claimee_metadata = JSONField(default={}) | ||
current_bounty = models.BooleanField(default=False) # whether this bounty is the most current revision one or not | ||
current_bounty = models.BooleanField(default=False, | ||
help_text='whether this bounty is the most current revision one or not') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor nitpick... Should we move forward with a standard of capitalizing the first letter in help_text
or keep it all lowercase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the comment pertaining to the superfluous help_text
question, LGTM!
nice nit-pick for consistency -- updated |
backend db & API support to show how many comments exist for an issue
postcard download and fixes
Description
Checklist
Affected core subsystem(s)
Refers/Fixes
Works on: #206