kibana/packages/kbn-ci-stats-reporter
Kibana Machine a8b89ce376
[8.16] Disable allowAbsoluteUrls for axios (#215138) (#215826)
# Backport

This will backport the following commits from `main` to `8.16`:
- [Disable `allowAbsoluteUrls` for axios
(#215138)](https://github.com/elastic/kibana/pull/215138)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"alex.szabo@elastic.co"},"sourceCommit":{"committedDate":"2025-03-25T08:52:36Z","message":"Disable
`allowAbsoluteUrls` for axios (#215138)\n\n## Summary\nAfter
https://github.com/elastic/kibana/pull/214843, `axios` client\nusages
need to set a flag to prevent the vulnerable behavior.\n\nTo reviewers:
if you think it's a mistake, and you created a client to\nrequest for
absolute URLs, consider unsetting the `baseURL` to\ncommunicate
intent.","sha":"e40b17aa22ec1a2fbc56ae8651e12f658099ec14","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","Team:QA","Team:Security","release_note:skip","backport:all-open","Team:obs-ux-logs","Team:obs-ux-infra_services","v9.1.0"],"title":"Disable
`allowAbsoluteUrls` for
axios","number":215138,"url":"https://github.com/elastic/kibana/pull/215138","mergeCommit":{"message":"Disable
`allowAbsoluteUrls` for axios (#215138)\n\n## Summary\nAfter
https://github.com/elastic/kibana/pull/214843, `axios` client\nusages
need to set a flag to prevent the vulnerable behavior.\n\nTo reviewers:
if you think it's a mistake, and you created a client to\nrequest for
absolute URLs, consider unsetting the `baseURL` to\ncommunicate
intent.","sha":"e40b17aa22ec1a2fbc56ae8651e12f658099ec14"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215138","number":215138,"mergeCommit":{"message":"Disable
`allowAbsoluteUrls` for axios (#215138)\n\n## Summary\nAfter
https://github.com/elastic/kibana/pull/214843, `axios` client\nusages
need to set a flag to prevent the vulnerable behavior.\n\nTo reviewers:
if you think it's a mistake, and you created a client to\nrequest for
absolute URLs, consider unsetting the `baseURL` to\ncommunicate
intent.","sha":"e40b17aa22ec1a2fbc56ae8651e12f658099ec14"}}]}]
BACKPORT-->

---------

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
2025-03-25 18:23:12 +02:00
..
src [8.16] Disable allowAbsoluteUrls for axios (#215138) (#215826) 2025-03-25 18:23:12 +02:00
index.ts Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kibana.jsonc Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
package.json Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
README.md
tsconfig.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00

Kibana CI Stats reporter

We're working on building a new service, the Kibana CI Stats service, which will collect information about CI runs and metrics produced while testing Kibana, and then provide tools for reporting on those metrics in specific PRs and overall as a way to spot trends.

CiStatsReporter

This class integrates with the ciStats.trackBuild {} Jenkins Pipeline function, consuming the KIBANA_CI_STATS_CONFIG variable produced by that wrapper, and then allowing test code to report stats to the service.

To create an instance of the reporter, import the class and call CiStatsReporter.fromEnv(log) (passing it a tooling log).

CiStatsReporter#metrics(metrics: Metric[])

Use this method to record metrics in the Kibana CI Stats service.

interface Metric {
  group: string,
  id: string,
  value: number,
  // optional limit, values which exceed the limit will fail PRs
  limit?: number
  // optional path, relative to the root of the repo, where config values
  // are defined. Will be linked to in PRs which have overages.
  limitConfigPath?: string
}

Example:

import { CiStatsReporter, ToolingLog } from '@kbn/dev-utils';

const log = new ToolingLog(...);
const reporter = CiStatsReporter.fromEnv(log)
reporter.metrics([
  {
    group: 'Build size',
    id: specificBuildName,
    value: sizeOfBuild
  }
])