Skip to content

Conversation

@rescrv
Copy link
Contributor

@rescrv rescrv commented Oct 17, 2025

Description of changes

This adds support for the new stateful quota we will call from attach_function.

Test plan

CI

Migration plan

N/A

Observability plan

N/A

Documentation Changes

N/A

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@propel-code-bot
Copy link
Contributor

Add Quota Enforcement for Attached Functions in quota Module

This pull request extends the quota system within the rust/frontend/src/quota/mod.rs file to support a new stateful quota for the number of functions that can be attached to a collection. The addition includes updates to both the Action and UsageType enums, adds string conversion logic, display formatting, and a default quota limit for the new functionality. All logic changes are targeted at enabling tracking and enforcement of quotas related to attached functions, and the new quota is integrated consistently with the module's broader quota enforcement mechanisms.

Key Changes

• Added AttachFunction as a variant to the Action enum with associated parsing, display, and matching logic.
• Added NumFunctions variant to the UsageType enum to represent the number of functions that may attach to a collection.
• Implemented parsing (TryFrom<&str>) and string formatting (Display) for the new Action::AttachFunction and UsageType::NumFunctions variants.
• Defined a default quota of 10 for UsageType::NumFunctions in the DefaultQuota trait implementation.

Affected Areas

rust/frontend/src/quota/mod.rs: Definition and handling of quota actions and usage types, especially around function attachment.

This summary was automatically generated by @propel-code-bot

@rescrv rescrv requested a review from tanujnay112 October 17, 2025 17:20
@rescrv rescrv merged commit b36f50a into main Oct 22, 2025
60 checks passed
@rescrv rescrv deleted the rescrv/stateful-quota branch October 22, 2025 16:40
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.

2 participants