-
Notifications
You must be signed in to change notification settings - Fork 370
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
chore(cleanup)!: Remove redundant callback types, move storage.ts to … #2445
Changes from all commits
bc0401b
49ac24e
5e7544c
0061d94
3d0b9e4
cb5d452
55dc813
8557206
b256785
f1d9292
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
|
||
import {Bucket, File, Notification, Storage, HmacKey, Policy} from '../src'; | ||
import * as path from 'path'; | ||
import {ApiError} from '../src/nodejs-common'; | ||
import { | ||
createTestBuffer, | ||
createTestFileFromBuffer, | ||
|
@@ -119,7 +118,7 @@ export async function combine(options: ConformanceTestOptions) { | |
} | ||
|
||
export async function create(options: ConformanceTestOptions) { | ||
const [bucketExists] = await options.bucket!.exists(); | ||
const bucketExists = await options.bucket!.exists(); | ||
if (bucketExists) { | ||
await options.bucket!.deleteFiles(); | ||
await options.bucket!.delete({ | ||
|
@@ -227,7 +226,7 @@ export async function getFilesStream(options: ConformanceTestOptions) { | |
.bucket!.getFilesStream() | ||
.on('data', () => {}) | ||
.on('end', () => resolve(undefined)) | ||
.on('error', (err: ApiError) => reject(err)); | ||
.on('error', err => reject(err)); | ||
}); | ||
} | ||
|
||
|
@@ -496,7 +495,7 @@ export async function createReadStream(options: ConformanceTestOptions) { | |
.file!.createReadStream() | ||
.on('data', () => {}) | ||
.on('end', () => resolve(undefined)) | ||
.on('error', (err: ApiError) => reject(err)); | ||
.on('error', err => reject(err)); | ||
}); | ||
} | ||
|
||
|
@@ -755,7 +754,7 @@ export async function iamSetPolicy(options: ConformanceTestOptions) { | |
}; | ||
if (options.preconditionRequired) { | ||
const currentPolicy = await options.bucket!.iam.getPolicy(); | ||
testPolicy.etag = currentPolicy[0].etag; | ||
testPolicy.etag = currentPolicy.etag; | ||
} | ||
await options.bucket!.iam.setPolicy(testPolicy); | ||
} | ||
|
@@ -795,7 +794,7 @@ export async function notificationGetMetadata(options: ConformanceTestOptions) { | |
|
||
export async function createBucket(options: ConformanceTestOptions) { | ||
const bucket = options.storage!.bucket('test-creating-bucket'); | ||
const [exists] = await bucket.exists(); | ||
const exists = await bucket.exists(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whats the change here? previously we were returning an array, and now its an object? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or update PR description with a checklist of # of changes that need to happen There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We were returning arrays for no reason all over the place. I'm trying to bring responses much more in line with the standard JSON API responses. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The number of breaking changes is going to be too big for comments / PR commit messsages. I have created an issue in buganizer to create a migration guide. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Throwing out some random ideas here... It seems like migrating for returning an array vs object is the big breaking change here. Is there anyway to have some kind of flag for customers who want to keep the current behavior? We can eventually deprecate the flag but it would give customers some more time to keep the current behavior while we modernize the library |
||
if (exists) { | ||
bucket.delete(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im guessing we can remove this once #2461 is complete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a conformance test, it already runs against test bench. The change here is that it no longer returns an array, only a single element.