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: custom rate limit rules payload #6503

Merged
merged 6 commits into from Apr 24, 2024
Merged

Conversation

paulo
Copy link
Contributor

@paulo paulo commented Apr 8, 2024

Summary

Related to ADN-294, sends the same payload to the API we're sending now on normal builds.

@paulo paulo added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Apr 8, 2024
@paulo paulo self-assigned this Apr 8, 2024
@paulo paulo force-pushed the pa/send-traffic-rules-payload-api branch 2 times, most recently from 29f5861 to 84933cc Compare April 8, 2024 17:08
Copy link

github-actions bot commented Apr 8, 2024

📊 Benchmark results

Comparing with 31114d9

  • Dependency count: 1,355 (no change)
  • Package size: 330 MB (no change)
  • Number of ts-expect-error directives: 1,001 ⬇️ 0.60% decrease vs. 31114d9

@paulo paulo force-pushed the pa/send-traffic-rules-payload-api branch from 84933cc to 0ceb7f8 Compare April 8, 2024 17:11
// @ts-expect-error TS(7031) FIXME: Binding element 'buildData' implicitly has an 'any... Remove this comment to see the full error message
({ buildData, displayName, generator, invocationMode, path: functionPath, priority, runtime, runtimeVersion }) => ({
({
// @ts-expect-error TS(7031) FIXME: Binding element 'buildData' implicitly has an 'any... Remove this comment to see the full error message
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If someone knows a way to apply this to the whole block, please do share 😅

Copy link
Member

Choose a reason for hiding this comment

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

the fix is to write some proper types for this :D Let me see what I can do.

Copy link
Member

Choose a reason for hiding this comment

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

done in 8f4a538!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woah, thank you so much!

@paulo paulo marked this pull request as ready for review April 8, 2024 17:22
@paulo paulo requested a review from a team as a code owner April 8, 2024 17:22
eduardoboucas
eduardoboucas previously approved these changes Apr 19, 2024
@@ -195,4 +219,25 @@ const hashFns = async (
return { functionSchedules, functions, functionsWithNativeModules, fnShaMap, fnConfig }
}

const trafficRulesConfig = (trafficRules: $TSFixMe) => {
Copy link
Member

Choose a reason for hiding this comment

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

I would be nice to import the type that we'll expose to users and use it here, but we can do that as a follow-up.

Copy link
Member

Choose a reason for hiding this comment

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

in 8f4a538, i've imported the TrafficRules type from the ZISI internals. Is that what you had in mind? Also, do we consider importing those internals criminal?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, exactly! I don't think it's criminal, but I think it would be good to properly export them so we're not relying on internal file paths.

Copy link
Member

Choose a reason for hiding this comment

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

agreed. i'll make the zisi PR and replace the import in a followup.

Copy link
Member

Choose a reason for hiding this comment

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

export const config = { path: "/internal-v2-func" }
export const config = {
path: "/internal-v2-func",
rateLimit: {
Copy link
Member

Choose a reason for hiding this comment

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

I don't see any assertions added. I'm assuming you used this for testing things locally? Fine by me, i'm wondering if there's a good way of asserting that the ratelimit config was actually applied 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes I tested it out locally

@sarahetter sarahetter removed the request for review from a team April 23, 2024 16:02
@paulo paulo enabled auto-merge (squash) April 24, 2024 13:08
@paulo paulo merged commit 79e22fd into main Apr 24, 2024
40 checks passed
@paulo paulo deleted the pa/send-traffic-rules-payload-api branch April 24, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants