Skip to content

Commit

Permalink
chore(logs): add extra debug logging for target info (#5229)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-luong committed May 8, 2024
1 parent fa9d512 commit 1fbad58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/project-metadata/target-builders/git.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import * as url from 'url';
import subProcess = require('../../sub-process');
import { GitTarget } from '../types';
import * as debugModule from 'debug';

const debug = debugModule('snyk:git');

// for scp-like syntax [user@]server:project.git
const originRegex = /(.+@)?(.+):(.+$)/;
Expand Down Expand Up @@ -44,6 +47,7 @@ export async function getInfo({
} catch (err) {
// Swallowing exception since we don't want to break the monitor if there is a problem
// executing git commands.
debug('getInfo error getting target remoteUrl:', err);
}

try {
Expand All @@ -55,6 +59,7 @@ export async function getInfo({
} catch (err) {
// Swallowing exception since we don't want to break the monitor if there is a problem
// executing git commands.
debug('getInfo error getting target branch:', err);
}

return target;
Expand Down
3 changes: 3 additions & 0 deletions src/lib/snyk-test/run-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@ function sendTestPayload(
const payloadBody = payload.body as any;
const filesystemPolicy =
payload.body && !!(payloadBody?.policy || payloadBody?.scanResult?.policy);

debug('sendTestPayload request remoteUrl:', payloadBody?.target?.remoteUrl);
debug('sendTestPayload request branch:', payloadBody?.target?.branch);
return new Promise((resolve, reject) => {
makeRequest(payload, (error, res, body) => {
if (error) {
Expand Down

0 comments on commit 1fbad58

Please sign in to comment.