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

fix: putBucketLifecycle add ColdArchive and DeepColdArchive #1256

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

shungang
Copy link
Collaborator

@shungang shungang commented Oct 7, 2023

No description provided.

@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 02:47 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 02:47 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 05:59 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 05:59 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 07:07 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 07:07 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 07:07 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 07:15 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 07:23 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 07:23 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 07:54 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 07:54 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 07:54 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 08:01 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 7, 2023 08:09 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 16, 2023 02:21 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 16, 2023 02:21 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 16, 2023 02:21 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 16, 2023 02:23 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 16, 2023 02:23 — with GitHub Actions Inactive
if (!['IA', 'Archive'].includes(rule.transition.storageClass))
throw new Error('StorageClass must be IA or Archive');
if (!['IA', 'Archive', 'ColdArchive', 'DeepColdArchive'].includes(rule.transition.storageClass))
throw new Error('StorageClass must be IAArchive、ColdArchive、DeepColdArchive');
Copy link
Collaborator

Choose a reason for hiding this comment

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

存储类型的检查提个方法出来,transition和noncurrentVersionTransition都要用;这个error message多了一个空格,而且存储类型间应该是或的关系,要用or

lib/common/bucket/putBucketLifecycle.js Show resolved Hide resolved
lib/common/bucket/putBucketLifecycle.js Show resolved Hide resolved
test/config.js Outdated
@@ -1,7 +1,7 @@
const { env } = process;

const config = module.exports;
const USWEST = 'oss-us-west-1'; // ONCI=true Using the region of Silicon Valley in the United States would be faster
const USWEST = 'oss-ap-southeast-1'; // ONCI=true Faster using oss-ap-outsoutheast-1
Copy link
Collaborator

Choose a reason for hiding this comment

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

代码注释拼写错误,且和签名的变量命名不一致,有办法同时支持美西和新加坡吗

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

没有必要同时支持 美西和新加坡吧,要加的话,改动有点大

Copy link
Collaborator

Choose a reason for hiding this comment

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

我理解只是在这里加一个新的配置,库增加一个变量,在UT里增加一个bucket就好吧,后面直接用就行

test/node/bucket.test.js Show resolved Hide resolved
@@ -987,7 +1020,7 @@ describe('test/bucket.test.js', () => {
]);
assert(false);
} catch (error) {
assert(error.message.includes('IA or Archive'));
assert(error.message.includes('IAArchive'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

四种存储类型,这里就两个,而且是或的关系,上面的描述也要改吧

test/node/multiversion.test.js Show resolved Hide resolved
const { rules } = await store.getBucketLifecycle(bucket);
const [
{
noncurrentVersionTransition: { noncurrentDays, storageClass }
}
] = rules;

assert(noncurrentDays === '10' && storageClass === 'IA');
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里确定是对的吗

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

对的

Copy link
Collaborator

Choose a reason for hiding this comment

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

上面是四条呢,是不是都要检查一下

@shungang shungang temporarily deployed to ali_oss_AK October 18, 2023 03:05 — with GitHub Actions Inactive
@shungang shungang temporarily deployed to ali_oss_AK October 18, 2023 03:05 — with GitHub Actions Inactive
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.

None yet

2 participants