Skip to content

refactoring the examples folder + rhai version of forbid anonymous op…#2020

Merged
garypen merged 35 commits intoapollographql:devfrom
lleadbet:examples/nesting-examples-for-better-rhai
Nov 10, 2022
Merged

refactoring the examples folder + rhai version of forbid anonymous op…#2020
garypen merged 35 commits intoapollographql:devfrom
lleadbet:examples/nesting-examples-for-better-rhai

Conversation

@lleadbet
Copy link
Contributor

From our Slack thread, this PR:

  • Moves all examples into a matching subfolder (Rust-> rust, Rhai-> rhai)
  • Adds a note about this change within the README in the examples folder, as well as updated links
  • Adds a new Rhai version of the forbid_anonymous_operations example with unit test
  • Updates the Cargo.toml to point to the new paths to avoid breaking tests
  • Updates each sample README to point to correct (now nested) path to the demo supergraph file

Copy link
Contributor

@garypen garypen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great improvement. Thanks @lleadbet .

Note to other reviewers: I think we'll want to make the README.md file even more user-story focussed. Perhaps merging config examples in at the same level as rust and rhai and working on the naming of examples. Anyway, let's not ask lucas to do that, we can do that once this is in place.

Another Note: We have quite a few references from docs to the examples which we'll need to fix up after this merges.

Co-authored-by: Gary Pennington <garypen@gmail.com>
lleadbet and others added 23 commits November 10, 2022 10:24
Close examination revealed that some judicious tweaking of the locking
and spawning would improve the behaviour.

In performance testing this performs the same as current (dev) or using
the deduplicate crate. I can't reproduce the hanging problem with dev
with this set of changes.

The rationale for the changes are as follows:

- We need to spawn the sentinel **before** we insert the waiter entry or
failure after inserting, but before spawning a sentinel, will cause
issues.
- Notification of waiters from the "first" entry **must be
synchronised** under the "wait_map" lock, or else that becomes racy and
subscribers may be missed. That notification must be immediately
preceded by the removal of the wait_map entry.

fixes: #1984
The last change introduced a bug which meant you can't use the script to
build a docker image from released code. This fixes it.
adding missing escape chars to the code block
In the past, we didn't have aarch64 binaries. We hacked our install
script so that we downloaded x86_64 binaries and relied on magic (aka
chip emulation) to run the binary.

We build aarch64 binaries now, so we need to update the installer to
install them and give a performance boost to our linux on aarch64 user
base.

I manually tested the change by running a debian docker image on my M1
laptop and using the modified script to install a router into it.
Add support for DHAT heap profiling via dhat features: `dhat-heap` and
`dhat-ad-hoc`.

This isn't intended for "general" consumption, but for router developers
who are trying to understand and resolve potential memory issues.

Co-authored-by: Simon Sapin <simon@apollographql.com>
Co-authored-by: Jesse Rosenberger <git@jro.cc>
The long pole on our build is the arm build/test step. Also, running
everything in parallel is expensive.

Let's address both of those problems:

 - require lint to succeed before starting build/test jobs
 - give more resources to arm jobs to allow them to complete faster
- tweak the build setting for both arm and amd to use resources more
effectively

Result:
- total build time is reduced by ~15% in my test runs (even with waiting
for lint first)
- billing should be reduced by less renovate waste-fullness when lint
fails
Allows router plugins to utilize `web_endpoints` by making the `Endpoint` struct public
Fix #1979

When validating variables, we should use default values for object
fields if applicable
Fix #35 

This adds support for reloading configuration when receiving the SIGHUP
signal. This only works on unix-like platforms, and only with the
configuration file

Co-authored-by: Gary Pennington <gary@apollographql.com>
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| openzipkin/zipkin | patch | `2.23.18` -> `2.23.19` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because
other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/apollographql/router).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC45LjEiLCJ1cGRhdGVkSW5WZXIiOiIzNC45LjEifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Geoffroy Couprie <geoffroy@apollographql.com>
…2030)

When I was investigating connection resets I noted that we weren't
following tower documentation with respect to [cloning inner
services](https://docs.rs/tower/latest/tower/trait.Service.html#be-careful-when-cloning-inner-services).

This PR addresses that. The change to the supergraph seems to be most
invasive. I have run the tests manually many times and the change seems
good, but probably worth closer examination.
also: fix bracketing in NEXT_CHANGELOG.md

fixes: #2012
There is a bug in otel
open-telemetry/opentelemetry-rust#908 that did
not manifest until `tls-roots` was enabled on `tonic`.

This PR introduces a workaround until this is fixed upstream.

default endpoint is now configured to use http rather than https. In
addition, tls domain will only be set if the endpoint scheme is https.
If the endpoint port is 443 ta warning is displayed if TLS has not been
configured.

Co-authored-by: bryn <bryn@apollographql.com>
The plugin infrastructure works on `BoxService` instances, and makes no
guarantee on plugin ordering.
The traffic shaping plugin needs a clonable inner service, and should
run right before calling
the underlying service. So this changes the traffic plugin application
so it can work directly
on the underlying service. It is still a plugin though, so it keeps the
same configuration.
To actively discourage folks from using `--dev` in production, this
explains how to cherry-pick parts of dev mode for a production config.
bnjjj and others added 2 commits November 10, 2022 10:46
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This PR makes the appropriate changes in preparation for releasing:

1. Bumps versions in preparation for release
2. Does a straight copy of `NEXT_CHANGELOG.md` to top of `CHANGELOG.md`
3. Does initial editorial on `CHANGELOG.md` prior to initial review (the
bulk of the work)

Co-authored-by: Gary Pennington <gary@apollographql.com>
@garypen garypen merged commit db8cfbb into apollographql:dev Nov 10, 2022
@abernix abernix added this to the v1-NEXT milestone Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants