fix(NA): source classifier to indentify xml as static files (#164109)

This PR fixes a bug in the source classifier as it is currently not
identifying xml as a static file.

As part of this I've also identified a TODO in the source classifier
related with the evaluating order.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tiago Costa 2023-08-17 00:53:59 +01:00 committed by GitHub
parent 8ce51770a5
commit a17e307dc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,9 @@ import { RANDOM_TEST_FILE_NAMES, TEST_DIR, TEST_TAG } from './config';
import { RepoPath } from './repo_path';
const STATIC_EXTS = new Set(
'json|woff|woff2|ttf|eot|svg|ico|png|jpg|gif|jpeg|html|md|txt|tmpl'.split('|').map((e) => `.${e}`)
'json|woff|woff2|ttf|eot|svg|ico|png|jpg|gif|jpeg|html|md|txt|tmpl|xml'
.split('|')
.map((e) => `.${e}`)
);
export class RepoSourceClassifier {
@ -153,6 +155,8 @@ export class RepoSourceClassifier {
const pkgInfo = path.getPkgInfo();
if (!pkgInfo) {
// TODO: consider if static, test or mock and tooling should only be checked before triggering non-package
// GH ISSUE: https://github.com/elastic/kibana/issues/164110
return 'non-package';
}