profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/jd/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.
Julien Danjou jd @DataDog + @Mergifyio Paris, France https://julien.danjou.info/ Open Source Software Engineer 💻, Runner 🏃🏻‍♂️ Foodie 🍲 FPS player 🎯

dimitri/el-get 1577

Manage the external elisp bits and pieces upon which you depend!

jd/daiquiri 325

Python library to easily setup basic logging functionality

DataDog/dd-trace-py 277

Datadog Python APM Client

jd/asciidoc-book-toolchain 123

Book publishing toolchain based on AsciiDoc

gnocchixyz/python-gnocchiclient 12

Python client from Gnocchi

gnocchixyz/collectd-gnocchi 8

Gnocchi storage plugin for collectd

jd/ceph-ansible 1

Ansible playbooks for Ceph

PullRequestReviewEvent

Pull request review commentMergifyio/mergify-engine

feat(api): boilerplate of the API code

+# -*- encoding: utf-8 -*-+#+# Copyright © 2021 Mergify SAS+#+# Licensed under the Apache License, Version 2.0 (the "License"); you may+# not use this file except in compliance with the License. You may obtain+# a copy of the License at+#+#      http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the+# License for the specific language governing permissions and limitations+# under the License.+import dataclasses+import json+import typing++import daiquiri++from mergify_engine import config+from mergify_engine import crypto+from mergify_engine import exceptions+from mergify_engine import github_types+from mergify_engine import utils+from mergify_engine.clients import http+++LOG = daiquiri.getLogger(__name__)+++class ApplicationUserNotFound(Exception):+    pass+++ApplicationClassT = typing.TypeVar("ApplicationClassT", bound="ApplicationBase")+++@dataclasses.dataclass+class ApplicationBase:+    redis: utils.RedisCache+    api_access_key: str+    api_secret_key: str+    account_id: github_types.GitHubAccountIdType++    @classmethod+    async def delete(+        cls: typing.Type[ApplicationClassT],+        redis: utils.RedisCache,+        api_access_key: str,+    ) -> None:+        raise NotImplementedError++    @classmethod+    async def get(+        cls: typing.Type[ApplicationClassT],+        redis: utils.RedisCache,+        api_access_key: str,+        api_secret_key: str,+    ) -> ApplicationClassT:+        raise NotImplementedError+++@dataclasses.dataclass+class ApplicationGitHubCom(ApplicationBase):+    ttl: int = -2++    RETENTION_SECONDS = 60 * 60 * 24 * 3  # 3 days+    VALIDITY_SECONDS = 3600++    @staticmethod+    def _cache_key(api_access_key: str) -> str:+        return f"api-key-cache~{api_access_key}"++    async def _has_expired(self) -> bool:+        if self.ttl < 0:  # not cached+            return True+        elapsed_since_stored = self.RETENTION_SECONDS - self.ttl+        return elapsed_since_stored > self.VALIDITY_SECONDS++    @classmethod+    async def delete(+        cls: typing.Type[ApplicationClassT],+        redis: utils.RedisCache,+        api_access_key: str,+    ) -> None:+        await redis.delete(+            typing.cast(ApplicationGitHubCom, cls)._cache_key(api_access_key)+        )++    @classmethod+    async def get(+        cls: typing.Type[ApplicationClassT],+        redis: utils.RedisCache,+        api_access_key: str,+        api_secret_key: str,+    ) -> ApplicationClassT:+        return typing.cast(+            ApplicationClassT,+            await typing.cast(ApplicationGitHubCom, cls)._get(+                redis, api_access_key, api_secret_key+            ),+        )++    @classmethod+    async def _get(+        cls, redis: utils.RedisCache, api_access_key: str, api_secret_key: str+    ) -> "ApplicationGitHubCom":+        cached_application = await cls._retrieve_from_cache(+            redis, api_access_key, api_secret_key+        )+        if cached_application is None or await cached_application._has_expired():+            try:+                db_application = await cls._retrieve_from_db(+                    redis, api_access_key, api_secret_key+                )+            except http.HTTPNotFound:+                raise ApplicationUserNotFound()+            except Exception as exc:+                if cached_application is not None and (+                    exceptions.should_be_ignored(exc) or exceptions.need_retry(exc)+                ):+                    # NOTE(sileht): return the cached application, instead of+                    # retrying the stream, just because the dashboard has a+                    # connectivity issue.+                    return cached_application+                raise+            await db_application.save_to_cache()+            return db_application+        return cached_application++    async def save_to_cache(self) -> None:+        """Save an application to the cache."""+        await self.redis.setex(+            self._cache_key(self.api_access_key),+            self.RETENTION_SECONDS,+            crypto.encrypt(+                json.dumps(

@sileht

sileht

comment created time in 6 hours

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentMergifyio/mergify-engine

feat(api): boilerplate of the API code

+# -*- encoding: utf-8 -*-+#+# Copyright © 2021 Mergify SAS+#+# Licensed under the Apache License, Version 2.0 (the "License"); you may+# not use this file except in compliance with the License. You may obtain+# a copy of the License at+#+#      http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the+# License for the specific language governing permissions and limitations+# under the License.+import fastapi+import pydantic++from mergify_engine import config+from mergify_engine import github_types+from mergify_engine.clients import github+from mergify_engine.tests.functional import base+from mergify_engine.web.api import root+from mergify_engine.web.api import security+++@pydantic.dataclasses.dataclass+class ResponseTest:+    user_login: github_types.GitHubLogin+++class TestApiAuth(base.FunctionalTestBase):

So is it worth moving those out/copying them so we can use them in pytest-only tests?

sileht

comment created time in a day

PR opened unpaper/unpaper

fix: remove spurious extra space in rules

See https://twitter.com/flameeyes/status/1453318300214218753

+4 -4

0 comment

1 changed file

pr created time in a day

push eventjd/unpaper

Julien Danjou

commit sha af8bd5a48755893cab319846b7d5f0982bfe8a9c

fix: remove spurious extra space in rules

view details

push time in a day

fork jd/unpaper

A post-processing tool for scanned sheets of paper.

fork in a day

Pull request review commentMergifyio/mergify-engine

feat(api): boilerplate of the API code

+# -*- encoding: utf-8 -*-+#+# Copyright © 2021 Mergify SAS+#+# Licensed under the Apache License, Version 2.0 (the "License"); you may+# not use this file except in compliance with the License. You may obtain+# a copy of the License at+#+#      http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the+# License for the specific language governing permissions and limitations+# under the License.+import dataclasses+import json+import typing++import daiquiri++from mergify_engine import config+from mergify_engine import crypto+from mergify_engine import exceptions+from mergify_engine import github_types+from mergify_engine import utils+from mergify_engine.clients import http+++LOG = daiquiri.getLogger(__name__)

unused

sileht

comment created time in a day

Pull request review commentMergifyio/mergify-engine

feat(api): boilerplate of the API code

+# -*- encoding: utf-8 -*-+# flake8: noqa: B008+#+# Copyright © 2021 Mergify SAS+#+# Licensed under the Apache License, Version 2.0 (the "License"); you may+# not use this file except in compliance with the License. You may obtain+# a copy of the License at+#+#      http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the+# License for the specific language governing permissions and limitations+# under the License.+import argparse+import collections+import dataclasses+import datetime+import json+import typing++import fastapi+import pydantic+from starlette import requests+from starlette import responses+from starlette.middleware import cors++from mergify_engine import config+from mergify_engine import context+from mergify_engine import github_types+from mergify_engine import utils+from mergify_engine.clients import github+from mergify_engine.clients import http+from mergify_engine.queue import merge_train+from mergify_engine.web import api+from mergify_engine.web import redis+from mergify_engine.web.api import security+++def api_enabled() -> None:+    if not config.API_ENABLE:+        raise fastapi.HTTPException(status_code=404)+++app = fastapi.FastAPI(+    title="Mergify API",+    description="Faster & safer code merge",+    vesion="1.0",+    terms_of_service="https://mergify.io/tos",+    contact={+        "name": "Mergify",+        "url": "https://mergify.io",+        "email": "support@mergify.io",+    },+    openapi_url=None,+    redoc_url=None,+    docs_url=None,+    openapi_tags=[+        {+            "name": "queues",+            "description": "Operations with queues.",+        },+    ],+    servers=[{"url": "https://api.mergify.io/api", "description": "default"}],
    servers=[{"url": "https://api.mergify.com/api", "description": "default"}],

Going to serve it directly from .com :)

sileht

comment created time in a day

Pull request review commentMergifyio/mergify-engine

feat(api): boilerplate of the API code

+# -*- encoding: utf-8 -*-+#+# Copyright © 2021 Mergify SAS+#+# Licensed under the Apache License, Version 2.0 (the "License"); you may+# not use this file except in compliance with the License. You may obtain+# a copy of the License at+#+#      http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the+# License for the specific language governing permissions and limitations+# under the License.+import fastapi+import pydantic++from mergify_engine import config+from mergify_engine import github_types+from mergify_engine.clients import github+from mergify_engine.tests.functional import base+from mergify_engine.web.api import root+from mergify_engine.web.api import security+++@pydantic.dataclasses.dataclass+class ResponseTest:+    user_login: github_types.GitHubLogin+++class TestApiAuth(base.FunctionalTestBase):

how much does it depends on this base class? Just wondering if we could avoid using it and directly use pytest-like tests.

sileht

comment created time in a day

Pull request review commentMergifyio/mergify-engine

feat(api): boilerplate of the API code

+# -*- encoding: utf-8 -*-+#+# Copyright © 2021 Mergify SAS+#+# Licensed under the Apache License, Version 2.0 (the "License"); you may+# not use this file except in compliance with the License. You may obtain+# a copy of the License at+#+#      http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the+# License for the specific language governing permissions and limitations+# under the License.+import fastapi+import pydantic++from mergify_engine import config+from mergify_engine import github_types+from mergify_engine.clients import github+from mergify_engine.tests.functional import base+from mergify_engine.web.api import root+from mergify_engine.web.api import security+++@pydantic.dataclasses.dataclass+class ResponseTest:+    user_login: github_types.GitHubLogin+++class TestApiAuth(base.FunctionalTestBase):+    """API REST tests."""++    async def test_api_auth(self):+        router = fastapi.APIRouter()++        @router.get("/testing-endpoint-with-default-dep", response_model=ResponseTest)  # type: ignore[misc]+        async def test_default() -> ResponseTest:+            return ResponseTest(+                github_types.GitHubLogin("foobar"),+            )++        @router.get("/testing-endpoint-with-explicit-dep", response_model=ResponseTest)  # type: ignore[misc]+        async def test_explicit(+            installation: github_types.GitHubInstallation = fastapi.Depends(  # noqa: B008+                security.get_installation+            ),+        ) -> ResponseTest:+            async with github.aget_client(installation) as client:+                org = await client.item(f"/user/{installation['account']['id']}")+                return ResponseTest(org["login"])++        root.app.include_router(router)++        # Default+        r = await self.app.get("/api/foobar")+        assert r.status_code == 404+        assert r.json() == {"detail": "Not Found"}+        r = await self.app.get("/api/testing-endpoint-with-default-dep")+        assert r.status_code == 403+        assert r.json() == {"detail": "Not authenticated"}+        r = await self.app.get("/api/testing-endpoint-with-explicit-dep")+        assert r.status_code == 403+        assert r.json() == {"detail": "Not authenticated"}++        # invalid header

would be better to have separate test cases for the following cases.

sileht

comment created time in a day

PullRequestReviewEvent

Pull request review commentMergifyio/mergify-engine

feat(api): boilerplate of the API code

+# -*- encoding: utf-8 -*-+#+# Copyright © 2021 Mergify SAS+#+# Licensed under the Apache License, Version 2.0 (the "License"); you may+# not use this file except in compliance with the License. You may obtain+# a copy of the License at+#+#      http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the+# License for the specific language governing permissions and limitations+# under the License.+import dataclasses+import json+import typing++import daiquiri++from mergify_engine import config+from mergify_engine import crypto+from mergify_engine import exceptions+from mergify_engine import github_types+from mergify_engine import utils+from mergify_engine.clients import http+++LOG = daiquiri.getLogger(__name__)+++class ApplicationUserNotFound(Exception):+    pass+++ApplicationClassT = typing.TypeVar("ApplicationClassT", bound="ApplicationBase")+++@dataclasses.dataclass+class ApplicationBase:+    redis: utils.RedisCache+    api_access_key: str+    api_secret_key: str+    account_id: github_types.GitHubAccountIdType++    @classmethod+    async def delete(+        cls: typing.Type[ApplicationClassT],+        redis: utils.RedisCache,+        api_access_key: str,+    ) -> None:+        raise NotImplementedError++    @classmethod+    async def get(+        cls: typing.Type[ApplicationClassT],+        redis: utils.RedisCache,+        api_access_key: str,+        api_secret_key: str,+    ) -> ApplicationClassT:+        raise NotImplementedError+++@dataclasses.dataclass+class ApplicationGitHubCom(ApplicationBase):+    ttl: int = -2++    RETENTION_SECONDS = 60 * 60 * 24 * 3  # 3 days+    VALIDITY_SECONDS = 3600++    @staticmethod+    def _cache_key(api_access_key: str) -> str:+        return f"api-key-cache~{api_access_key}"++    async def _has_expired(self) -> bool:+        if self.ttl < 0:  # not cached+            return True+        elapsed_since_stored = self.RETENTION_SECONDS - self.ttl+        return elapsed_since_stored > self.VALIDITY_SECONDS++    @classmethod+    async def delete(+        cls: typing.Type[ApplicationClassT],+        redis: utils.RedisCache,+        api_access_key: str,+    ) -> None:+        await redis.delete(+            typing.cast(ApplicationGitHubCom, cls)._cache_key(api_access_key)+        )++    @classmethod+    async def get(+        cls: typing.Type[ApplicationClassT],+        redis: utils.RedisCache,+        api_access_key: str,+        api_secret_key: str,+    ) -> ApplicationClassT:+        return typing.cast(+            ApplicationClassT,+            await typing.cast(ApplicationGitHubCom, cls)._get(+                redis, api_access_key, api_secret_key+            ),+        )++    @classmethod+    async def _get(+        cls, redis: utils.RedisCache, api_access_key: str, api_secret_key: str+    ) -> "ApplicationGitHubCom":+        cached_application = await cls._retrieve_from_cache(+            redis, api_access_key, api_secret_key+        )+        if cached_application is None or await cached_application._has_expired():+            try:+                db_application = await cls._retrieve_from_db(+                    redis, api_access_key, api_secret_key+                )+            except http.HTTPNotFound:+                raise ApplicationUserNotFound()+            except Exception as exc:+                if cached_application is not None and (+                    exceptions.should_be_ignored(exc) or exceptions.need_retry(exc)+                ):+                    # NOTE(sileht): return the cached application, instead of+                    # retrying the stream, just because the dashboard has a+                    # connectivity issue.+                    return cached_application+                raise+            await db_application.save_to_cache()+            return db_application+        return cached_application++    async def save_to_cache(self) -> None:+        """Save an application to the cache."""+        await self.redis.setex(+            self._cache_key(self.api_access_key),+            self.RETENTION_SECONDS,+            crypto.encrypt(+                json.dumps(

msgpack?

sileht

comment created time in a day

Pull request review commentMergifyio/mergify-engine

feat(api): boilerplate of the API code

 def CommaSeparatedStringList(value: str) -> typing.List[str]:         return []  +def CommaSeparatedStringDict(v: str) -> typing.Dict[str, str]:+    return dict(+        typing.cast(typing.Tuple[str, str], tuple(map(str.strip, bot.split(":"))))

Using list comprehensions might avoid a cast here.

sileht

comment created time in a day

Pull request review commentMergifyio/mergify-engine

feat(api): boilerplate of the API code

 def setup_new_event_loop() -> None:     asyncio.set_event_loop(asyncio.new_event_loop())  +@pytest.fixture(autouse=True)

scope=session?

sileht

comment created time in a day

PullRequestReviewEvent

push eventjd/dd-trace-py

Julien Danjou

commit sha 32b288c289fc258bf266deebea8f5862dc3f08e2

feat: add support for yaaredis

view details

push time in a day

push eventjd/dd-trace-py

Julien Danjou

commit sha b8a8fb6c2c26259d21cdba7024e12a61a4161dcb

feat: add support for yaaredis

view details

push time in a day

push eventjd/mergify-engine

Julien Danjou

commit sha 00b666b2b03aef33b4ab85086fb36780ca6da12d

chore: update documentation URL (#3473)

view details

Mehdi ABAAKOUK

commit sha 4bce1652096ced33307538a9b072539990884c28

chore(http): better github http error (#3474) GitHub now may adds more json attributes in 40X errors messages. So instead of printing `message` attribute, we now report the whole text.

view details

dependabot[bot]

commit sha 8e76b54b0c513d55854901da1d68efb4a7eaa0db

chore(deps-dev): bump sass from 1.43.3 to 1.43.4 in /docs Bumps [sass](https://github.com/sass/dart-sass) from 1.43.3 to 1.43.4. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.43.3...1.43.4) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>

view details

dependabot[bot]

commit sha 6ad15db8c262196d9ad0cb0315631af56c86a044

chore(deps): bump amannn/action-semantic-pull-request Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 3.4.2 to 3.4.4. - [Release notes](https://github.com/amannn/action-semantic-pull-request/releases) - [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/master/CHANGELOG.md) - [Commits](https://github.com/amannn/action-semantic-pull-request/compare/v3.4.2...v3.4.4) --- updated-dependencies: - dependency-name: amannn/action-semantic-pull-request dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>

view details

Mehdi ABAAKOUK

commit sha 387eb59091dc0ead3c28cefc38b3c612a660bda5

fix(commits-behind): don't use base/sha attributes (#3480) Pull request base/sha attribute does not report the commit where the branch diverge, but the last commit of the base branch when the pull request is open. Anyways, this is not needed to add base/sha as parents of the pull requests as the older commit has already the right sha. Fixes MRGFY-661

view details

Julien Danjou

commit sha 2f47b5f5eda4d98715cd4e27249a1e2ba14758d0

ci: move docs-preview to mergify.com

view details

push time in a day

PullRequestReviewEvent

push eventjd/dd-trace-py

Kyle Verhoog

commit sha eafa3d43db09c0f74fdf324e5623de4a484a140a

Update isort skips to include docker directories

view details

dependabot[bot]

commit sha 758ef004992089c4053410cf3c64221d3ad2bb24

chore(deps): bump pypa/cibuildwheel from 2.1.3 to 2.2.0 (#2943) Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.1.3 to 2.2.0. - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/v2.1.3...v2.2.0) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

mtoffl01

commit sha 3892b6bee434cbc7b7c9ebbacc6627b5d7b1c873

Internalize, deprecate `ddtrace.monkey` module (#2928) The ddtrace/monkey.py should be an internal module, so I've moved the contents of monkey.py into the new _monkey.py. monkey.py imports the methods from _monkey.py in order to retain compatibility as we migrate to solely _monkey.py in v1.0. Deprecation warning is included in monkey.py

view details

Zachary Groves

commit sha 24dd998d7a8ebc1beb61c40733dc574111e94e37

Move pyramid test cases to riot (#2947) Moved the pyramid test cases from tox.ini to riot because riot is the future.

view details

Gabriele N. Tornetta

commit sha 112df14b943e45cd744d833e4e71983bc8be94ae

fix: reset next string table index on rollback

view details

Julien Danjou

commit sha 0e9e01344bf1e87fec91ccadc792ad955d2e42c3

test(profiling): fix rare but possible case of function name (#2948) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

view details

mtoffl01

commit sha 9db745445204d59555f954fd0f301d5e50e978d3

Added aredis to PATCH_MODULES in _monkey.py (#2949) The PATCH_MODULES object in the _monkey module did not contain aredis; I added it and set its default value to true. Co-authored-by: Kyle Verhoog <kyle@verhoog.ca>

view details

Julien Danjou

commit sha 4e9c1d362ea0021447fa24a44b0f6f2fa1525009

feat: add support for yaaredis

view details

push time in a day

PullRequestReviewEvent

create barnchjd/mergify-engine

branch : move-docs.mergify.com

created branch time in 2 days

PR opened Mergifyio/mergify-engine

chore: update documentation URL
+2924 -2924

0 comment

155 changed files

pr created time in 2 days

create barnchjd/mergify-engine

branch : move-docs-preview

created branch time in 2 days

push eventjd/dd-trace-py

Julien Danjou

commit sha de355098a041b6a9bdb7f81be44723e96a1dda42

test(profiling): fix rare but possible case of function name

view details

push time in 2 days