Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add download failure details from url provided by import api to media import command #1820

Merged

Conversation

ariskataoka
Copy link
Member

@ariskataoka ariskataoka commented May 6, 2024

Description

This PR uses the failure details URL for the import media command.

Pull request checklist

New release checklist

Changelog Description

Media import: Add option to download failure details logs from URL returned in the media import request response body.

Steps to Test

Obs.: This test requires a locall VIP API public up and running.

  1. Check out PR.
  2. Run npm run build

Scenario 1:

  1. Import media files by running VIP_PROXY="" API_HOST={ LOCAL_VIP_API_PUBLIC_URL } node ./dist/bin/vip-import-media.js @{ TEST_SITE_ID }.{ ENV_SITE } { MEDIA_TO_BE_IMPORTED_URL }

The output should contain a message about the errors and a prompt as:

⚠️  Error details can be found on ${ ERROR_DETAILS_URL_RETURNED_BY_VIP_PUBLIC_API }
Download error details now? (y/N) › 
  1. Answer y
  2. The output should contain information about the download and the local file as a result:
⚠️  All errors have been exported to { LOCAL_PATH }

Scenario 2:

Repeat step 1

  1. Answer n
  2. The prompt should exit

Copy link
Contributor

github-actions bot commented May 6, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@ariskataoka ariskataoka marked this pull request as draft May 6, 2024 23:59
@ariskataoka ariskataoka changed the title Add/error logs url media import Add download failure details from url provided by import api to media import command May 7, 2024
@ariskataoka ariskataoka marked this pull request as ready for review May 7, 2024 04:16
@ariskataoka ariskataoka requested a review from a team May 7, 2024 04:18
Copy link
Contributor

@t-wright t-wright left a comment

Choose a reason for hiding this comment

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

Left a comment in Slack, but otherwise LGTM.

Copy link
Contributor

@saroshaga saroshaga left a comment

Choose a reason for hiding this comment

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

We should also handle the case when the errors file has been deleted from s3 (after 7 days)

What message do we want to show then?

src/lib/media-import/status.ts Outdated Show resolved Hide resolved
src/lib/media-import/status.ts Outdated Show resolved Hide resolved
src/lib/media-import/status.ts Outdated Show resolved Hide resolved
src/lib/media-import/status.ts Outdated Show resolved Hide resolved
src/lib/media-import/status.ts Outdated Show resolved Hide resolved
@ariskataoka ariskataoka force-pushed the add/error-logs-url-media-import branch 2 times, most recently from 1a8c746 to f2ffa9e Compare May 8, 2024 11:04
@ariskataoka ariskataoka force-pushed the add/error-logs-url-media-import branch from f2ffa9e to e771ae7 Compare May 8, 2024 11:05
src/lib/media-import/status.ts Outdated Show resolved Hide resolved
src/lib/media-import/status.ts Outdated Show resolved Hide resolved
src/lib/media-import/status.ts Outdated Show resolved Hide resolved
Modify expiration message
Rename output functions signatures

Co-authored-by: Sarosh Aga <[email protected]>
src/lib/media-import/status.ts Fixed Show fixed Hide fixed
src/lib/media-import/status.ts Fixed Show fixed Hide fixed
Copy link

sonarqubecloud bot commented May 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ariskataoka ariskataoka merged commit 512786a into add/media-import-improvements May 9, 2024
28 checks passed
@ariskataoka ariskataoka deleted the add/error-logs-url-media-import branch May 9, 2024 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants