-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
multiroot jest-change-files #3969
Conversation
return new Promise((resolve, reject) => { | ||
let args = ['status', '-amnu']; | ||
if (options && options.withAncestor) { | ||
args.push('--rev', 'ancestor(.^)'); |
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.
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.
Maybe ask internally, but I think that's about what it does. If it's only used internally, that's probably why I added this here and we can kill it :D
91d0724
to
dd9c085
Compare
integration_tests/utils.js
Outdated
@@ -29,6 +29,9 @@ const run = (cmd, cwd) => { | |||
throw new Error(message); | |||
} | |||
|
|||
result.stdout = String(result.stdout); |
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.
I'd feel better about this if you called toString()
explicitly.
integration_tests/utils.js
Outdated
@@ -57,7 +60,8 @@ const makeTemplate = string => { | |||
}; | |||
}; | |||
|
|||
const cleanup = (directory: string) => rimraf.sync(directory); | |||
const cleanup = (directory: string) => | |||
fs.existsSync(directory) && rimraf.sync(directory); |
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.
I'll buy an if-statement.
stdout = stdout.trim(); | ||
if (stdout === '') { | ||
resolve([]); | ||
const adapter: SCMAdapter = { |
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 need this explicit typing here?
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.
yeah. to make sure both git
and hg
have the same API and don't deviate
This looks fine overall, but I'm not entirely sure about the plan here. This doesn't really change anything, does it? Are you planning to take the main call out of |
options: Options, | ||
): Promise<Array<Path>> => { | ||
return new Promise((resolve, reject) => { | ||
let args = ['status', '-amnu']; |
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.
also i think i found a bug here. the original arguments were -amn
and that does not return untracked
files. ./git.js
does return untracked files
3e921ef
to
08cb3c5
Compare
08cb3c5
to
0ef151e
Compare
Codecov Report
@@ Coverage Diff @@
## master #3969 +/- ##
=========================================
- Coverage 59.92% 59.8% -0.13%
=========================================
Files 196 196
Lines 6785 6769 -16
Branches 6 6
=========================================
- Hits 4066 4048 -18
- Misses 2716 2718 +2
Partials 3 3
Continue to review full report at Codecov.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
first step towards optimizing performance of this module.
the problem we hit at fb is that we have too many roots specified for every project, and we had to get changed files for each root.
Now all roots are first resolved to a SCM root and deduped, so we'll be querying SCM only once per context.
includes a shitload of tests and types.
todo (followup PRs):
www
,mobile
are in the same repo and will give different results, but with the current implementation it'll do one request for every context)