Skip to content

Commit

Permalink
[Bug] DRC-832 Fix recce checks status doen't shown on Cloud page
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Huang <[email protected]>
  • Loading branch information
kentwelcome committed Oct 24, 2024
1 parent 8ff1462 commit ed3718e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion recce/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from datetime import datetime
from hashlib import md5, sha256
from typing import List, Optional, Dict, Union, Tuple
from urllib.parse import urlencode

import botocore.exceptions
from pydantic import BaseModel
Expand Down Expand Up @@ -416,9 +417,10 @@ def _export_state_to_recce_cloud(self, metadata: dict = None) -> Union[str, None
presigned_url = RecceCloud(token=self.cloud_options.get('token')).get_presigned_url(
method=PresignedUrlMethod.UPLOAD, pr_info=self.pr_info, artifact_name=RECCE_STATE_COMPRESSED_FILE,
metadata=metadata)

compress_passwd = self.cloud_options.get('password')
headers = s3_sse_c_headers(compress_passwd)
if metadata:
headers['x-amz-tagging'] = urlencode(metadata)
with tempfile.NamedTemporaryFile() as tmp:
self._export_state_to_file(tmp.name, file_type=SupportedFileTypes.GZIP)
response = requests.put(presigned_url, data=open(tmp.name, 'rb').read(), headers=headers)
Expand Down

0 comments on commit ed3718e

Please sign in to comment.