Skip to content

[TT-11739] Re-add gateway.RateLimitExceeded (Dashboard coupling)#6318

Merged
titpetric merged 1 commit into
masterfrom
fix/tt-11739/alias-rate-limiter-types-for-compat
May 30, 2024
Merged

[TT-11739] Re-add gateway.RateLimitExceeded (Dashboard coupling)#6318
titpetric merged 1 commit into
masterfrom
fix/tt-11739/alias-rate-limiter-types-for-compat

Conversation

@titpetric

@titpetric titpetric commented May 30, 2024

Copy link
Copy Markdown
Contributor

PR Type

Bug fix


Description

  • Added the alias RateLimitExceeded in gateway/event_system.go to maintain backwards compatibility.

Changes walkthrough 📝

Relevant files
Bug fix
event_system.go
Add alias `RateLimitExceeded` for backwards compatibility

gateway/event_system.go

  • Added alias RateLimitExceeded for backwards compatibility.
+2/-0     

💡 PR-Agent usage:
Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

@titpetric titpetric changed the title Re-add gateway.RateLimitExceeded (Dashboard coupling) [TT-11739] Re-add gateway.RateLimitExceeded (Dashboard coupling) May 30, 2024
@titpetric
titpetric requested a review from lghiur May 30, 2024 18:47
@github-actions

Copy link
Copy Markdown
Contributor

PR Description updated to latest commit (20c780b)

@github-actions

Copy link
Copy Markdown
Contributor

PR Review 🔍

⏱️ Estimated effort to review [1-5]

1, because the PR involves a simple addition of an alias for backwards compatibility. The change is straightforward and limited to one file with a clear purpose.

🧪 Relevant tests

No

⚡ Possible issues

No

🔒 Security concerns

No

Code feedback:

@github-actions

Copy link
Copy Markdown
Contributor

API Changes

--- prev.txt	2024-05-30 18:48:14.692810803 +0000
+++ current.txt	2024-05-30 18:48:11.320767590 +0000
@@ -7101,6 +7101,8 @@
 const (
 	// EventQuotaExceeded is an alias maintained for backwards compatibility.
 	EventQuotaExceeded = event.QuotaExceeded
+	// RateLimitExceeded is an alias maintained for backwards compatibility.
+	RateLimitExceeded = event.RateLimitExceeded
 	// EventAuthFailure is an alias maintained for backwards compatibility.
 	EventAuthFailure = event.AuthFailure
 	// EventKeyExpired is an alias maintained for backwards compatibility.

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

CategorySuggestion                                                                                                                                    Score
Maintainability
Add detailed comments explaining the reason behind re-adding RateLimitExceeded

Consider adding a comment to explain why RateLimitExceeded was re-added, especially if it
relates to specific requirements or dependencies. This will help maintain clarity and
provide context for future code reviews or maintenance.

gateway/event_system.go [30-31]

-// RateLimitExceeded is an alias maintained for backwards compatibility.
+// RateLimitExceeded is re-added to maintain compatibility with the dashboard system that relies on this specific event.
+// This is necessary due to recent changes in event handling.
 RateLimitExceeded = event.RateLimitExceeded
 
Suggestion importance[1-10]: 8

Why: Adding detailed comments explaining the reason behind re-adding RateLimitExceeded improves maintainability and provides context for future code reviews or maintenance. This is particularly useful if the re-addition is due to specific requirements or dependencies.

8

@titpetric
titpetric enabled auto-merge (squash) May 30, 2024 18:48
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@titpetric
titpetric merged commit c75052d into master May 30, 2024
@titpetric
titpetric deleted the fix/tt-11739/alias-rate-limiter-types-for-compat branch May 30, 2024 19:09
nerdydread pushed a commit that referenced this pull request Sep 6, 2024
### **PR Type**
Bug fix


___

### **Description**
- Added the alias `RateLimitExceeded` in `gateway/event_system.go` to
maintain backwards compatibility.


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug fix
</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>event_system.go</strong><dd><code>Add alias
`RateLimitExceeded` for backwards compatibility</code></dd></summary>
<hr>

gateway/event_system.go
- Added alias `RateLimitExceeded` for backwards compatibility.



</details>
    

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6318/files#diff-d56e22d4f1b8d2e91bb643d30e678a3819691a18bfae8506b10e0af8dc279a0e">+2/-0</a>&nbsp;
&nbsp; &nbsp; </td>
</tr>                    
</table></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools
and their descriptions

Co-authored-by: Tit Petric <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants