Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static void initQDSetupIfRequired() throws JsonProcessingException {
apiUtil.logToQD(browserStackCredentials,"Starting plugin data export to QD");
checkQDIntegrationAndDumpMetaData(browserStackCredentials);
} else {
LOGGER.info("BrowserStack credentials not found. Skipping Quality Dashboard initialization.");
LOGGER.warning("BrowserStack credentials not found. Skipping Quality Dashboard initialization.");
}
} catch (Exception e) {
try {
Expand Down Expand Up @@ -143,15 +143,15 @@ private static List<PipelineInfo> getAllPipelines(BrowserStackCredentials browse

} catch (JsonProcessingException e) {
// Handling the exception and logging an error
LOGGER.info("Error processing JSON for job: " + job.getName() + " - " + e.getMessage());
LOGGER.warning("Error processing JSON for job: " + job.getName() + " - " + e.getMessage());
e.printStackTrace();
}
});
} else {
try {
apiUtil.logToQD(browserStackCredentials, "Issue getting Jenkins Instance");
} catch (JsonProcessingException e) {
LOGGER.info("Error logging issue with Jenkins instance.");
LOGGER.warning("Error logging issue with Jenkins instance.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karanshah-browserstack, We are logging this as a warning instead of an error because the logs appear on the user's Jenkins system. We want to avoid showing error logs to the user.

e.printStackTrace();
}
}
Expand All @@ -161,7 +161,7 @@ private static List<PipelineInfo> getAllPipelines(BrowserStackCredentials browse
apiUtil.logToQD(browserStackCredentials,"Total Pipelines detected : " + allPipelines.size());
} catch (JsonProcessingException e) {
// Handling the exception and logging an error
LOGGER.info("Error processing JSON for total pipelines: " + e.getMessage());
LOGGER.warning("Error processing JSON for total pipelines: " + e.getMessage());
e.printStackTrace();
}
// Returning the list of filtered pipelines
Expand Down Expand Up @@ -223,7 +223,7 @@ private static List<PipelineDetails> getAllBuilds(BrowserStackCredentials browse
rootUpstreamProject = UpstreamPipelineResolver.resolveRootUpstreamProject(build, browserStackCredentials);
immediateParentProject = UpstreamPipelineResolver.resolveImmediateUpstreamProjectForQEI(build, browserStackCredentials);
} catch (Exception e) {
LOGGER.info("Error resolving upstream project for " + pipelineName + " build number " + buildNumber + ": " + e.getMessage());
LOGGER.warning("Error resolving upstream project for " + pipelineName + " build number " + buildNumber + ": " + e.getMessage());
e.printStackTrace();
}
PipelineDetails pipelineDetail = new PipelineDetails(pipelineName, buildNumber, duration, result,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void onCreated(Item job) {
try {
BrowserStackCredentials browserStackCredentials = QualityDashboardUtil.getBrowserStackCreds();
if(browserStackCredentials == null) {
LOGGER.info("BrowserStackCredentials not found. Please ensure they are configured correctly.");
LOGGER.warning("BrowserStackCredentials not found. Please ensure they are configured correctly.");
return;
}
QualityDashboardAPIUtil apiUtil = new QualityDashboardAPIUtil();
Expand All @@ -39,7 +39,7 @@ public void onCreated(Item job) {
syncItemListToQD(jsonBody, Constants.QualityDashboardAPI.getItemCrudEndpoint(), "POST");

} catch(Exception e) {
LOGGER.info("Error syncing item creation to Quality Dashboard: " + e.getMessage());
LOGGER.warning("Error syncing item creation to Quality Dashboard: " + e.getMessage());
e.printStackTrace();
}
} else {
Expand All @@ -59,7 +59,7 @@ public void onDeleted(Item job) {
String jsonBody = getJsonReqBody(new ItemUpdate(itemName, itemType));
syncItemListToQD(jsonBody, Constants.QualityDashboardAPI.getItemCrudEndpoint(), "DELETE");
} catch(Exception e) {
LOGGER.info("Error syncing item deletion to Quality Dashboard: " + e.getMessage());
LOGGER.warning("Error syncing item deletion to Quality Dashboard: " + e.getMessage());
e.printStackTrace();
}
}
Expand All @@ -75,7 +75,7 @@ public void onRenamed(Item job, String oldName, String newName) {
String jsonBody = getJsonReqBody(new ItemRename(oldName, newName, itemType));
syncItemListToQD(jsonBody, Constants.QualityDashboardAPI.getItemCrudEndpoint(), "PUT");
} catch(Exception e) {
LOGGER.info("Error syncing item rename to Quality Dashboard: " + e.getMessage());
LOGGER.warning("Error syncing item rename to Quality Dashboard: " + e.getMessage());
e.printStackTrace();
}
}
Expand All @@ -92,7 +92,7 @@ private Response syncItemListToQD(String jsonBody, String url, String typeOfRequ
QualityDashboardAPIUtil apiUtil = new QualityDashboardAPIUtil();
BrowserStackCredentials browserStackCredentials = QualityDashboardUtil.getBrowserStackCreds();
if(browserStackCredentials == null) {
LOGGER.info("BrowserStack credentials not found. Please ensure they are configured correctly.");
LOGGER.warning("BrowserStack credentials not found. Please ensure they are configured correctly.");
return null;
}
if(typeOfRequest.equals("PUT")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void onCompleted(Run<?, ?> run, TaskListener listener) {
}
}
else {
LOGGER.info("BrowserStack credentials not found. Please ensure they are configured correctly.");
LOGGER.warning("BrowserStack credentials not found. Please ensure they are configured correctly.");
}
}

Expand Down Expand Up @@ -133,7 +133,7 @@ private void sendBuildDataToQD(Run<?, ?> run, Result overallResult, String final
rootUpstreamProject = UpstreamPipelineResolver.resolveRootUpstreamProject(run, browserStackCredentials);
immediateParentProject = UpstreamPipelineResolver.resolveImmediateUpstreamProjectForQEI(run, browserStackCredentials);
} catch (Exception e) {
LOGGER.info("Error resolving upstream project for jobName: " + jobName + " and buildNumber: " + buildNumber + ". Exception: " + e.getMessage());
LOGGER.warning("Error resolving upstream project for jobName: " + jobName + " and buildNumber: " + buildNumber + ". Exception: " + e.getMessage());
e.printStackTrace();
}
Timestamp endTime = new Timestamp(endTimeInMillis);
Expand Down Expand Up @@ -191,12 +191,8 @@ private boolean isQDEnabled(BrowserStackCredentials browserStackCredentials) thr
// Check if we have a valid cached value
Boolean cachedResult = QDEnabledCache.getCachedValue();
if (cachedResult != null) {
LOGGER.info("Using cached QD enabled status: " + cachedResult);
return cachedResult;
}

// Cache expired or not set, make API call
LOGGER.info("QD enabled status cache expired or not set, making API call");
Response response = apiUtil.makeGetRequestToQd(Constants.QualityDashboardAPI.getIsQdEnabledEndpoint(), browserStackCredentials);
boolean isEnabled = false;

Expand Down