Skip to content

Commit 4c8a1bd

Browse files
jamietannaClaude Sonnet 5
andauthored
refactor(logger): remove unused dependencies as a stringified metaField (#45477)
As part of future changes, we need to correct the stringification logic when `branch` is an object. While looking at this, we noticed that `dependencies` is - likely - an array of items being handled by `.toString()`ing them. However, there's no existing cases in the codebase of this behaviour, so we can remove it from `metaFields`. Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
1 parent 1d48943 commit 4c8a1bd

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

lib/logger/pretty-stdout.spec.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ describe('logger/pretty-stdout', () => {
7070
);
7171
},
7272
);
73-
74-
it('stringifies a non-string (array) value for the dependencies meta field via Array#toString', () => {
75-
const rec = partial<BunyanRecord>({
76-
dependencies: ['abc', 'def'],
77-
});
78-
expect(prettyStdout.getMeta(rec)).toEqual(
79-
util.styleText('gray', ' (dependencies=abc,def)'),
80-
);
81-
});
8273
});
8374

8475
describe('getDetails(rec)', () => {
@@ -106,7 +97,6 @@ describe('logger/pretty-stdout', () => {
10697
{ field: 'packageFile' },
10798
{ field: 'depType' },
10899
{ field: 'dependency' },
109-
{ field: 'dependencies' },
110100
{ field: 'branch' },
111101
])(
112102
'drops the $field meta string field entirely from details',
@@ -125,7 +115,6 @@ describe('logger/pretty-stdout', () => {
125115
{ field: 'packageFile' },
126116
{ field: 'depType' },
127117
{ field: 'dependency' },
128-
{ field: 'dependencies' },
129118
{ field: 'branch' },
130119
])(
131120
'drops the $field meta field entirely from details, even when non-string',

lib/logger/pretty-stdout.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const metaFields = [
2424
'packageFile',
2525
'depType',
2626
'dependency',
27-
'dependencies',
2827
'branch',
2928
];
3029

0 commit comments

Comments
 (0)