-
Notifications
You must be signed in to change notification settings - Fork 31
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 ability to interact with fasjson #310
Conversation
So I'm not sure what the best way forward here is. The CI is failing and to make it pass there is a lot of work. The first blocker is removing python 2 support. I'm not sure of the implications of doing that. I think things like that might be best sorted in another PR. At the moment I can't run the tests locally, there are lots of errors even on py36. |
85a90b3
to
22c49db
Compare
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 haven't tested it yet, here are a few comments / changes to make.
fmn/consumer.py
Outdated
@@ -163,7 +164,11 @@ def work(self, session, raw_msg): | |||
log.info("Autocreating account for %r" % username) | |||
openid = '%s.id.fedoraproject.org' % username | |||
openid_url = 'https://%s.id.fedoraproject.org' % username | |||
email = get_fas_email(config.app_conf, username) | |||
fasjson = config.app_conf['fasjson'].get('active') |
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 don't know if we can assume that fasjson
is always there, if we can't we could do something like app_conf.get("fas_json", {}).get("active")
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.
+1 to that
Still failing on |
Signed-off-by: Stephen Coady <[email protected]>
Signed-off-by: Stephen Coady <[email protected]>
Signed-off-by: Stephen Coady <[email protected]>
Signed-off-by: Stephen Coady <[email protected]>
0b99f3a
to
d3fb63d
Compare
Codecov Report
@@ Coverage Diff @@
## develop #310 +/- ##
===========================================
- Coverage 58.33% 57.61% -0.73%
===========================================
Files 72 73 +1
Lines 3910 3994 +84
Branches 509 519 +10
===========================================
+ Hits 2281 2301 +20
- Misses 1559 1621 +62
- Partials 70 72 +2
Continue to review full report at Codecov.
|
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.
Yep, looks good. I commented on a possible minor improvement, but I think it's good to go as is.
return | ||
global client | ||
try: | ||
_add_to_cache(list(client.list_all_entities("users"))) |
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.
From a memory point of view it would be better to loop over list_all_entities
than building the list in memory. Something like:
for users in client.list_all_entities("users"):
_add_to_cache(users)
But that's not a blocker.
This commit adds the ability to interact with the new fasjson API. It builds its cache depending on the
fasjson
config flag from either FAS or the new fasjson.Signed-off-by: Stephen Coady [email protected]