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

Add AUDITLOG_TRUNCATE_CHANGES_DISPLAY and AUDITLOG_TRUNCATE_LIMIT #684

Conversation

hoangquochung1110
Copy link
Contributor

@hoangquochung1110 hoangquochung1110 commented Oct 31, 2024

To configure how many characters will be truncated or disable it

Resovle #633

@hoangquochung1110 hoangquochung1110 force-pushed the feature/add-config-for-truncate-changes-display branch from 5bdd0da to 6119547 Compare October 31, 2024 01:52
auditlog/conf.py Outdated Show resolved Hide resolved
auditlog/models.py Outdated Show resolved Hide resolved
@hramezani
Copy link
Member

Thanks @hoangquochung1110 for the PR, I left a couple of comments.

Please add a changelog

To configure how many characters will be truncated or disable it
@hoangquochung1110 hoangquochung1110 force-pushed the feature/add-config-for-truncate-changes-display branch 2 times, most recently from 7343dfe to 0c5723e Compare November 1, 2024 15:10
@hoangquochung1110
Copy link
Contributor Author

hoangquochung1110 commented Nov 1, 2024

My appreciation to your time and comments
I've updated the PR accordingly
Also help me check the usage and changelog as english is not my mother tongue.
Thank you @hramezani

Copy link

codecov bot commented Nov 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.48%. Comparing base (5289482) to head (19000db).
Report is 28 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #684      +/-   ##
==========================================
+ Coverage   95.21%   95.48%   +0.26%     
==========================================
  Files          31       32       +1     
  Lines        1025     1085      +60     
==========================================
+ Hits          976     1036      +60     
  Misses         49       49              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 310 to 317
Number of characters at which strings in `changes_display_dict` property should be truncated if length exceeded

Set to 140 by default.

You can use this settings to preserve the strings by set it to a negative number.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Number of characters at which strings in `changes_display_dict` property should be truncated if length exceeded
Set to 140 by default.
You can use this settings to preserve the strings by set it to a negative number.
This configuration variable defines the truncation behavior for strings in `changes_display_dict`, with a default value of `140` characters.
0: The entire string is truncated, resulting in an empty output.
Positive values (e.g., 5): Truncates the string, keeping only the specified number of characters followed by an ellipsis (...) after the limit.
Negative values: No truncation occurs, and the full string is displayed.
.. versionadded:: 3.1.0

@hramezani
Copy link
Member

Thanks @hoangquochung1110 for the update.

LGTM, I only left a suggestion for the new config description.

to keep or truncate strings of `changes_display_dict` property at a variable length
@hoangquochung1110 hoangquochung1110 force-pushed the feature/add-config-for-truncate-changes-display branch from 0c5723e to 19000db Compare November 4, 2024 09:00
@hramezani hramezani merged commit d4f99c2 into jazzband:master Nov 4, 2024
7 checks passed
@hramezani
Copy link
Member

Thanks @hoangquochung1110

@hoangquochung1110
Copy link
Contributor Author

Thank you for your approval @hramezani

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