-
Notifications
You must be signed in to change notification settings - Fork 16
DX - 3258 - Added Variant support in Audit plugin to check for publish_details and references #2045
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
base: development
Are you sure you want to change the base?
Conversation
@@ -568,6 +576,11 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma | |||
row['Fix status'] = row.fixStatus; | |||
} | |||
|
|||
// Handle variant flag for entries | |||
if ('is_variant' in issue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cs-raj , can we add is_variant in constant files or somewhere else? So that we can use the variable in test cases as well.
@@ -1,4 +1,7 @@ | |||
import map from 'lodash/map'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cs-raj , try to use import map from 'lodash/map';
export class VariantLogger implements IVariantLogger { | ||
constructor(private readonly log: LogFn) {} | ||
|
||
logError(message: string, args: Record<string, string>): void { | ||
this.log($t(message, args), 'error'); | ||
} | ||
|
||
logInfo(message: string, args: Record<string, string>): void { | ||
this.log($t(message, args), 'info'); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cs-raj , why have you added separate logger for variant? We can use existing audit log file
private isValidVariantEntry(entry: unknown): entry is VariantEntry { | ||
if (!entry || typeof entry !== 'object') return false; | ||
|
||
const e = entry as Record<string, unknown>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cs-raj , instead of e variable can you use meaningful name ?
if (Array.isArray(value)) { | ||
// Check each item in array for references | ||
for (const item of value) { | ||
if (item && typeof item === 'object' && item.uid && item._content_type_uid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cs-raj , use optional chaining here
version bump: 1.14.0 -> 1.15.0