Page MenuHomeSoftware Heritage

Enable cors in the asgi server
ClosedPublic

Authored by jayeshv on Aug 26 2022, 2:16 PM.

Details

Reviewers
vlorentz
Group Reviewers
Reviewers
Summary

This is to experiment with different JS based query explorers

Diff Detail

Repository
rDGQL GraphQL API
Branch
graphiql-exp
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 31106
Build 48663: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 48662: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D8319 (id=30056)

Rebasing onto 45582e79ee...

Current branch diff-target is up to date.
Changes applied before test
commit bb0606485f82d8898baabc3dbc17950f4749be42
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Aug 26 14:12:43 2022 +0200

    Enable cors in the dev server
    
    This is to experiment with different JS based query explorers

See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/131/ for more details.

vlorentz added inline comments.
swh/graphql/server.py
63–64

Keep the empty line between the summary and the rest of the docstring

77

how is that restricted to the dev version?

ardumont added inline comments.
swh/graphql/server.py
77

probably because the server type for dev is asgi?

Currently for staging (which will be probably the same for prod at some point in the future) the server type is wsgi.

swh/graphql/server.py
77

If I'm correct, the server type probably needs to be renamed "dev" (or "development" or "testing") to clarify the intent here.

swh/graphql/server.py
77

is it documented somewhere that asgi is only for development?

swh/graphql/server.py
77

Yes, It is enabled only for asgi as of now.

77

No, I think we will have to enable cors to have a better query explorer. I will remove the 'dev' reference then.

Changed dev to asgi in the the doc and commit message

jayeshv retitled this revision from Enable cors in the dev server to Enable cors in the asgi server.Aug 26 2022, 2:57 PM

Build is green

Patch application report for D8319 (id=30059)

Rebasing onto a31419d74c...

First, rewinding head to replay your work on top of it...
Applying: Enable cors for the asgi server
Changes applied before test
commit b8722397f5b5394c7c2ebf83869bd5536a03fbe3
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Aug 26 14:12:43 2022 +0200

    Enable cors for the asgi server
    
    This is to experiment with different JS based query explorers

See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/133/ for more details.

If this gets deployed to production, we will need to restrict allow_origins , but ok for now.

This revision is now accepted and ready to land.Aug 26 2022, 3:10 PM