Skip to content

Commit

Permalink
[7.x] [kbn/pm] use mtime of untracked files in bootstrap cache key (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored Apr 28, 2020
1 parent 2d275db commit 0911953
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57107,7 +57107,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();
Expand All @@ -57134,10 +57134,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');
Expand Down
10 changes: 7 additions & 3 deletions packages/kbn-pm/src/utils/project_checksums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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))
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 0911953

Please sign in to comment.