You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/01 10:14:46 UTC

[GitHub] [apisix] aikin-vip opened a new pull request #6779: feat(request-id) algorithm support nanoid

aikin-vip opened a new pull request #6779:
URL: https://github.com/apache/apisix/pull/6779


   ### Description
   
   nanoid is faster than UUID
   
   related repos: 
   1. [nanoid--------js](https://github.com/ai/nanoid)
   2. [nanoid--------lua](https://github.com/CriztianiX/lua-resty-nanoid)
   3. [nanoid--------c](https://github.com/NerdyPepper/nanoid)
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tokers commented on a change in pull request #6779: feat(request-id): add algorithm support nanoid

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #6779:
URL: https://github.com/apache/apisix/pull/6779#discussion_r840989086



##########
File path: t/plugin/request-id.t
##########
@@ -646,3 +646,36 @@ GET /opentracing
 X-Request-ID: 123
 --- response_headers
 X-Request-ID: 123
+
+
+
+=== TEST 20: add plugin with algorithm nanoid (default uuid)
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1',
+                 ngx.HTTP_PUT,
+                 [[{
+                        "plugins": {
+                            "request-id": {
+                                "algorithm": "nanoid"
+                            }
+                        },
+                        "upstream": {
+                            "nodes": {
+                                "127.0.0.1:1982": 1
+                            },
+                            "type": "roundrobin"
+                        },
+                        "uri": "/opentracing"
+                }]]
+                )
+            if code >= 300 then
+                ngx.status = code
+            end
+            ngx.say(body)
+        }
+    }
+--- response_body
+passed

Review comment:
       Should add another case to cover the id generation.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] aikin-vip commented on pull request #6779: feat(request-id): add algorithm support nanoid

Posted by GitBox <gi...@apache.org>.
aikin-vip commented on pull request #6779:
URL: https://github.com/apache/apisix/pull/6779#issuecomment-1086602902


   > The installation in https://github.com/CriztianiX/lua-resty-nanoid is incorrect. We should fix it like: https://github.com/stuartcarnie/lua-snowflake/blob/master/rockspec/snowflake-1.0-1.rockspec
   
   fix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org