-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feat/is 399 ggs create file #892
Conversation
95a7509
to
3b0a52b
Compare
) | ||
|
||
expect(result._unsafeUnwrapErr()).toBeInstanceOf(NotFoundError) | ||
expect(result.isErr()).toBeTrue() |
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.
how about tests to ensure rollbacks are done correctly - i.e. when failures occur along one of the many steps in create flow
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.
Hmm we actually only rollback in either the actual file creation, or when committing the change. I'm not entirely sure how to mock the fs call itself!
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.
okay, let's focus on the manual testing for rollback and add this in later. I think @dcshzj added a mock-fs library into the spec file which we can use possibly
f0dd458
to
c4a9ab6
Compare
* IS-401: Write extend repo service to support delete files folders (#894) * feat: base code for delete file * feat: add base delete directory steps * feat: refactor into one delete function * feat: split RepoService delete into two * fix: remove unused imports * feat: update return types * fix: BDS tests * feat: tests for delete in RepoService * fix: remove update tree function for ggs flow * feat: add tests for GFS * feat: add tests for delete * feat: add check for latest commit * fix: uncomment push * fix: add log * feat: add tests * Feat/is 399 ggs create file (#892) * refactor: safeExistsSync * chore: upgrade js-base64 * feat: add create methods * test: add tests * refactor: remove safeExistsSync and use getFilePathStats instead * test: add tests for rollback * feat: push on creation * chore: update missing import * chore: change to pass arguments directly * chore: replace return type with GitCommitResult * fix: remove unnecessary maps * fix: swap returned error on creating file * chore: remove unused import * fix: handle stats from retrieving directory info * nit: swap return from empty string to boolean * chore: improve log statement * fix: update assertion of error * feat: add optional force param to push * feat: add rollback functionality for whitelisted ggs sites * fix: rebase errors * fix: use false as default for isForce --------- Co-authored-by: Harish <harish@open.gov.sg>
Problem
This PR introduces creates to our GGS solution. Resolves IS-399. This PR also modifies checks for the existence of paths to use
gitFilePathStats
instead offs.existsSync
.Features:
clone
andisValidGitRepo
to usegetFilePathStats
insteadFuture work: