Skip to content

Improve logging in processors/action chain #1281

@jescalada

Description

@jescalada

Some action files are simply logging errors to the GitProxy console instead of adding errors as a Step (thus the error data would get lost instead of getting saved to the Push DB).

Example
checkCommitMessages.ts has a few of these:

// Commit message is empty, i.e. '', null or undefined
if (!commitMessage) {
  console.log('No commit message included...');
  return false;
}

// Validation for configured block pattern(s) check...
if (typeof commitMessage !== 'string') {
  console.log('A non-string value has been captured for the commit message...');
  return false;
}

There are several other places that info on why the message has failed the check is just being logged. We should refactor this to return an error message or null and then carry that forward into step.log messages, as that'll make illegal messages way less annoying to debug and we can drop all the debug logging here.

Describe the solution you'd like
Remove unnecessary logging across src/proxy/processors and replace with Step.log wherever it makes sense (especially places where errors should be thrown).

Additional context
#1202 (comment)
#1202 (comment)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions