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

Don't omit header attribute on event details #2371

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/lib/utilities/format-event-attributes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ describe('formatAttributes', () => {
expect(formattedAttributes.firstWorkflowTaskBackoff).toBe(undefined);
});

it('should remove values that are should be omitted', () => {
const formattedAttributes = formatAttributes(workflowEvent);
expect(formattedAttributes.header).toBe(undefined);
});

it('should format nested attributes', () => {
const formattedAttributes = formatAttributes(workflowEvent);
expect(formattedAttributes.taskQueueName).toBe('rainbow-statuses');
Expand Down Expand Up @@ -178,6 +173,7 @@ describe('attributeGroups', () => {
'identity',
'firstExecutionRunId',
'attempt',
'header',
'parentInitiatedEventId',
]);
expect(groups.parent).toEqual([]);
Expand Down
8 changes: 3 additions & 5 deletions src/lib/utilities/format-event-attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export type CombinedAttributes = EventAttribute & {
namespace?: string;
};

const keysToOmit: Readonly<Set<string>> = new Set(['header']);

const keysToExpand: Readonly<Set<string>> = new Set([
'taskQueue',
'retryPolicy',
Expand Down Expand Up @@ -106,7 +104,7 @@ export const formatAttributes = (event: IterableEvent): CombinedAttributes => {
if (event.attributes) {
for (const [key, value] of Object.entries(event.attributes)) {
const shouldDisplay = shouldDisplayAttribute(key, value);
if (!keysToOmit.has(key) && shouldDisplay) attributes[key] = value;
if (shouldDisplay) attributes[key] = value;
formatNestedAttributes(attributes, key);
}
}
Expand All @@ -121,7 +119,7 @@ export const formatGroupAttributes = (
group.eventList.forEach((event) => {
for (const [key, value] of Object.entries(event.attributes)) {
const shouldDisplay = shouldDisplayAttribute(key, value);
if (!keysToOmit.has(key) && shouldDisplay) attributes[key] = value;
if (shouldDisplay) attributes[key] = value;
formatNestedAttributes(attributes, key);
}
});
Expand Down Expand Up @@ -153,7 +151,7 @@ export const formatPendingAttributes = (
relative: get(relativeTime),
})
: value;
if (!keysToOmit.has(key) && shouldDisplay) attributes[key] = formattedValue;
if (shouldDisplay) attributes[key] = formattedValue;
formatNestedAttributes(attributes, key);
}

Expand Down
Loading