-
Notifications
You must be signed in to change notification settings - Fork 751
refactor(zip): unify different methods for zipping project. (WIP) #6813
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
Conversation
|
/runIntegrationTests |
6b83fb3 to
60638ca
Compare
5052c2b to
1f5c02e
Compare
|
/runIntegrationTests |
jpinkney-aws
left a comment
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.
Code is looking pretty good so far 🚀
FWIW for:
move prepareRepoData tests to live in core module since thats where prepareRepoData lives. Do the same with zipUtil.
those are probably eventually going to be moved back to amazon q anyways, once we deprecate the current implementation, since the only common thing between toolkit/q at that point will be maybe the lsp downloading?
| public writeString(data: string, path: string, returnPromise: true): Promise<EntryMetaData> | ||
| public writeString(data: string, path: string, returnPromise?: false): void | ||
| public writeString(data: string, path: string, returnPromise?: boolean): void | Promise<EntryMetaData> { | ||
| const promise = this._zipWriter.add(path, new TextReader(data)) |
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.
Whats the use case for the promise/non promise response vs just always returning a promise and then callers can either do await or void
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.
My understanding of the ZipStream code is that it will wait until all files are done streaming in the finalize step. Therefore the most common use case is to avoid awaiting the promises individually so that we aren't waiting on IO operations until all files are added. Its only the tests where we await these promises.
| const collectFilesOptions: CollectFilesOptions = { | ||
| maxTotalSizeBytes: this.getProjectScanPayloadSizeLimitInBytes(), | ||
| excludePatterns: | ||
| useCase === FeatureUseCase.TEST_GENERATION |
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.
Do you think it would be hard to eventually get rid of these useCase conditions?
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.
Yea, this is what I am struggling with now. These enums are everywhere in ZipUtil and make it difficult to pull out general components.
5bf0dbf to
acb7361
Compare
Once the agents live in flare, it can be removed completely right? |
|
Planning to scrap this work as the PR is becoming messy. The Current plan is to focus on decoupling |
Problem
Both prepareRepoData and zipUtil are ways to take your current workspace and package it up as a zip. /doc and /dev use prepareRepoData. /review and /test use zipUtil. Their implementations are pretty similar and we should be able to have a shared utility that is a consolidated version of the two.
Both implementations are highly coupled to their use case, but more so
zipUtil. Additionally,zipUtilusesadmZip, a non-web compatible dependency.GOAL
admZipinzipUtil.Solution
prepareRepoDatatests to live incoremodule since thats whereprepareRepoDatalives. Do the same withzipUtil.feature/xbranches will not be squash-merged at release time.