Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add /showcase/graphql endpoint #1015

Merged
merged 56 commits into from
Feb 5, 2024
Merged

Conversation

mogery
Copy link
Contributor

@mogery mogery commented Jan 23, 2024

Summary:
This PR adds a /showcase/graphql endpoint that behaves like how it's described in #1012. Some caveats:

  • For security reasons, the parsed config will not have access to environment variables.
  • The Upstream config will be ignored.
  • The cache will be shared with the main instance.

This PR also rewrites cloudflare/src/handler.rs to use the new showcase logic. That implementation has none of the above caveats, and should continue to work like it has before, except that it may have even better error reporting.

Issue Reference(s):
Fixes #1012
/claim #1012

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Jan 23, 2024
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (12f4d44) 88.33% compared to head (da582ca) 88.38%.

Files Patch % Lines
src/http/showcase.rs 93.05% 5 Missing ⚠️
src/http/request_handler.rs 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1015      +/-   ##
==========================================
+ Coverage   88.33%   88.38%   +0.04%     
==========================================
  Files         102      103       +1     
  Lines       11034    11115      +81     
==========================================
+ Hits         9747     9824      +77     
- Misses       1287     1291       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/http/showcase.rs Outdated Show resolved Hide resolved
@mogery
Copy link
Contributor Author

mogery commented Jan 24, 2024

WASM build fails should be fixed. Unfortunately I'm not sure why the linter failing. The action doesn't log any issues and rustfmt is broken for me locally so I can't check for it easily. Might spin up a codespace and try running it there.

@mogery
Copy link
Contributor Author

mogery commented Jan 24, 2024

Ugh, nevermind, I'm running into compiler problems...

@mogery
Copy link
Contributor Author

mogery commented Jan 24, 2024

@tusharmath Everything should be resolved now wrt CI checks. Also opened up a codespace to fix lint successfully, my local rustfmt seems to be messed up. What's the codecov success condition?

tests/http_spec.rs Outdated Show resolved Hide resolved
@tusharmath tusharmath changed the title feat: Add /showcase/graphql endpoint feat: add /showcase/graphql endpoint Jan 26, 2024
@tusharmath tusharmath added the ci: benchmark Runs benchmarks label Jan 26, 2024
@mogery
Copy link
Contributor Author

mogery commented Jan 26, 2024

Rebased on main and changed the internal API a bit. AppContext not having type generics made it quite a bit prettier!

@mogery
Copy link
Contributor Author

mogery commented Jan 28, 2024

Running into a JS-related http_spec fail on this one. Let's put it on hold 'til I can debug tomorrow.

@mogery
Copy link
Contributor Author

mogery commented Jan 30, 2024

Alright, this is should be passing everywhere now :)

@mogery mogery force-pushed the mog/showcase branch 2 times, most recently from c7a8411 to 9f17884 Compare January 31, 2024 16:34
@tusharmath tusharmath added the ci: lint Automatically fix the linters issues and make a commit label Feb 3, 2024
@mogery
Copy link
Contributor Author

mogery commented Feb 4, 2024

This is ready now @tusharmath

cloudflare/src/lib.rs Outdated Show resolved Hide resolved
src/cli/mod.rs Outdated Show resolved Hide resolved
src/http/showcase.rs Outdated Show resolved Hide resolved
@tusharmath tusharmath merged commit 06845e9 into tailcallhq:main Feb 5, 2024
17 checks passed
@mogery mogery deleted the mog/showcase branch February 5, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 Bounty claim ci: benchmark Runs benchmarks ci: lint Automatically fix the linters issues and make a commit type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: add a /showcase url
2 participants