Skip to content

Commit cd07ebb

Browse files
prepare 1.1.0 release (#17)
1 parent 17222a7 commit cd07ebb

File tree

6 files changed

+115
-2
lines changed

6 files changed

+115
-2
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is this a support request?**
11+
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/) and clicking "submit a request", or by emailing support@launchdarkly.com.
12+
13+
Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.
14+
15+
**Describe the bug**
16+
A clear and concise description of what the bug is.
17+
18+
**To reproduce**
19+
Steps to reproduce the behavior.
20+
21+
**Expected behavior**
22+
A clear and concise description of what you expected to happen.
23+
24+
**Logs**
25+
If applicable, add any log output related to your problem.
26+
27+
**SDK version**
28+
The version of this SDK that you are using.
29+
30+
**Language version, developer tools**
31+
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.
32+
33+
**OS/platform**
34+
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.
35+
36+
**Additional context**
37+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context about the feature request here.

.github/pull_request_template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
**Requirements**
2+
3+
- [ ] I have added test coverage for new or changed functionality
4+
- [ ] I have followed the repository's [pull request submission guidelines](../blob/master/CONTRIBUTING.md#submitting-pull-requests)
5+
- [ ] I have validated my changes against all supported platform versions
6+
7+
**Related issues**
8+
9+
Provide links to any issues in this repository or elsewhere relating to this pull request.
10+
11+
**Describe the solution you've provided**
12+
13+
Provide a clear and concise description of what you expect to happen.
14+
15+
**Describe alternatives you've considered**
16+
17+
Provide a clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
21+
Add any other context about the pull request here.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
LaunchDarkly Server-Side SDK for Lua
22
===========================
33

4+
[![CircleCI](https://circleci.com/gh/launchdarkly/lua-server-sdk.svg?style=svg)](https://circleci.com/gh/launchdarkly/lua-server-sdk)
5+
46
LaunchDarkly overview
57
-------------------------
8+
69
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started) using LaunchDarkly today!
710

811
[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)
912

10-
1113
Supported Lua versions
1214
-----------
1315

@@ -52,4 +54,3 @@ About LaunchDarkly
5254
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
5355
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
5456
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
55-
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies

launchdarkly-server-sdk.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,35 @@ LuaLDClientTrack(lua_State *const l)
10611061
return 0;
10621062
}
10631063

1064+
/***
1065+
Associates two users for analytics purposes by generating an alias event.
1066+
@function alias
1067+
@tparam user currentUser An opaque user object from @{makeUser}
1068+
@tparam user previousUser An opaque user object from @{makeUser}
1069+
@treturn nil
1070+
*/
1071+
static int
1072+
LuaLDClientAlias(lua_State *const l)
1073+
{
1074+
struct LDClient **client;
1075+
struct LDUser **currentUser, **previousUser;
1076+
struct LDJSON *value;
1077+
1078+
if (lua_gettop(l) != 3) {
1079+
return luaL_error(l, "expected exactly three arguments");
1080+
}
1081+
1082+
client = (struct LDClient **)luaL_checkudata(l, 1, "LaunchDarklyClient");
1083+
currentUser = (struct LDUser **)luaL_checkudata(l, 2, "LaunchDarklyUser");
1084+
previousUser = (struct LDUser **)luaL_checkudata(l, 3, "LaunchDarklyUser");
1085+
1086+
if (!LDClientAlias(*client, *currentUser, *previousUser)) {
1087+
return luaL_error(l, "LDClientAlias failed");
1088+
}
1089+
1090+
return 0;
1091+
}
1092+
10641093
/***
10651094
Check if a client has been fully initialized. This may be useful if the
10661095
initialization timeout was reached.
@@ -1156,6 +1185,7 @@ static const struct luaL_Reg launchdarkly_client_methods[] = {
11561185
{ "jsonVariationDetail", LuaLDClientJSONVariationDetail },
11571186
{ "flush", LuaLDClientFlush },
11581187
{ "track", LuaLDClientTrack },
1188+
{ "alias", LuaLDClientAlias },
11591189
{ "allFlags", LuaLDClientAllFlags },
11601190
{ "isInitialized", LuaLDClientIsInitialized },
11611191
{ "identify", LuaLDClientIdentify },

test.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ function TestAll:testIdentify()
109109
makeTestClient():identify(user)
110110
end
111111

112+
function TestAll:testAlias()
113+
makeTestClient():alias(user, l.makeUser({ key = "bob" }))
114+
end
115+
112116
function TestAll:testRedisBasic()
113117
local c = l.clientInit({
114118
key = "sdk-test",

0 commit comments

Comments
 (0)