github-bpmn icon indicating copy to clipboard operation
github-bpmn copied to clipboard

Add support for private repositories

Open DougAtPeddle opened this issue 6 years ago • 3 comments

Very excited about this extension since we (and I'm sure many others) have the use case of storing BPMN in GitHub repositories where they are essentially unreadable unless they are rendered.

I've successfully installed the Chrome extension: BPMN On Hover - Chrome Extension - 404 Not Found Error 01

But when I hover over a BPMN file in our repository (which is a private repo, by the way): BPMN On Hover - Chrome Extension - 404 Not Found Error 02

I consistently get the following 404 Not Found error: BPMN On Hover - Chrome Extension - 404 Not Found Error 03

Could this be an issue with private repos or with the intermediary folder in the repo, e.g. "Test"? Thanks in advance for your help!

DougAtPeddle avatar Feb 25 '20 22:02 DougAtPeddle

Thanks for the issue.

We are using functools.singledispatch, so there is no way to pass non-type objects to from_type.register.

But it looks like we can add a special case for Variant class like

from typing import Any

from hypothesis_sqlalchemy.hints import Strategy
from sqlalchemy.types import Variant
...
@from_type.register(Variant)
def variant_values_factory(type_: Variant) -> Strategy[Any]:
    return from_type(type_.impl)

Can you please test it locally whether this is what you need? I'm not familiar with Variants myself and it looks like this should be added as a modification to hypothesis_sqlalchemy.columnar.values.factory function https://github.com/lycantropos/hypothesis_sqlalchemy/blob/6c68a065802d5efdfa3d805d9e4a79199ab46ea3/hypothesis_sqlalchemy/columnar/values.py#L31-L32 something like: if column type is variant, then try to get dialect from column.bind, if there is none -- use from_type(column.type.impl), if has -- from_type(column.type.mapping.get(dialect_name, column.type.impl)) or something like that.

lycantropos avatar Dec 28 '20 23:12 lycantropos

Your code snippet works totally fine in my unit tests.

However, the engine isn't in sqlalchemy during my unit tests so I cannot confirm whether the conditional around column.bind is correct.

jzelinskie avatar Dec 29 '20 22:12 jzelinskie