[kbn/pm] use mtime of untracked files in bootstrap cache key (#64293)

This commit is contained in:
Spencer 2020-04-27 16:43:18 -07:00 committed by GitHub
parent 4cc5b3a4d3
commit 7a4d97cec8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View file

@ -57025,7 +57025,7 @@ async function getChangesForProjects(projects, kbn, log) {
log.verbose('getting changed files');
const {
stdout
} = await execa__WEBPACK_IMPORTED_MODULE_3___default()('git', ['ls-files', '-dmt', '--', ...Array.from(projects.values()).filter(p => kbn.isPartOfRepo(p)).map(p => p.path)], {
} = await execa__WEBPACK_IMPORTED_MODULE_3___default()('git', ['ls-files', '-dmto', '--exclude-standard', '--', ...Array.from(projects.values()).filter(p => kbn.isPartOfRepo(p)).map(p => p.path)], {
cwd: kbn.getAbsolute()
});
const output = stdout.trim();
@ -57052,10 +57052,13 @@ async function getChangesForProjects(projects, kbn, log) {
unassignedChanges.set(path, 'deleted');
break;
case '?':
unassignedChanges.set(path, 'untracked');
break;
case 'H':
case 'S':
case 'K':
case '?':
default:
log.warning(`unexpected modification status "${tag}" for ${path}, please report this!`);
unassignedChanges.set(path, 'invalid');

View file

@ -32,7 +32,7 @@ import { Kibana } from '../utils/kibana';
export type ChecksumMap = Map<string, string | undefined>;
/** map of [repo relative path to changed file, type of change] */
type Changes = Map<string, 'modified' | 'deleted' | 'invalid'>;
type Changes = Map<string, 'modified' | 'deleted' | 'invalid' | 'untracked'>;
const statAsync = promisify(Fs.stat);
const projectBySpecificitySorter = (a: Project, b: Project) => b.path.length - a.path.length;
@ -45,7 +45,8 @@ async function getChangesForProjects(projects: ProjectMap, kbn: Kibana, log: Too
'git',
[
'ls-files',
'-dmt',
'-dmto',
'--exclude-standard',
'--',
...Array.from(projects.values())
.filter(p => kbn.isPartOfRepo(p))
@ -78,10 +79,13 @@ async function getChangesForProjects(projects: ProjectMap, kbn: Kibana, log: Too
unassignedChanges.set(path, 'deleted');
break;
case '?':
unassignedChanges.set(path, 'untracked');
break;
case 'H':
case 'S':
case 'K':
case '?':
default:
log.warning(`unexpected modification status "${tag}" for ${path}, please report this!`);
unassignedChanges.set(path, 'invalid');