-
Notifications
You must be signed in to change notification settings - Fork 93
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
Feature: Remove dependency on config files #499
base: develop
Are you sure you want to change the base?
Conversation
I still need to patch up and create test cases around this change. I wanted to publish this early enough for feedback. |
Codecov Report
@@ Coverage Diff @@
## develop #499 +/- ##
========================================
Coverage 60.17% 60.17%
========================================
Files 29 29
Lines 1750 1750
Branches 272 272
========================================
Hits 1053 1053
Misses 620 620
Partials 77 77 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.
I'm on vacation until Wednesday, but at first glance I think this would be better if fedmsg.init
switched to the new fedmsg.config.conf
dictionary which has sane defaults and validators. You'll likely need to remove those validations of the endpoints setting in fedmsg.config.load_config
.
I did see the deprecation code in I will convert |
I'm not sure if this is the correct approach on using I still have to poke at test cases around this change but it is somewhat related to #500. |
fedmsg/__init__.py
Outdated
if kw: | ||
settings['settings'] = kw | ||
|
||
config.load_config(**settings) |
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.
Rather than creating a dict with a single key and immediately unpacking it, just do config.load_config(kw)
.
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 was waffling back and forth on how to do it. I figured there was a simpler way :). Thanks.
Could you rebase this onto the latest master? That should take care of the test suite failures. |
Rebased. |
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.
It looks like this breaks a couple of the tests on Python 2.7 - the validator expects unicode, but it's getting strings.
The fix should be to go to those failing tests which are using invalid config and make sure those strings are prefixed with u
. Thanks!
I've been poking at this for over an hour and I think the issue is more than just prefixing those strings with There's definitely a discrepancy between I started poking around and seeing if i could patch https://github.com/fedora-infra/fedmsg/blob/develop/fedmsg/commands/__init__.py#L45, so I could fix the |
I poked at this a little bit and ooof, this stuff is messy. The current CLI is pretty awful and should just be tossed out, as should the old config setup... Really the whole fedmsg API. Honestly, I feel that it's probably not worth trying to get this to work. I don't know what exactly you're using fedmsg for, but if it's not to work with existing Fedora infrastructure I really think you'd be happier using plain ZMQ. It's super simple to use and fedmsg is likely just getting in your way. That's not to say I won't accept this PR if you can make the current CLI and tests work with the new configuration, but I'm not sure it's the best use of time. |
This allows a publisher to send a complete configuration via
fedmsg.init()
.