From f236b725b09d1f67b6cf89fb51647c155f60d75a Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Thu, 3 Aug 2023 11:14:17 -0400 Subject: [PATCH] Minor tweaks --- packages/artifact/src/internal/artifact-http-client.ts | 3 ++- .../artifact/src/internal/upload/tmp/twirp_testing.ts | 2 +- packages/artifact/src/internal/upload/upload-artifact.ts | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/artifact/src/internal/artifact-http-client.ts b/packages/artifact/src/internal/artifact-http-client.ts index 6e90b05e..bab4d7bb 100644 --- a/packages/artifact/src/internal/artifact-http-client.ts +++ b/packages/artifact/src/internal/artifact-http-client.ts @@ -16,8 +16,9 @@ export class ArtifactHttpClient implements Rpc { private baseUrl: string constructor(userAgent: string) { + const token = getRuntimeToken() this.httpClient = new HttpClient(userAgent, [ - new BearerCredentialHandler(getRuntimeToken()) + new BearerCredentialHandler(token) ]) this.baseUrl = getResultsServiceUrl() } diff --git a/packages/artifact/src/internal/upload/tmp/twirp_testing.ts b/packages/artifact/src/internal/upload/tmp/twirp_testing.ts index ada7303b..8c721833 100644 --- a/packages/artifact/src/internal/upload/tmp/twirp_testing.ts +++ b/packages/artifact/src/internal/upload/tmp/twirp_testing.ts @@ -1,5 +1,5 @@ import { ArtifactHttpClient } from '../../artifact-http-client' -import { ArtifactServiceClientJSON } from '../../../generated' +import { ArtifactServiceClientJSON } from '../../../generated/results/api/v1/artifact.twirp' export async function twirpTest(){ const artifactClient = new ArtifactHttpClient('@actions/artifact-upload') diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index 94d74de4..a39fc946 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -4,7 +4,7 @@ import {UploadOptions} from './upload-options' import {UploadResponse} from './upload-response' import { UploadSpecification, getUploadSpecification } from './upload-specification' import { ArtifactHttpClient } from '../artifact-http-client' -import { ArtifactServiceClientJSON } from 'src/generated' +import { ArtifactServiceClientJSON } from '../../generated/results/api/v1/artifact.twirp' import {BlobClient, BlockBlobUploadStreamOptions} from '@azure/storage-blob' import { TransferProgressEvent } from '@azure/core-http'; @@ -14,7 +14,7 @@ import * as stream from 'stream' import {getBackendIds, BackendIds} from '../util' -const bufferSize = 1024 * 1024 * 8 // 8 MB +const bufferSize = 1024 * 1024 * 8 // 8 MB // Custom stream transformer so we can set the highWaterMark property // See https://github.com/nodejs/node/issues/8855 @@ -57,6 +57,11 @@ export async function uploadArtifact( const backendIDs: BackendIds = getBackendIds() + console.log("workflow Run Backend ID " + backendIDs.workflowRunBackendId) + console.log("workflow Job Run Backend ID " + backendIDs.workflowJobRunBackendId) + + console.log("hello Rob!!") + try {