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

add TrafficPolicy, remap Policy -> TrafficPolicy #51

Merged
merged 4 commits into from
Jul 30, 2024

Conversation

TheConcierge
Copy link
Contributor

@TheConcierge TheConcierge commented Jul 24, 2024

Why

Currently, we are in the process of erasing strict policy types from our SDKs. This changes makes sure policy is sent to the backend as a traffic_policy string as opposed to a strictly formatted policy struct.

How

The traffic policy field already exists and functions in the underlying rust SDK. So all we have to do is plumb the new field through to Rust. Additionally, instances of Policy are remapped to traffic policy.

Validation

Current unit tests continue to run.
An additional unit test was added using the new TrafficPolicy field.

Additional Changes

Rust LSP

To make development easier, I added the rust SDK to our nix flake.

Bumping glibc to 2.28 in workflows

In our CI, we target/build against older versions of glibc to support customers on very old Linux. However, the checkout action provided by github has recently upgraded to Node 20, which needs a newer version than what we were targeting. For now, we are simply updating our version. However, if we end up needing to target older than 2.8, we will have to do a special workaround, as actions/checkout won't work without newer glibc versions.

Context: actions/checkout#1809

@TheConcierge TheConcierge changed the title Ngrok/ryan/traffic policy add +TrafficPolicy, remap Policy -> TrafficPolicy Jul 24, 2024
@TheConcierge TheConcierge changed the title add +TrafficPolicy, remap Policy -> TrafficPolicy add TrafficPolicy, remap Policy -> TrafficPolicy Jul 24, 2024
@TheConcierge TheConcierge marked this pull request as ready for review July 24, 2024 21:20
Copy link

@rkolavo rkolavo left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Collaborator

@nikolay-ngrok nikolay-ngrok left a comment

Choose a reason for hiding this comment

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

👍

@@ -580,7 +588,11 @@ impl<'local> NativeSessionRsImpl<'local> {
bldr.proxy_proto(ProxyProto::from(jeb.get_proxy_proto_version(self.env)));

if let Some(policy) = jeb.get_policy(self.env).of_string(self.env) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't we just drop this, it is still just the traffic_policy right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

uhhhh.....
yeah i think we could. I was trying to cover for the case where they set the member variable directly, but I forgot that Java has strong encapsulation, so these are only available through getters and setters. Which means we shooooould be able to remove it?
But if it's truly doing nothing, we can also just leave it and rip it out when we actually do the real deprecation of policy at some point in...the next few months?

@nikolay-ngrok if you're ok leaving it until then then we can. If you'd rather it be removed now, lmk.

Copy link
Collaborator

Choose a reason for hiding this comment

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

🤷 happy to go either way 👍

@TheConcierge TheConcierge merged commit 4dcf131 into main Jul 30, 2024
5 checks passed
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.

3 participants