Get database sha from result index
This commit is contained in:
@@ -12,6 +12,7 @@ import { RemoteQueryFailureIndexItem, RemoteQueryResultIndex, RemoteQuerySuccess
|
||||
interface ApiSuccessIndexItem {
|
||||
nwo: string;
|
||||
id: string;
|
||||
sha?: string;
|
||||
results_count: number;
|
||||
bqrs_file_size: number;
|
||||
sarif_file_size?: number;
|
||||
@@ -51,6 +52,7 @@ export async function getRemoteQueryIndex(
|
||||
id: item.id.toString(),
|
||||
artifactId: artifactId,
|
||||
nwo: item.nwo,
|
||||
sha: item.sha,
|
||||
resultCount: item.results_count,
|
||||
bqrsFileSize: item.bqrs_file_size,
|
||||
sarifFileSize: item.sarif_file_size
|
||||
|
||||
@@ -319,6 +319,7 @@ export class RemoteQueriesInterfaceManager {
|
||||
|
||||
return sortedAnalysisSummaries.map((analysisResult) => ({
|
||||
nwo: analysisResult.nwo,
|
||||
databaseSha: analysisResult.databaseSha,
|
||||
resultCount: analysisResult.resultCount,
|
||||
downloadLink: analysisResult.downloadLink,
|
||||
fileSize: this.formatFileSize(analysisResult.fileSizeInBytes)
|
||||
|
||||
@@ -181,6 +181,7 @@ export class RemoteQueriesManager extends DisposableObject {
|
||||
.slice(0, autoDownloadMaxCount)
|
||||
.map(a => ({
|
||||
nwo: a.nwo,
|
||||
databaseSha: a.databaseSha,
|
||||
resultCount: a.resultCount,
|
||||
downloadLink: a.downloadLink,
|
||||
fileSize: String(a.fileSizeInBytes)
|
||||
@@ -196,6 +197,7 @@ export class RemoteQueriesManager extends DisposableObject {
|
||||
|
||||
const analysisSummaries = resultIndex.successes.map(item => ({
|
||||
nwo: item.nwo,
|
||||
databaseSha: item.sha || 'HEAD',
|
||||
resultCount: item.resultCount,
|
||||
fileSizeInBytes: item.sarifFileSize ? item.sarifFileSize : item.bqrsFileSize,
|
||||
downloadLink: {
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface RemoteQuerySuccessIndexItem {
|
||||
id: string;
|
||||
artifactId: number;
|
||||
nwo: string;
|
||||
sha?: string;
|
||||
resultCount: number;
|
||||
bqrsFileSize: number;
|
||||
sarifFileSize?: number;
|
||||
|
||||
@@ -10,6 +10,7 @@ export interface RemoteQueryResult {
|
||||
|
||||
export interface AnalysisSummary {
|
||||
nwo: string,
|
||||
databaseSha: string,
|
||||
resultCount: number,
|
||||
downloadLink: DownloadLink,
|
||||
fileSizeInBytes: number
|
||||
|
||||
@@ -43,6 +43,7 @@ export const sampleRemoteQueryResult: RemoteQueryResult = {
|
||||
analysisSummaries: [
|
||||
{
|
||||
nwo: 'big-corp/repo1',
|
||||
databaseSha: '1234567890',
|
||||
resultCount: 85,
|
||||
fileSizeInBytes: 14123,
|
||||
downloadLink: {
|
||||
@@ -54,6 +55,7 @@ export const sampleRemoteQueryResult: RemoteQueryResult = {
|
||||
},
|
||||
{
|
||||
nwo: 'big-corp/repo2',
|
||||
databaseSha: '1234567890',
|
||||
resultCount: 20,
|
||||
fileSizeInBytes: 8698,
|
||||
downloadLink: {
|
||||
@@ -65,6 +67,7 @@ export const sampleRemoteQueryResult: RemoteQueryResult = {
|
||||
},
|
||||
{
|
||||
nwo: 'big-corp/repo3',
|
||||
databaseSha: '1234567890',
|
||||
resultCount: 8,
|
||||
fileSizeInBytes: 4123,
|
||||
downloadLink: {
|
||||
@@ -76,6 +79,7 @@ export const sampleRemoteQueryResult: RemoteQueryResult = {
|
||||
},
|
||||
{
|
||||
nwo: 'big-corp/repo4',
|
||||
databaseSha: '1234567890',
|
||||
resultCount: 3,
|
||||
fileSizeInBytes: 3313,
|
||||
downloadLink: {
|
||||
|
||||
@@ -19,6 +19,7 @@ export interface RemoteQueryResult {
|
||||
|
||||
export interface AnalysisSummary {
|
||||
nwo: string,
|
||||
databaseSha: string,
|
||||
resultCount: number,
|
||||
downloadLink: DownloadLink,
|
||||
fileSize: string,
|
||||
|
||||
Reference in New Issue
Block a user