[8.10] fix(NA): source classifier to indentify xml as static files (#164109) (#164123)

# Backport

This will backport the following commits from `main` to `8.10`:
- [fix(NA): source classifier to indentify xml as static files
(#164109)](https://github.com/elastic/kibana/pull/164109)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tiago
Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2023-08-16T23:53:59Z","message":"fix(NA):
source classifier to indentify xml as static files (#164109)\n\nThis PR
fixes a bug in the source classifier as it is currently
not\r\nidentifying xml as a static file.\r\n\r\nAs part of this I've
also identified a TODO in the source classifier\r\nrelated with the
evaluating order.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a17e307dc8840eadfc97ae3d5cf8d68052d5cd15","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","backport:all-open","v8.11.0"],"number":164109,"url":"https://github.com/elastic/kibana/pull/164109","mergeCommit":{"message":"fix(NA):
source classifier to indentify xml as static files (#164109)\n\nThis PR
fixes a bug in the source classifier as it is currently
not\r\nidentifying xml as a static file.\r\n\r\nAs part of this I've
also identified a TODO in the source classifier\r\nrelated with the
evaluating order.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a17e307dc8840eadfc97ae3d5cf8d68052d5cd15"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
This commit is contained in:
Kibana Machine 2023-08-16 20:00:38 -04:00 committed by GitHub
parent 7177a7630a
commit 66c7d669a6
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';
}