Repository navigation
fix: parse details.action in audit logs as a string or an object - #1703
Merged
Merged
Conversation
❤️ Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1703 +/- ##
============================================
- Coverage 73.95% 73.84% -0.12%
- Complexity 4771 4783 +12
============================================
Files 488 489 +1
Lines 14865 14920 +55
Branches 1543 1559 +16
============================================
+ Hits 10993 11017 +24
- Misses 2959 2978 +19
- Partials 913 925 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
zimeg
commented
Nov 18, 2026
zimeg
left a comment
Member
Author
There was a problem hiding this comment.
🗣️ a comment as we reduce these
…ains Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg
marked this pull request as ready for review
November 18, 2026 18:00
cchensh
approved these changes
Nov 18, 2026
cchensh
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Non-blocking nits:
- An explicit JSON
nullfordetails.actionfalls into the finalelse: it throws in strict mode, and in lenient mode it returns an emptyDetailsActioninstead ofnull. AnisJsonNull()early return would fix it (theDetailsChangedValuefactory has the same gap). json-logs/samples/audit/v1/logs.jsonstill only has the string form ofdetails.action. Adding an object-form entry would cover it in the sample-based tests too.- Since
getAction()changes fromString, please call it out in the release notes with the migration line from the description.
Co-authored-by: Cheng Chen <35309699+cchensh@users.noreply.github.com> Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Member
Author
|
@cchensh Notes on each of these:
|
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request parses
details.actionin audit logs as either a string or an object.details.actionas a string for some actions, such as"update"forusergroup_updated, and as an object withresolutionandnotifyfor others, such asapp_allowlist_rule_created. With the currentStringtype, anygetLogspage that includes the object form fails to parse withJsonSyntaxException: Expected a string but was BEGIN_OBJECT.LogsResponse.Details.actionis now aLogsResponse.DetailsActionthat holds either form. A newGsonAuditLogsDetailsActionFactory, registered inGsonFactory, reads both, the same waysucceededUsersandfailedUsersreadUserIDs.failOnUnknownPropertieson, unknown keys in the object form raise an error.AAARuleActionNotifygainsvalues.This is a breaking change for code that reads the field as a string. To migrate, replace
details.getAction()withdetails.getAction().getStringValue(), or readgetResolution()andgetNotify()for the object form.This is the base of a stack:
Testing
With an org admin token that has
auditlogs:read:slack.audit(token).getLogs(r -> r.action("app_allowlist_rule_created"))parses, andgetDetails().getAction().getResolution()is set.slack.audit(token).getLogs(r -> r.action("usergroup_updated"))parses, andgetDetails().getAction().getStringValue()is"update".Category
Requirements
🤖 Generated with Claude Code