Skip to content
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

Separate out wpt-specific parts of config from wptserve #10850

Merged
merged 1 commit into from May 8, 2018
Merged

Conversation

jgraham
Copy link
Contributor

@jgraham jgraham commented May 4, 2018

I need to land something like this upstream; just creating this PR to ensure that all the tests pass in Travis.


This change is Reviewable

@jgraham jgraham requested a review from gsnedders May 4, 2018 14:23
@jgraham jgraham force-pushed the config_fix branch 4 times, most recently from a6968aa to 9f77a66 Compare May 6, 2018 19:13
Copy link
Member

@gsnedders gsnedders left a comment

Choose a reason for hiding this comment

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

So yeah, my main thought is that this is a UX regression?

@property
def paths(self):
return {"doc_root": self.doc_root,
"ws_doc_root": self.ws_doc_root}
Copy link
Member

Choose a reason for hiding this comment

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

You removed ws_doc_root above?

(We don't seem to have tests for this, though idk what we can do beyond copying the method and asserting it's equal, but even that badness would catch it throwing AttributeError.)

class Config(config.Config):
"""serve config

this subclasses wptserve.config.Config to add serve config options"""

_default = {
Copy link
Member

Choose a reason for hiding this comment

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

This to me seems like a big loss in discoverability compared with having it in the JSON file, as it makes it much harder to know what the format is if you want to modify anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, but that's a problem that almost no one has because almost no one modifies this. I think you're right and I"m happy to address it in a followup e.g. by changing the documentation or adding a config.sample.json file. However actually using a file would require inventing some substitution syntax to get the right root directory, which seems like even more complexity, which is why I changed things.

This moves the parts of the Config class that are specific to wpt into
serve.Config, so that wptserve can be used independently of the rest
of wpt. It also moves the sslutils module into wptserve since this is
required for the ssl configuration in wptserve and isn't useful
independently.

As part of this, the config.default.json file is removed in favour of
a default configuration defined in the class itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants