Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

[Web Portal] Replace the suffix if a cloned job is resubmited #2451

Merged
merged 3 commits into from
Apr 1, 2019

Conversation

sunqinzheng
Copy link
Contributor

#2361

  • add checksum to cloned job's name suffix
  • prepare for job config api change (fix)

@sunqinzheng sunqinzheng requested a review from Gerhut March 29, 2019 05:58
@coveralls
Copy link

coveralls commented Mar 29, 2019

Coverage Status

Coverage decreased (-0.03%) to 52.895% when pulling bddfb8d on qinsu/clone into 02b9169 on master.

Copy link
Member

@Gerhut Gerhut left a comment

Choose a reason for hiding this comment

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

Since Buffer is a node.js only feature, and ES2015 standard have TypedArray which provides similar functionalities. Shall we use TypedArray instead, to follow more to standard?

@@ -28,6 +28,7 @@ const userAuth = require('../../user/user-auth/user-auth.component');
const jobSchema = require('./job-submit.schema.js');
const querystring = require('querystring');
const stripJsonComments = require('strip-json-comments');
const uuid = require('uuid');
Copy link
Member

Choose a reason for hiding this comment

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

Have not seen the uuid included in package.json, and I don't think uuid is required here. In browser side, uuid just uses crypto level random number instead of Math.random() to avoid more collisions, since we have a directly response when user is submitting with the same job name, so I don't think avoid more collisions here is important.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@sunqinzheng
Copy link
Contributor Author

sunqinzheng commented Apr 1, 2019

Webpack uses feross/buffer v4 as nodejs Buffer's browser implementation if node.Buffer is set to true. (https://github.com/webpack/node-libs-browser)

feross/buffer uses Uint8Array by default and object as shim.

TextEncoder is another solution if we just want to convert a string to uint8array.

@Gerhut
Copy link
Member

Gerhut commented Apr 1, 2019

Webpack uses feross/buffer v4 as nodejs Buffer's browser implementation if node.Buffer is set to true. (https://github.com/webpack/node-libs-browser)
feross/buffer uses Uint8Array by default and object as shim.
TextEncoder is another solution if we just want to convert a string to uint8array.

I see and think that it is not necessary to introduce such a dependency.

@sunqinzheng
Copy link
Contributor Author

OK, I'll use TextEncoder instead

@Gerhut
Copy link
Member

Gerhut commented Apr 1, 2019

OK, I'll use TextEncoder instead

Please pay attention to MS Edge compatibility since encoding standard is still in development

@sunqinzheng
Copy link
Contributor Author

Since we only need to calc a checksum, I'll use the last byte of the charcter code

@sunqinzheng sunqinzheng merged commit 258bd06 into master Apr 1, 2019
@sunqinzheng sunqinzheng deleted the qinsu/clone branch April 1, 2019 08:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants