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

[feature] Analytics plugin #272

Merged
merged 5 commits into from
Jun 4, 2015
Merged

Conversation

thibaultcha
Copy link
Member

Implementing analytics plugin, part of #86.

Changes:
  • Move logging serializers to /plugins/log_serializers. Ideally, they would live in their own repos and be dependencies of all logging plugins, and the user will chose the logging format by selecting one of them. This is a step in that direction.
  • The plugin itself aggregates entries in a table (one table per API, in a shared memory zone between all workers), and sends them to API Analytics (currently localhost for testing) when the size exceeds the limit set (default to 100).
  • Configurable options are:
    • log_body log or not the request/response bodies (default false)
    • service_token API Analytics service token (required)
    • batch_size When the entries reach or exceed that size, the ALF is sent (default 100)
Notes:
  • Limitations: The serializer does not retrieve the response.statusText and response.httpVersion because I wasn't able to find a way to read the raw response from nginx.
  • This uses a new http client library for usage in nginx, with the cosocket API, as discussed with @shashiranjan84 it could be used for the HTTP logging as well, and later it'll be a dependency of both plugins.
  • No integration tests are provided, as this is kind of delicate since the server is not mockable and I don't know the testing/development servers. Only unit tests about the serialization are provided.
  • The plugin doesn't take any specific action if a batch sent failed. It will not flush the batch and keep trying to send it for each new call beyond the set batch_size.
Future improvements:
  • Log cookies, and response.redirectURL?
  • Currently only logging over HTTP, optionally, logging could be over ZMQ too.
  • The plugin does not check that the sent ALF is smaller than 1MB (max size given by @SGrondin).
  • If Kong is being stopped, it looks like the buffer isn't being flushed and sent to analytics.

@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch 4 times, most recently from b227424 to 4ee2f95 Compare May 29, 2015 13:17
@SGrondin
Copy link
Contributor

I recommend flushing the buffer every 1 second as well. So flush to the server when it gets to 100 ALFs and every time it hasn't been flushed in 1000 ms. Otherwise you could end up with data that gets stuck in the buffer for too long when the traffic is low and API Analytics wouldn't be real-time anymore.

@thibaultcha
Copy link
Member Author

Yes that's a good idea. However it doesn't make sense to periodically send stuff.

  1. Receive some data
  2. Start coroutine to send stuff periodically
  3. No more data, coroutine triggered because we reached the period
  4. No more data
  5. Coroutine triggered again but with no data, coroutine is basically running for nothing

I would rather implement:

  1. Receive some data
  2. If batch_size reached, send the data
  3. If not, set a timer (a few seconds? 10, 20?) and the data will be sent after that, it's a one time timer.
  4. Waiting again for data
  5. New data, back to 2.

@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch from 4ee2f95 to 2354950 Compare May 29, 2015 14:30
@thibaultcha
Copy link
Member Author

Implemented in 2354950

New config value: delay, the time in seconds after which the buffer will be flushed if the batch didn't yet reach the limit.

@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch from 2354950 to e23706c Compare May 29, 2015 15:02
@SGrondin
Copy link
Contributor

I would rather implement:

Receive some data
If batch_size reached, send the data
If not, set a timer (a few seconds? 10, 20?) and the data will be sent after that, it's a one time timer.
Waiting again for data
New data, back to 2.

Also, good news: we also flush the data if nginx is reloaded or killed :D

Yes, that's what I meant, perfect!

@thibaultcha
Copy link
Member Author

Should I rename it to "mashape analytics" or "analytics"? @sinzone

@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch from e23706c to a474015 Compare June 1, 2015 17:49
@thibaultcha thibaultcha added the pr/wip A work in progress PR opened to receive feedback label Jun 2, 2015
@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch from a474015 to 6cf77f6 Compare June 2, 2015 23:12
@subnetmarco
Copy link
Member

@thibaultcha call it "Analytics" (analytics)

@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch 5 times, most recently from 0e9751f to 3fa5826 Compare June 3, 2015 23:38
@thibaultcha thibaultcha changed the title [feature] API Analytics plugin [feature] Analytics plugin Jun 3, 2015
@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch 3 times, most recently from 86e67de to 82af65a Compare June 4, 2015 02:11
- almost complete ALF serialization
- basic data push to apianalytics
- entries can be queued in the serializer, and flushed anytime
- serializer can output itself in JSON, being a valid ALF object
- more tests, with fixtures
- introduce serializers for logging plugins

Only a temporary solution before each serializer to be a module of its
own (maybe?) and each logging plugin to be independent from Kong, and
require serializers as dependencies. Following the discussion in #86
- fix: don't mix up different APIs.

Using a shared memory zone for having per-API ALFs instead of one ALF
having all the APIs entries, which was a mistake.
If the API has low traffic, this timer will flush the data to API
Analytics after some delay, otherwise the batch size is never reached,
and API Analytics is not real-time anymore.
@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch from 82af65a to 5deb878 Compare June 4, 2015 02:13
@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch from 5deb878 to 9de27b6 Compare June 4, 2015 02:25
@thibaultcha thibaultcha force-pushed the feature/plugin/apianalytics branch from 9de27b6 to 692d8a6 Compare June 4, 2015 02:34
@coveralls
Copy link

Coverage Status

Coverage increased (+0.46%) to 62.98% when pulling 692d8a6 on feature/plugin/apianalytics into 6e3848f on master.

@thibaultcha thibaultcha added pr/ready (but hold merge) No more concerns, but do not merge yet (probably a conflict of interest with another PR or release) and removed pr/wip A work in progress PR opened to receive feedback labels Jun 4, 2015
thibaultcha added a commit that referenced this pull request Jun 4, 2015
@thibaultcha thibaultcha merged commit 4732eac into master Jun 4, 2015
@thibaultcha thibaultcha deleted the feature/plugin/apianalytics branch June 4, 2015 13:25
thibaultcha added a commit that referenced this pull request Jun 4, 2015
…ics"

This reverts commit 4732eac, reversing
changes made to 6e3848f.
ctranxuan pushed a commit to streamdataio/kong that referenced this pull request Aug 25, 2015
[feature] Analytics plugin

Former-commit-id: 5f9fc30ac9670dc02177b330f2916d5fec56eb1e
ctranxuan pushed a commit to streamdataio/kong that referenced this pull request Aug 25, 2015
…alytics"

This reverts commit aa08ba9 [formerly 5f9fc30ac9670dc02177b330f2916d5fec56eb1e], reversing
changes made to 06296d1 [formerly 0e5b1b6506abd530b5a3ded139cf82eaae19b4a3].


Former-commit-id: e757ee9542753fb63990204d257768c238cb5bc8
bungle added a commit that referenced this pull request Oct 15, 2019
#### 1.7.0 (2019-10-14)

##### New features

- utils.quote_arg will now optionally take an array of arguments and escape them all into a single string.
- app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases
- app.script_name returns the name of the current script (previously a private function)

##### Changes

- Documentation updates
- utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+).
- utils.assert_arg and utils.assert_string: now return the validated value
- pl.compat: now exports the jit and jit52 flags
- pretty.write: now sorts the output for easier diffs #293

##### Fixes

- utils.raise changed the global on_error-level when passing in bad arguments
- utils.writefile now checks and returns errors when writing
- compat.execute now handles the Windows exitcode -1 properly
- types.is_empty would return true on spaces always, indepedent of the parameter
- types.to_bool will now compare case-insensitive for the extra passed strings
- app.require_here will now properly handle an absolute base path
- stringx.split will no longer append an empty match if the number of requested elements has already been reached #295
- path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297
- dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297
- added a missing assertion on path.getmtime #291
- stringx.rpartition returned bad results on a not-found #299

#### 1.6.0 (2018-11-23)

##### New features

- pl.compat now provides unpack as table.unpack on Lua 5.1

##### Changes

- utils.unpack is now documented and respects .n field of its argument.
- tablex.deepcopy and tablex.deepcompare are now cycle aware (#262)
- Installing through LuaRocks will now include the full rendered documentation

##### Fixes

- Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253).
- pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256).
- Fixed pl.import_into not importing some Penlight modules (#268).
- Fixed version number stuck at 1.5.2 (#260).
- Fixed types.is_empty returning true on tables containing false key (#267).
- Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272).
- Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern.
- Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation.
- Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3.
- Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)).
- Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
bungle added a commit that referenced this pull request Oct 15, 2019
#### 1.7.0 (2019-10-14)

##### New features

- utils.quote_arg will now optionally take an array of arguments and escape them all into a single string.
- app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases
- app.script_name returns the name of the current script (previously a private function)

##### Changes

- Documentation updates
- utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+).
- utils.assert_arg and utils.assert_string: now return the validated value
- pl.compat: now exports the jit and jit52 flags
- pretty.write: now sorts the output for easier diffs #293

##### Fixes

- utils.raise changed the global on_error-level when passing in bad arguments
- utils.writefile now checks and returns errors when writing
- compat.execute now handles the Windows exitcode -1 properly
- types.is_empty would return true on spaces always, indepedent of the parameter
- types.to_bool will now compare case-insensitive for the extra passed strings
- app.require_here will now properly handle an absolute base path
- stringx.split will no longer append an empty match if the number of requested elements has already been reached #295
- path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297
- dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297
- added a missing assertion on path.getmtime #291
- stringx.rpartition returned bad results on a not-found #299

#### 1.6.0 (2018-11-23)

##### New features

- pl.compat now provides unpack as table.unpack on Lua 5.1

##### Changes

- utils.unpack is now documented and respects .n field of its argument.
- tablex.deepcopy and tablex.deepcompare are now cycle aware (#262)
- Installing through LuaRocks will now include the full rendered documentation

##### Fixes

- Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253).
- pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256).
- Fixed pl.import_into not importing some Penlight modules (#268).
- Fixed version number stuck at 1.5.2 (#260).
- Fixed types.is_empty returning true on tables containing false key (#267).
- Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272).
- Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern.
- Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation.
- Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3.
- Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)).
- Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
bungle added a commit that referenced this pull request Oct 16, 2019
#### 1.7.0 (2019-10-14)

##### New features

- utils.quote_arg will now optionally take an array of arguments and escape them all into a single string.
- app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases
- app.script_name returns the name of the current script (previously a private function)

##### Changes

- Documentation updates
- utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+).
- utils.assert_arg and utils.assert_string: now return the validated value
- pl.compat: now exports the jit and jit52 flags
- pretty.write: now sorts the output for easier diffs #293

##### Fixes

- utils.raise changed the global on_error-level when passing in bad arguments
- utils.writefile now checks and returns errors when writing
- compat.execute now handles the Windows exitcode -1 properly
- types.is_empty would return true on spaces always, indepedent of the parameter
- types.to_bool will now compare case-insensitive for the extra passed strings
- app.require_here will now properly handle an absolute base path
- stringx.split will no longer append an empty match if the number of requested elements has already been reached #295
- path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297
- dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297
- added a missing assertion on path.getmtime #291
- stringx.rpartition returned bad results on a not-found #299

#### 1.6.0 (2018-11-23)

##### New features

- pl.compat now provides unpack as table.unpack on Lua 5.1

##### Changes

- utils.unpack is now documented and respects .n field of its argument.
- tablex.deepcopy and tablex.deepcompare are now cycle aware (#262)
- Installing through LuaRocks will now include the full rendered documentation

##### Fixes

- Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253).
- pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256).
- Fixed pl.import_into not importing some Penlight modules (#268).
- Fixed version number stuck at 1.5.2 (#260).
- Fixed types.is_empty returning true on tables containing false key (#267).
- Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272).
- Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern.
- Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation.
- Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3.
- Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)).
- Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
bungle added a commit that referenced this pull request Oct 16, 2019
#### 1.7.0 (2019-10-14)

##### New features

- utils.quote_arg will now optionally take an array of arguments and escape them all into a single string.
- app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases
- app.script_name returns the name of the current script (previously a private function)

##### Changes

- Documentation updates
- utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+).
- utils.assert_arg and utils.assert_string: now return the validated value
- pl.compat: now exports the jit and jit52 flags
- pretty.write: now sorts the output for easier diffs #293

##### Fixes

- utils.raise changed the global on_error-level when passing in bad arguments
- utils.writefile now checks and returns errors when writing
- compat.execute now handles the Windows exitcode -1 properly
- types.is_empty would return true on spaces always, indepedent of the parameter
- types.to_bool will now compare case-insensitive for the extra passed strings
- app.require_here will now properly handle an absolute base path
- stringx.split will no longer append an empty match if the number of requested elements has already been reached #295
- path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297
- dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297
- added a missing assertion on path.getmtime #291
- stringx.rpartition returned bad results on a not-found #299

#### 1.6.0 (2018-11-23)

##### New features

- pl.compat now provides unpack as table.unpack on Lua 5.1

##### Changes

- utils.unpack is now documented and respects .n field of its argument.
- tablex.deepcopy and tablex.deepcompare are now cycle aware (#262)
- Installing through LuaRocks will now include the full rendered documentation

##### Fixes

- Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253).
- pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256).
- Fixed pl.import_into not importing some Penlight modules (#268).
- Fixed version number stuck at 1.5.2 (#260).
- Fixed types.is_empty returning true on tables containing false key (#267).
- Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272).
- Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern.
- Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation.
- Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3.
- Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)).
- Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
hishamhm pushed a commit that referenced this pull request Oct 18, 2019
#### 1.7.0 (2019-10-14)

##### New features

- utils.quote_arg will now optionally take an array of arguments and escape them all into a single string.
- app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases
- app.script_name returns the name of the current script (previously a private function)

##### Changes

- Documentation updates
- utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+).
- utils.assert_arg and utils.assert_string: now return the validated value
- pl.compat: now exports the jit and jit52 flags
- pretty.write: now sorts the output for easier diffs #293

##### Fixes

- utils.raise changed the global on_error-level when passing in bad arguments
- utils.writefile now checks and returns errors when writing
- compat.execute now handles the Windows exitcode -1 properly
- types.is_empty would return true on spaces always, indepedent of the parameter
- types.to_bool will now compare case-insensitive for the extra passed strings
- app.require_here will now properly handle an absolute base path
- stringx.split will no longer append an empty match if the number of requested elements has already been reached #295
- path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297
- dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297
- added a missing assertion on path.getmtime #291
- stringx.rpartition returned bad results on a not-found #299

#### 1.6.0 (2018-11-23)

##### New features

- pl.compat now provides unpack as table.unpack on Lua 5.1

##### Changes

- utils.unpack is now documented and respects .n field of its argument.
- tablex.deepcopy and tablex.deepcompare are now cycle aware (#262)
- Installing through LuaRocks will now include the full rendered documentation

##### Fixes

- Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253).
- pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256).
- Fixed pl.import_into not importing some Penlight modules (#268).
- Fixed version number stuck at 1.5.2 (#260).
- Fixed types.is_empty returning true on tables containing false key (#267).
- Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272).
- Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern.
- Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation.
- Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3.
- Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)).
- Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
dndx pushed a commit that referenced this pull request Nov 1, 2019
#### 1.7.0 (2019-10-14)

##### New features

- utils.quote_arg will now optionally take an array of arguments and escape them all into a single string.
- app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases
- app.script_name returns the name of the current script (previously a private function)

##### Changes

- Documentation updates
- utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+).
- utils.assert_arg and utils.assert_string: now return the validated value
- pl.compat: now exports the jit and jit52 flags
- pretty.write: now sorts the output for easier diffs #293

##### Fixes

- utils.raise changed the global on_error-level when passing in bad arguments
- utils.writefile now checks and returns errors when writing
- compat.execute now handles the Windows exitcode -1 properly
- types.is_empty would return true on spaces always, indepedent of the parameter
- types.to_bool will now compare case-insensitive for the extra passed strings
- app.require_here will now properly handle an absolute base path
- stringx.split will no longer append an empty match if the number of requested elements has already been reached #295
- path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297
- dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297
- added a missing assertion on path.getmtime #291
- stringx.rpartition returned bad results on a not-found #299

#### 1.6.0 (2018-11-23)

##### New features

- pl.compat now provides unpack as table.unpack on Lua 5.1

##### Changes

- utils.unpack is now documented and respects .n field of its argument.
- tablex.deepcopy and tablex.deepcompare are now cycle aware (#262)
- Installing through LuaRocks will now include the full rendered documentation

##### Fixes

- Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253).
- pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256).
- Fixed pl.import_into not importing some Penlight modules (#268).
- Fixed version number stuck at 1.5.2 (#260).
- Fixed types.is_empty returning true on tables containing false key (#267).
- Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272).
- Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern.
- Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation.
- Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3.
- Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)).
- Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
locao pushed a commit that referenced this pull request Nov 5, 2019
- utils.quote_arg will now optionally take an array of arguments and escape them all into a single string.
- app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases
- app.script_name returns the name of the current script (previously a private function)

- Documentation updates
- utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+).
- utils.assert_arg and utils.assert_string: now return the validated value
- pl.compat: now exports the jit and jit52 flags
- pretty.write: now sorts the output for easier diffs #293

- utils.raise changed the global on_error-level when passing in bad arguments
- utils.writefile now checks and returns errors when writing
- compat.execute now handles the Windows exitcode -1 properly
- types.is_empty would return true on spaces always, indepedent of the parameter
- types.to_bool will now compare case-insensitive for the extra passed strings
- app.require_here will now properly handle an absolute base path
- stringx.split will no longer append an empty match if the number of requested elements has already been reached #295
- path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297
- dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297
- added a missing assertion on path.getmtime #291
- stringx.rpartition returned bad results on a not-found #299

- pl.compat now provides unpack as table.unpack on Lua 5.1

- utils.unpack is now documented and respects .n field of its argument.
- tablex.deepcopy and tablex.deepcompare are now cycle aware (#262)
- Installing through LuaRocks will now include the full rendered documentation

- Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253).
- pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256).
- Fixed pl.import_into not importing some Penlight modules (#268).
- Fixed version number stuck at 1.5.2 (#260).
- Fixed types.is_empty returning true on tables containing false key (#267).
- Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272).
- Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern.
- Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation.
- Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3.
- Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)).
- Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
hutchic pushed a commit that referenced this pull request Nov 21, 2019
#### 1.7.0 (2019-10-14)

##### New features

- utils.quote_arg will now optionally take an array of arguments and escape them all into a single string.
- app.parse_args now accepts a 3rd parameter with a list of valid flags and aliases
- app.script_name returns the name of the current script (previously a private function)

##### Changes

- Documentation updates
- utils.quit: exit message is no longer required, and closes the Lua state (on 5.2+).
- utils.assert_arg and utils.assert_string: now return the validated value
- pl.compat: now exports the jit and jit52 flags
- pretty.write: now sorts the output for easier diffs #293

##### Fixes

- utils.raise changed the global on_error-level when passing in bad arguments
- utils.writefile now checks and returns errors when writing
- compat.execute now handles the Windows exitcode -1 properly
- types.is_empty would return true on spaces always, indepedent of the parameter
- types.to_bool will now compare case-insensitive for the extra passed strings
- app.require_here will now properly handle an absolute base path
- stringx.split will no longer append an empty match if the number of requested elements has already been reached #295
- path.common_prefix and path.relpath return the result in the original casing (only impacted Windows) #297
- dir.copyfile, dir.movefile, and dir.makepath create the new file/path with the requested casing, and no longer force lowercase (only impacted Windows) #297
- added a missing assertion on path.getmtime #291
- stringx.rpartition returned bad results on a not-found #299

#### 1.6.0 (2018-11-23)

##### New features

- pl.compat now provides unpack as table.unpack on Lua 5.1

##### Changes

- utils.unpack is now documented and respects .n field of its argument.
- tablex.deepcopy and tablex.deepcompare are now cycle aware (#262)
- Installing through LuaRocks will now include the full rendered documentation

##### Fixes

- Fixed seq.last returning nil instead of an empty list when given an empty iterator (#253).
- pl.template now applies tostring when substituting values in templates, avoiding errors when they are not strings or numbers (#256).
- Fixed pl.import_into not importing some Penlight modules (#268).
- Fixed version number stuck at 1.5.2 (#260).
- Fixed types.is_empty returning true on tables containing false key (#267).
- Fixed test.assertraise throwing an error when passed an array with a function to call plus its arguments (#272).
- Fixed test.assertraise not throwing an error when given function does not error but instead returns a string matching given error pattern.
- Fixed placeholder expressions being evaluated with wrong precedence of binary and unary negation.
- Fixed placeholder expressions being evaluated assuming wrong binary operator associativity (e.g. _1-(_2+_3) was evaluated as (_1-_2)+_3.
- Fixed placeholder expressions being evaluated as if unary operators take precedence over power operator (e.g. (-_1)^_2) was evaluated as -(_1^2)).
- Fixed vulnerable backtracking pattern in pl.stringx.strip (#275)
hutchic added a commit that referenced this pull request Jun 10, 2022
fix(packaging) fix some build packaging errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/ready (but hold merge) No more concerns, but do not merge yet (probably a conflict of interest with another PR or release)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants