This repository has been archived by the owner on Mar 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Feature/add new activities #7
Open
ahouseholder
wants to merge
5
commits into
uber-archive:master
Choose a base branch
from
ahouseholder:feature/add_new_activities
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/add new activities #7
ahouseholder
wants to merge
5
commits into
uber-archive:master
from
ahouseholder:feature/add_new_activities
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…valid activities.
…ternalUserJoined now. Fix for: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/client.py", line 109, in get_resource return rsrc_type.get(self, obj_id) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 171, in get return requester.request_object(cls.make_url(obj_id)) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/client.py", line 85, in request_object return hydrate_object(data, self) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 47, in hydrate_object return hydrator(requester, obj) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 162, in __init__ super(HackerOneResource, self).__init__(requester, raw_data) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 80, in __init__ self._handle_data() File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 93, in _handle_data self._hydrate() File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 294, in _hydrate self._make_relationship("activities", self._hydrate_list_of_objects, []) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 128, in _make_relationship rel_val = hydrator(rel_val["data"]) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 110, in _hydrate_list_of_objects return [self._hydrate_object(x) for x in val] File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 110, in <listcomp> return [self._hydrate_object(x) for x in val] File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 113, in _hydrate_object return hydrate_object(val, self._requester) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 47, in hydrate_object return hydrator(requester, obj) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 80, in __init__ self._handle_data() File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 93, in _handle_data self._hydrate() File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 411, in _hydrate self._activity_hydrate() File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 513, in _activity_hydrate self._make_attribute("duplicate_report_id", self._hydrate_verbatim) File "/Users/adh/anaconda/envs/py36/lib/python3.6/site-packages/h1/models.py", line 120, in _make_attribute attr_val = attrs[attr_name] KeyError: 'duplicate_report_id'
$ make lint test flake8 h1 tests h1/models.py:494:1: E302 expected 2 blank lines, found 1 h1/models.py:495:9: E225 missing whitespace around operator h1/models.py:497:1: E302 expected 2 blank lines, found 1 h1/models.py:543:1: E302 expected 2 blank lines, found 1 h1/models.py:546:1: E302 expected 2 blank lines, found 1 make: *** [lint] Error 1
Test data blobs added for the two new activities in commit b2c2dc0 |
Finally got it right. :-) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there,
(resubmitting #6 after fixing lint warnings)
I just used the h1 module to retrieve a bunch of reports out of HackerOne. It worked quite well, but I hit into three separate exceptions on different records.
activity-cve-id-added
activity-nobody-assigned-to-bug
duplicate_report_id should be optional
The two activities are present in the data although they are undocumented in the H1 API docs. I also ran across at least one report object that contained an activity-external-user-joined object without the duplicate_report_id attribute, so it seems like marking it as optional is the obvious fix.