profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/willkg/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Will Kahn-Greene willkg Mozilla https://bluesock.org/~willkg/ he/him; crash ingestion, python tools, etc

mozilla/bleach 2186

Bleach is an allowed-list-based HTML sanitizing library that escapes or strips markup and attributes

django-waffle/django-waffle 850

A feature flipper for Django

jsocol/django-ratelimit 762

Cache-based rate-limiting for Django

mozilla-services/socorro 519

Socorro is the Mozilla crash ingestion pipeline. It accepts and processes Breakpad-style crash reports. It provides analysis tools.

erikrose/peep 225

A "pip install" that is cryptographically guaranteed repeatable

mozilla/mozilla-django-oidc 218

A django OpenID Connect library

mozilla/sphinx-js 214

Autodoc-style extraction into Sphinx for your JS project

jsocol/jingo-minify 67

Concat and minify JS and CSS for Jinja2+Jingo+Django

mozilla/data-docs 61

A guide for Mozilla's developers and data scientists to analyze and interpret the data gathered by our data collection systems.

jbalogh/check 43

Simple script to run pep8.py and pyflakes on a git/svn repo.

delete branch willkg/tecken

delete branch : bug-1722602-everett

delete time in 21 hours

push eventmozilla-services/tecken

Will Kahn-Greene

commit sha 78652f13cc449b596bd05e247399df0b5611eb82

bug 1722602: update to everett 2.0.0 This updates Eliot to Everett 2.0.0 and reworks component configuration. It also fixes setup_metrics and setup_logging so they're explicit about what argument data is being used.

view details

push time in a day

PR merged mozilla-services/tecken

bug 1722602: update to everett 2.0.0

This updates Eliot to Everett 2.0.0 and reworks component configuration. It also fixes setup_metrics and setup_logging so they're explicit about what argument data is being used.

+191 -170

0 comment

7 changed files

willkg

pr closed time in a day

Pull request review commentmozilla-services/tecken

bug 1722602: update to everett 2.0.0

 def handle_exception(exctype, value, tb): sys.excepthook = handle_exception  -class AppConfig(RequiredConfigMixin):+class AppConfig:     """Application-level config.      Defines configuration needed for Eliot disk cache manager and convenience methods     for accessing it.      """ -    required_config = ConfigOptions()-    required_config.add_option(-        "local_dev_env",-        default="False",-        parser=bool,-        doc="Whether or not this is a local development environment.",-        alternate_keys=["root:local_dev_env"],-    )-    required_config.add_option(-        "host_id",-        default="",-        doc=(-            "Identifier for the host that is running Eliot. This identifies "-            "this Eliot instance in the logs and makes it easier to correlate "-            "Eliot logs with other data. For example, the value could be a "-            "public hostname, an instance id, or something like that. If you do not "-            "set this, then socket.gethostname() is used instead."-        ),-        alternate_keys=["root:host_id"],-    )-    required_config.add_option(-        "logging_level",-        default="INFO",-        doc="The logging level to use. DEBUG, INFO, WARNING, ERROR or CRITICAL",-    )-    required_config.add_option(-        "statsd_host", default="localhost", doc="Hostname for statsd server."-    )-    required_config.add_option(-        "statsd_port", default="8124", doc="Port for statsd server.", parser=int-    )-    required_config.add_option(-        "statsd_namespace", default="", doc="Namespace for statsd metrics."-    )-    required_config.add_option(-        "secret_sentry_dsn",-        default="",-        doc=(-            "Sentry DSN to use. If this is not set an unhandled exception logging "-            "middleware will be used instead.\n\n"-            "See https://docs.sentry.io/quickstart/#configure-the-dsn for details."-        ),-    )-    required_config.add_option(-        "symbols_cache_dir",-        default="/tmp/cache",-        doc="Location for caching symcache files.",-    )-    required_config.add_option(-        "symbols_cache_max_size",-        default=str(1024 * 1024 * 1024),-        parser=int,-        doc=(-            "Max size (bytes) of symbols cache. You can use _ to group digits for "-            "legibility."-        ),-    )+    class Config:+        local_dev_env = Option(+            default="False",+            parser=bool,+            doc="Whether or not this is a local development environment.",+            alternate_keys=["root:local_dev_env"],+        )+        host_id = Option(+            default="",+            doc=(+                "Identifier for the host that is running Eliot. This identifies "+                "this Eliot instance in the logs and makes it easier to correlate "+                "Eliot logs with other data. For example, the value could be a "+                "public hostname, an instance id, or something like that. If you do not "+                "set this, then socket.gethostname() is used instead."+            ),+            alternate_keys=["root:host_id"],+        )+        logging_level = Option(+            default="INFO",+            doc="The logging level to use. DEBUG, INFO, WARNING, ERROR or CRITICAL",+        )+        statsd_host = Option(default="localhost", doc="Hostname for statsd server.")+        statsd_port = Option(default="8124", doc="Port for statsd server.", parser=int)+        statsd_namespace = Option(default="", doc="Namespace for statsd metrics.")+        secret_sentry_dsn = Option(+            default="",+            doc=(+                "Sentry DSN to use. If this is not set an unhandled exception logging "+                "middleware will be used instead.\n\n"+                "See https://docs.sentry.io/quickstart/#configure-the-dsn for details."+            ),+        )+        symbols_cache_dir = Option(+            default="/tmp/cache",+            doc="Location for caching symcache files.",+        )+        symbols_cache_max_size = Option(+            default=str(1024 * 1024 * 1024),+            parser=int,+            doc=(+                "Max size (bytes) of symbols cache. You can use _ to group digits for "+                "legibility."+            ),+        )

Marvel at how much boilerplate we removed!

willkg

comment created time in a day

PullRequestReviewEvent

Pull request review commentmozilla-services/tecken

bug 1722602: update to everett 2.0.0

 def verify_configuration(self):         This will raise a configuration error if something isn't right.          """-        for key, opt in self.required_config.options.items():+        for key, val in get_config_for_class(self.__class__).items():             self.config(key)

Eliot doesn't have any namespaced components, so this works fine. If it did have namespaced components, I'm pretty sure this wouldn't work.

willkg

comment created time in a day

PullRequestReviewEvent

Pull request review commentmozilla-services/tecken

bug 1722602: update to everett 2.0.0

 def build_config_manager():     return config.with_namespace("eliot")  -class AppConfig(RequiredConfigMixin):+class AppConfig:     """Application-level config.      Defines configuration needed for Eliot and convenience methods for accessing it.      """ -    required_config = ConfigOptions()-    required_config.add_option(-        "local_dev_env",-        default="False",-        parser=bool,-        doc="Whether or not this is a local development environment.",-        alternate_keys=["root:local_dev_env"],-    )-    required_config.add_option(-        "host_id",-        default="",-        doc=(-            "Identifier for the host that is running Eliot. This identifies "-            "this Eliot instance in the logs and makes it easier to correlate "-            "Eliot logs with other data. For example, the value could be a "-            "public hostname, an instance id, or something like that. If you do not "-            "set this, then socket.gethostname() is used instead."-        ),-        alternate_keys=["root:host_id"],-    )-    required_config.add_option(-        "logging_level",-        default="INFO",-        doc="The logging level to use. DEBUG, INFO, WARNING, ERROR or CRITICAL",-    )-    required_config.add_option(-        "statsd_host", default="localhost", doc="Hostname for statsd server."-    )-    required_config.add_option(-        "statsd_port", default="8124", doc="Port for statsd server.", parser=int-    )-    required_config.add_option(-        "statsd_namespace", default="", doc="Namespace for statsd metrics."-    )-    required_config.add_option(-        "secret_sentry_dsn",-        default="",-        doc=(-            "Sentry DSN to use. If this is not set an unhandled exception logging "-            "middleware will be used instead. "-            "See https://docs.sentry.io/quickstart/#configure-the-dsn for details."-        ),-    )-    required_config.add_option(-        "symbols_cache_dir",-        default="/tmp/cache",-        doc="Location for caching symcache files.",-    )-    required_config.add_option(-        "symbols_urls",-        default="https://symbols.mozilla.org/try/",-        doc="Comma-separated list of urls to pull symbols files from.",-        parser=ListOf(str),-    )+    class Config:+        local_dev_env = Option(+            default="False",+            parser=bool,+            doc="Whether or not this is a local development environment.",+            alternate_keys=["root:local_dev_env"],+        )+        host_id = Option(+            default="",+            doc=(+                "Identifier for the host that is running Eliot. This identifies "+                "this Eliot instance in the logs and makes it easier to correlate "+                "Eliot logs with other data. For example, the value could be a "+                "public hostname, an instance id, or something like that. If you do not "+                "set this, then socket.gethostname() is used instead."+            ),+            alternate_keys=["root:host_id"],+        )+        logging_level = Option(+            default="INFO",+            doc="The logging level to use. DEBUG, INFO, WARNING, ERROR or CRITICAL",+        )+        statsd_host = Option(default="localhost", doc="Hostname for statsd server.")+        statsd_port = Option(default="8124", doc="Port for statsd server.", parser=int)+        statsd_namespace = Option(default="", doc="Namespace for statsd metrics.")+        secret_sentry_dsn = Option(+            default="",+            doc=(+                "Sentry DSN to use. If this is not set an unhandled exception logging "+                "middleware will be used instead. "+                "See https://docs.sentry.io/quickstart/#configure-the-dsn for details."+            ),+        )+        symbols_cache_dir = Option(+            default="/tmp/cache",+            doc="Location for caching symcache files.",+        )+        symbols_urls = Option(+            default="https://symbols.mozilla.org/try/",+            doc="Comma-separated list of urls to pull symbols files from.",+            parser=ListOf(str),+        )

Note that the configuration is the same, so we don't have to make any changes to infra.

willkg

comment created time in a day

PullRequestReviewEvent

PR opened mozilla-services/tecken

bug 1722602: update to everett 2.0.0

This updates Eliot to Everett 2.0.0 and reworks component configuration. It also fixes setup_metrics and setup_logging so they're explicit about what argument data is being used.

+191 -170

0 comment

7 changed files

pr created time in a day

create barnchwillkg/tecken

branch : bug-1722602-everett

created branch time in a day

delete branch willkg/everett

delete branch : release-fix

delete time in a day

push eventwillkg/everett

Will Kahn-Greene

commit sha 74c1c866c11308cf03c44af96988439b6b51da50

Fix "git tag" instruction to do a signed tag

view details

Will Kahn-Greene

commit sha 22e4fe0ec1b14e28faaf48fa57d695a69cee81d7

Merge pull request #164 from willkg/release-fix Fix "git tag" instruction to do a signed tag

view details

push time in a day

PR merged willkg/everett

Fix "git tag" instruction to do a signed tag
+1 -1

0 comment

1 changed file

willkg

pr closed time in a day

PR opened willkg/everett

Fix "git tag" instruction to do a signed tag
+1 -1

0 comment

1 changed file

pr created time in a day

push eventwillkg/everett

Will Kahn-Greene

commit sha 74c1c866c11308cf03c44af96988439b6b51da50

Fix "git tag" instruction to do a signed tag

view details

push time in a day

create barnchwillkg/everett

branch : release-fix

created branch time in a day

created tagwillkg/everett

tagv2.0.0

configuration library for python projects

created time in a day

push eventwillkg/everett

Will Kahn-Greene

commit sha 653d98cae14c272866fdfdaafb15efba5446e9e2

Update for 2.0.0 release

view details

Will Kahn-Greene

commit sha e1541acbf102790f9f3d818db22b59e985f79547

Merge pull request #163 from willkg/release_2_0_0 Update for 2.0.0 release

view details

push time in a day

PR merged willkg/everett

Update for 2.0.0 release
+6 -5

0 comment

3 changed files

willkg

pr closed time in a day

PR opened willkg/everett

Update for 2.0.0 release
+6 -5

0 comment

3 changed files

pr created time in a day

create barnchwillkg/everett

branch : release_2_0_0

created branch time in a day

delete branch willkg/everett

delete branch : new-components

delete time in a day

delete branch willkg/everett

delete branch : docs-fix

delete time in a day

push eventwillkg/everett

Will Kahn-Greene

commit sha 2159262c3a677c750100c1e74cae9165ad1d0d46

Fix an issue from a bad merge

view details

Will Kahn-Greene

commit sha ebc6353225757fbc137ce30157490fb3b5388338

Merge pull request #162 from willkg/docs-fix Fix an issue from a bad merge

view details

push time in a day

PR merged willkg/everett

Fix an issue from a bad merge
+0 -14

0 comment

1 changed file

willkg

pr closed time in a day

PR opened willkg/everett

Fix an issue from a bad merge
+0 -14

0 comment

1 changed file

pr created time in a day

create barnchwillkg/everett

branch : docs-fix

created branch time in a day

push eventwillkg/everett

Will Kahn-Greene

commit sha b2d35387e452b889c5b95a1d2278ef0242a117c6

Update for 2.0.0 development

view details

Will Kahn-Greene

commit sha bc18108fb85ac34d1bb182039ef36f2eedca46d5

Rework components This radically reduces the boilerplate required to define components. It also improves the connections between things so it's easier to: 1. determine the configuration required for a single component (taking into account superclasses, overriding, etc) 2. determine the runtime configuration for a component tree given a configuration manager Previously, components needed to subclass RequiredConfigMixin and provide a "required_config" class attribute. Something like this: ``` from everett.component import RequiredConfigMixin, ConfigOptions class SomeClass(RequiredConfigMixin): required_config = ConfigOptions() required_config.add_option( "some_option", default="42", ) ``` That's been slimmed down and now looks like this: ``` from everett.manager import Option class SomeClass: class Config: some_option = Option(default="42") ``` That's much simpler and the underlying implementation code is less tangled and complex, too. The inner Config class makes it easier to programmatically identify Everett components and also reduces noise and conflict in the class attributes.

view details

Will Kahn-Greene

commit sha 654b6d98303eaad5b642b978d022d8935fb2d47a

Update documentation This updates a bunch of documentation by reducing language confusion and cleaning up example code.

view details

Will Kahn-Greene

commit sha 64fdbfff3a2cbf6dfdc9f993c4c98589e6bf98da

Reworked ConfigurationError msg and switched to f-strings I decided instead of bending over backwards for a clear, but general, way of referring to a namespace/key combination in the error output, I'd go with the structure that Everett uses for keys in the process environment and env files. I claim this is the most common usage for Everett, so we should cater the messages that way and further reduce confusion users have between the general formatting and what might be in the project documentation. To make that work with other systems like INI files where namespaces are implemented as INI sections, I added a msg_builder argument to ConfigManager. I think that'll be good enough. While doing that, I switched a lot of composed strings to f-strings and took out some Python <=3.5 code that was still around.

view details

Will Kahn-Greene

commit sha 2cb4e027f1432cf2005e3cb14f2e8ba041ad67db

Update HISTORY

view details

Will Kahn-Greene

commit sha 268a156128e8b6545f4d7700db742d6bb73f8601

Merge pull request #161 from willkg/new-components Rework components, update docs, clean up code

view details

push time in a day

PR merged willkg/everett

Rework components

This radically reduces the boilerplate required to define components. It also improves the connections between things so it's easier to:

  1. determine the configuration required for a single component (taking into account superclasses, overriding, etc)
  2. determine the runtime configuration for a component tree given a configuration manager

Previously, components needed to subclass RequiredConfigMixin and provide a "required_config" class attribute. Something like this:

from everett.component import RequiredConfigMixin, ConfigOptions

class SomeClass(RequiredConfigMixin):
    required_config = ConfigOptions()
    required_config.add_option(
        "some_option",
        default="42",
    )

That's been slimmed down and now looks like this:

from everett.manager import Option

class SomeClass:
    class Config:
        some_option = Option(default="42")

That's much simpler and the underlying implementation code is less tangled and complex, too.

The inner Config class makes it easier to programmatically identify Everett components and also reduces noise and conflict in the class attributes.

+1359 -1068

4 comments

24 changed files

willkg

pr closed time in a day