Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Afreed A R
@fuzzyprogrammer
ok I will try changing
Chad Cassady
@beatboxchad

Hey comrades, I'm having a very mysterious problem with tests that use monkeypatch in tests/test_core.py.

____________________________________________ test_get_country_by_ip[ip_data3-None] ____________________________________________
[gw1] linux -- Python 3.7.4 /home/chad/.virtualenvs/wc_saleor/bin/python

ip_data = {}, expected_country = None, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f0d537742d0>

    @pytest.mark.parametrize(
        "ip_data, expected_country",
        [
            ({"country": {"iso_code": "PL"}}, Country("PL")),
            ({"country": {"iso_code": "UNKNOWN"}}, None),
            (None, None),
            ({}, None),
            ({"country": {}}, None),
        ],
    )
    def test_get_country_by_ip(ip_data, expected_country, monkeypatch):
>       monkeypatch.setattr("saleor.core.utils.georeader.get", Mock(return_value=ip_data))
E       AttributeError: 'Reader' object attribute 'get' is read-only

tests/test_core.py:66: AttributeError

I'll bet this is as cryptic to you as to me, but any advice on how to begin troubleshooting it is welcome. Actually, I'm hoping somebody else might be able to reproduce the problem. It's not code I touched, so I wonder if the georeader API changed or something.

MsMansiDhruv
@MsMansiDhruv
Hey, can anyone advice on how to add new payment gateway in saleor? I am trying to integrate PayU. Any starter docs or tips?
Pete Dermott
@petedermott
@MsMansiDhruv You should have a look at the integrations that are already in the project, if you are using an up to date master branch then you'll have the new plugin system, take an existing one and see if you can modify it for your needs.
Does anyone here use the circleci integration? I'm currently getting a execution not authorized due to: free-plan-docker-layer-caching-unavailable error when trying to commit my new code
mihaildragos
@mihaildragos

@petedermott

Does anyone here use the circleci integration? I'm currently getting a execution not authorized due to: free-plan-docker-layer-caching-unavailable error when trying to commit my new code

Try this

Pete Dermott
@petedermott
@mihaildragos so I tried that then got this error:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ERRO[0000] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: no such file or directory Exited with code 1
Ah, I see. You still need the -setup_remote_docker line even if you remove the docker_layer_caching: true
mihaildragos
@mihaildragos
Yes apparently is required
I'm not the best person to use docker but I thought I could help you with thsi
Pete Dermott
@petedermott
Heh, thanks :) I'm still getting used to docker and my build was working (with the docker_layer_caching enabled) before, so I'm not sure why it suddenly stopped.
Maybe I just hit the limits of a free account or something?
Pete Dermott
@petedermott
So there is a switch over to using Poetry from Pipenv, but the Dockerfile still references requirements.txt. What is supposed to be the work flow for adding python modules when using Poetry and Docker?
MsMansiDhruv
@MsMansiDhruv
@petedermott Hey, thanks so much for responding. I am trying to understand why I need to add a plugin and an extension for implementing new payment gateway? Is there a way I can skip that?
Laurent Michel
@zadigus
@beatboxchad I am experiencing the very same issue on my jenkins server; on my laptop, I don't have this error popping up, but on my jenkins server, it is coming 100% of the time
MsMansiDhruv
@MsMansiDhruv
https://docs.saleor.io/docs/next/dashboard/configuration/plugins/ : Where can I access the plugin page mentioned in docs?
jyoost
@jyoost
@sMansiDhruv if you want your payment gateway to work you can't skip the plugin stuff. Documentation is thin.
you need to follow the working payment methods like @petedermott said.
When I work on the stripe gateway I will try to document the structure and steps.
Clayton Hutton
@sdnnet3
I see a few different comments in this room for using docker "compose-build up" , however in the deployment docs it uses "docker build -t mystorefront ." is this still in the vein of a development server and not a deployment
Chad Cassady
@beatboxchad

docker-compose is for your development environment, it lets you stand up the app without configuring Postgres and Redis on your system. You can get some insight as to what the application will need in production by looking at the docker-compose files (docker-compose.yml and docker-compose.override.yml)

Building the Docker image with docker build is for deployment, and there are a few things you can do after that. Typically you'd push that built image to a container registry, or otherwise get it onto your deployment server. I actually use the Gitlab Runner and build the image wherever that's running.

Then you'd run an instance of that image for each application service. One for the app, one for the Celery worker. They'll both need the same environment, and notably the environment variables will point to a production Postgres and Redis, instead of the Docker images that docker-compose uses. Typically in production, your database and cache may or may not be docker-powered. Probably not. I have Postgres and Redis running on my Linode, you might have an AWS instance, etc etc

that stuff isn't documented because everybody's deployment environment is different. But if you want your app services running in containers, the docker build command does that for you.

I run a third instance of hte container specified in the Dockerfile (that's what docker build uses) because I added Celery Beat. So in addition to the django app and the celery worker (see the commands in the docker-compose file) I have one for Beat, which also needs access to the app code and environment. I add this to my docker compose locally, as well as running one in production (the latter again kinda being dependent on what you're doing in prod, so not really documented by Mirumee)

ohfred
@ohfred
i am using the django version of the dashboard. Everything works great but, the date picker pops up and disappears before i can actually select a date? anyone has the same problem? I am using chrome, so its a little puzzling.
Chad Cassady
@beatboxchad
to tl;dr what I said earlier: I used the docker-compose[.override].yml files to figure out what I should put in my gitlab-ci.yml. Think of docker-compose as using Docker to mock up a production environment without having to muck with your workstation. It comes in especially handy for the databases and other external services. I'm never installing postgres on my laptop again. :)

@ohfred no idea, but the date picker has run nicely for me as I've worked on the 1.0 dashboard these past months. It's probably something about your environment? Double-check all your npm commands, make sure assets are built? if you're using docker-compose for local development, it might be useful to follow these instructions:

https://docs.getsaleor.com/docs/customization/docker/#using-local-assets

the JS is part of the magic, so the first thing I'd check is to make sure all the assets are built. I admit all that is still a big black obelisk to me. Excuse me while I jump up and down and hoot. Might throw a rock at it later.
jyoost
@jyoost
@ohfred try the datepicker on your phone. It has never worked on my browser but has always worked on my phone. Dashboard 1.0 uses materializecss . I have sucessfully got datepicker in materializecss to work successfully in both mobile and desktop in an add on project I wrote. However after spending way too much time trying to get it to work in dashboard 1.0 I gave up. My desktop and phone both use chrome browser. It has to do with the environment trying to bring up a system datepicker as the field needs to render as a char field instead of datetime. Those are my clues for you. The system datepicker fights with the materializecss date picker on desktop and neither wins.
jyoost
@jyoost
@ohfred more information.
ohfred
@ohfred
@jyoost. It's weird. My other project which uses I am thinking that one way to side step the issue (for purpose of quick launch) is probably to explore the PWA version of the dashboard. I have a bigger issue to work on. I am enabling stripe for payment on the non-pwa version of the storefront. However, I receive this error - "Payment plugin Stripe for create_form payment method is inaccessible!'" Anyone experience the same problem? Apparently the forms.py file is not there, although the stripe.html template is available. Not sure if anyone has implemented stripe- any advice would be very helpful ;)
jyoost
@jyoost
The date picker that wins on dashboard is the system. Datepicker that is suppose to win (as in my add on project ) is the materializecss one. Mine comes up the same in all environments dashboard 1.0 loses to system datepicker in both environments it just behaves differently desktops it comes on the screen if you hold down the mouse button mobile it pops up and stays beating the materializecss js to a pulp. 🤓
Clayton Hutton
@sdnnet3
@beatboxchad thanks! I'm slowly getting up to speed on all of this, but still haven't had time to power through the gitlab-runner CI stuff. It's next on the plate though.
jyoost
@jyoost
@ohfred are you using the latest plugin stuff?
For stripe?
ohfred
@ohfred
@jyoost I suppose it is. I downloaded the source code just 2 days ago.
Chad Cassady
@beatboxchad
When you do, hit me up, I got a CI file that deploys to a Linode, good starting point. Happy to answer any questions you have, too, I went down the rabbit hole with gitlab. I love their runner. Written in Go, picks up jobs over RPC, you can use your own compute for the builds and tests. Just awesome.
jyoost
@jyoost
It is, don't know if it is finished and working. I am using a very old version on my production store and have not had time to work on the latest. I did notice that the other g
Plugins configurations in dashboard have a place to put the template name in but stripe does not. So I would say the stripe is not done yet. I would suggest you open an issue.
Chad Cassady
@beatboxchad

Gitlab is the one CI company that has truly made it so that if you want to pay them to save weeks of wiring it all up, you can, but you can also invest with your own wit and grit. Bootstrap power. Playing-field leveler. Integrity to the spirit of OSS. Go Gitlab! Shame on you for that "we'll work with anybody it's legal to" gambit the other day though :) Bad look in today's climate. Show a little human solidarity, will ya?

I wouldn't be writing so enthusiastically if they'd stuck with that. I'd be hacking on my own RPC buildbot.

Chad Cassady
@beatboxchad
the plugin docs look good to me. The architecture follows a pattern. I haven't gotten a chance to play it yet
ohfred
@ohfred
@jyoost it's an existing issue.
@jyoost should've just check the issue list. Thanks dude! ;)
jyoost
@jyoost
@ohfred #?
ohfred
@ohfred
@jyoost the stripe error - "Payment plugin Stripe for create_form payment method is inaccessible!'" This is already filed as an issue in github ;)
jyoost
@jyoost
@beatboxchad. Gitlab rocks! They took a much needed scuba dive into the dark abyss of devops in today's environment. The CEO is a genius who has no place in politics. Other companies take money from anyone, they just are not honest and admit it like Sid did.
Chad Cassady
@beatboxchad
yeah, what I appreciate is that they responded to the community and took a different approach. A lesson for all geniuses: you're not good at everything, let other people help.
jyoost
@jyoost
Do you have the issue number to post here? @ohfred
@beatboxchad 😆
ohfred
@ohfred
@jyoost #4691 - Stripe error - "Payment plugin Stripe for create_form payment method is inaccessible!'
jyoost
@jyoost
Thanks @ohfred looks like it is not a priority. The old gateway works but it has some issues with doing multiple authorizations and showing an order has not been paid when in fact it is. The stripe gateway is one of my priorities. When I work on it I want to include subscriptions, as well as webhooks all being compatible with
SCA requirement.