Skip to content

Commit

Permalink
apply patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed Oct 29, 2024
1 parent b5b95ce commit bdd42ad
Show file tree
Hide file tree
Showing 134 changed files with 2,412 additions and 315 deletions.
2 changes: 1 addition & 1 deletion .buildkite/ftr_platform_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ enabled:
- x-pack/test/task_manager_claimer_update_by_query/config.ts
- x-pack/test/ui_capabilities/security_and_spaces/config.ts
- x-pack/test/ui_capabilities/spaces_only/config.ts
- x-pack/test/upgrade_assistant_integration/config.js
- x-pack/test/upgrade_assistant_integration/config.ts
- x-pack/test/usage_collection/config.ts
- x-pack/performance/journeys_e2e/aiops_log_rate_analysis.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard.ts
Expand Down
10 changes: 10 additions & 0 deletions .buildkite/ftr_platform_stateful_configs.yml.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff a/.buildkite/ftr_platform_stateful_configs.yml b/.buildkite/ftr_platform_stateful_configs.yml (rejected hunks)
@@ -344,7 +344,7 @@ enabled:
- x-pack/test/task_manager_claimer_mget/config.ts
- x-pack/test/ui_capabilities/security_and_spaces/config.ts
- x-pack/test/ui_capabilities/spaces_only/config.ts
- - x-pack/test/upgrade_assistant_integration/config.js
+ - x-pack/test/upgrade_assistant_integration/config.ts
- x-pack/test/usage_collection/config.ts
- x-pack/performance/journeys_e2e/aiops_log_rate_analysis.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard.ts
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ module.exports = {
'x-pack/test/*/*config.*ts',
'x-pack/test/saved_object_api_integration/*/apis/**/*',
'x-pack/test/ui_capabilities/*/tests/**/*',
'x-pack/test/upgrade_assistant_integration/**/*',
'x-pack/test/performance/**/*.ts',
'**/cypress.config.{js,ts}',
'x-pack/test_serverless/**/config*.ts',
Expand Down
6 changes: 6 additions & 0 deletions examples/routing_example/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ export const POST_MESSAGE_ROUTE_PATH = '/api/post_message';

// Internal APIs should use the `internal` prefix, instead of the `api` prefix.
export const INTERNAL_GET_MESSAGE_BY_ID_ROUTE = '/internal/get_message';

export const DEPRECATED_ROUTES = {
REMOVED_ROUTE: '/api/routing_example/d/removed_route',
MIGRATED_ROUTE: '/api/routing_example/d/migrated_route',
VERSIONED_ROUTE: '/api/routing_example/d/versioned',
};
3 changes: 2 additions & 1 deletion examples/routing_example/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
*/

import { Plugin, CoreSetup, CoreStart } from '@kbn/core/server';
import { registerRoutes } from './routes';
import { registerRoutes, registerDeprecatedRoutes } from './routes';

export class RoutingExamplePlugin implements Plugin<{}, {}> {
public setup(core: CoreSetup) {
const router = core.http.createRouter();

registerRoutes(router);
registerDeprecatedRoutes(router);

return {};
}
Expand Down
17 changes: 17 additions & 0 deletions examples/routing_example/server/routes/deprecated_routes/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { IRouter } from '@kbn/core/server';
import { registerDeprecatedRoute } from './unversioned';
import { registerVersionedDeprecatedRoute } from './versioned';

export function registerDeprecatedRoutes(router: IRouter) {
registerDeprecatedRoute(router);
registerVersionedDeprecatedRoute(router);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import type { IRouter } from '@kbn/core/server';
import { schema } from '@kbn/config-schema';
import { DEPRECATED_ROUTES } from '../../../common';

export const registerDeprecatedRoute = (router: IRouter) => {
router.get(
{
path: DEPRECATED_ROUTES.REMOVED_ROUTE,
validate: false,
options: {
access: 'public',
deprecated: {
documentationUrl: 'https://elastic.co/',
severity: 'critical',
reason: { type: 'remove' },
},
},
},
async (ctx, req, res) => {
return res.ok({
body: { result: 'Called deprecated route. Check UA to see the deprecation.' },
});
}
);

router.post(
{
path: DEPRECATED_ROUTES.MIGRATED_ROUTE,
validate: {
body: schema.object({
test: schema.maybe(schema.boolean()),
}),
},
options: {
access: 'public',
deprecated: {
documentationUrl: 'https://elastic.co/',
severity: 'critical',
reason: {
type: 'migrate',
newApiMethod: 'GET',
newApiPath: `${DEPRECATED_ROUTES.VERSIONED_ROUTE}?apiVersion=2`,
},
},
},
},
async (ctx, req, res) => {
return res.ok({
body: { result: 'Called deprecated route. Check UA to see the deprecation.' },
});
}
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import type { RequestHandler } from '@kbn/core-http-server';
import type { IRouter } from '@kbn/core/server';
import { DEPRECATED_ROUTES } from '../../../common';

const createDummyHandler =
(version: string): RequestHandler =>
(ctx, req, res) => {
return res.ok({ body: { result: `API version ${version}.` } });
};

export const registerVersionedDeprecatedRoute = (router: IRouter) => {
const versionedRoute = router.versioned.get({
path: DEPRECATED_ROUTES.VERSIONED_ROUTE,
description: 'Routing example plugin deprecated versioned route.',
access: 'internal',
options: {
excludeFromOAS: true,
},
enableQueryVersion: true,
});

versionedRoute.addVersion(
{
options: {
deprecated: {
documentationUrl: 'https://elastic.co/',
severity: 'warning',
reason: { type: 'bump', newApiVersion: '2' },
},
},
validate: false,
version: '1',
},
createDummyHandler('1')
);

versionedRoute.addVersion(
{
version: '2',
validate: false,
},
createDummyHandler('2')
);
};
1 change: 1 addition & 0 deletions examples/routing_example/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
*/

export { registerRoutes } from './register_routes';
export { registerDeprecatedRoutes } from './deprecated_routes';
1 change: 1 addition & 0 deletions examples/routing_example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"@kbn/core-http-browser",
"@kbn/config-schema",
"@kbn/react-kibana-context-render",
"@kbn/core-http-server",
]
}
89 changes: 89 additions & 0 deletions oas_docs/bundle.json.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
diff a/oas_docs/bundle.json b/oas_docs/bundle.json (rejected hunks)
@@ -6409,7 +6409,6 @@
},
"/api/fleet/agent-status": {
"get": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fagent-status#0",
"parameters": [
{
@@ -17479,7 +17478,6 @@
]
},
"put": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fagents%2F%7BagentId%7D%2Freassign#0",
"parameters": [
{
@@ -18179,7 +18177,6 @@
},
"/api/fleet/enrollment-api-keys": {
"get": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fenrollment-api-keys#0",
"parameters": [
{
@@ -18226,7 +18223,6 @@
"tags": []
},
"post": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fenrollment-api-keys#1",
"parameters": [
{
@@ -18283,7 +18279,6 @@
},
"/api/fleet/enrollment-api-keys/{keyId}": {
"delete": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fenrollment-api-keys%2F%7BkeyId%7D#1",
"parameters": [
{
@@ -18322,7 +18317,6 @@
"tags": []
},
"get": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fenrollment-api-keys%2F%7BkeyId%7D#0",
"parameters": [
{
@@ -25053,7 +25047,6 @@
},
"/api/fleet/epm/packages/{pkgkey}": {
"delete": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#3",
"parameters": [
{
@@ -25111,7 +25104,6 @@
"tags": []
},
"get": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#0",
"parameters": [
{
@@ -25173,7 +25165,6 @@
"tags": []
},
"post": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#2",
"parameters": [
{
@@ -25257,7 +25248,6 @@
"tags": []
},
"put": {
- "deprecated": true,
"operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#1",
"parameters": [
{
@@ -40472,7 +40462,6 @@
},
"/api/fleet/service-tokens": {
"post": {
- "deprecated": true,
"description": "Create a service token",
"operationId": "%2Fapi%2Ffleet%2Fservice-tokens#0",
"parameters": [
89 changes: 89 additions & 0 deletions oas_docs/output/kibana.serverless.staging.yaml.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
diff a/oas_docs/output/kibana.serverless.staging.yaml b/oas_docs/output/kibana.serverless.staging.yaml (rejected hunks)
@@ -15066,7 +15066,6 @@ paths:
- Elastic Agents
/api/fleet/agent-status:
get:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fagent-status#0'
parameters:
- description: The version of the API to use
@@ -16769,7 +16768,6 @@ paths:
tags:
- Elastic Agent actions
put:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fagents%2F%7BagentId%7D%2Freassign#0'
parameters:
- description: The version of the API to use
@@ -18622,7 +18620,6 @@ paths:
- Fleet enrollment API keys
/api/fleet/enrollment-api-keys:
get:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fenrollment-api-keys#0'
parameters:
- description: The version of the API to use
@@ -18654,7 +18651,6 @@ paths:
summary: ''
tags: []
post:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fenrollment-api-keys#1'
parameters:
- description: The version of the API to use
@@ -18692,7 +18688,6 @@ paths:
tags: []
/api/fleet/enrollment-api-keys/{keyId}:
delete:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fenrollment-api-keys%2F%7BkeyId%7D#1'
parameters:
- description: The version of the API to use
@@ -18719,7 +18714,6 @@ paths:
summary: ''
tags: []
get:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fenrollment-api-keys%2F%7BkeyId%7D#0'
parameters:
- description: The version of the API to use
@@ -20434,7 +20428,6 @@ paths:
- Elastic Package Manager (EPM)
/api/fleet/epm/packages/{pkgkey}:
delete:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#3'
parameters:
- description: The version of the API to use
@@ -20473,7 +20466,6 @@ paths:
summary: ''
tags: []
get:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#0'
parameters:
- description: The version of the API to use
@@ -20514,7 +20506,6 @@ paths:
summary: ''
tags: []
post:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#2'
parameters:
- description: The version of the API to use
@@ -20570,7 +20561,6 @@ paths:
summary: ''
tags: []
put:
- deprecated: true
operationId: '%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#1'
parameters:
- description: The version of the API to use
@@ -33533,7 +33523,6 @@ paths:
- Fleet service tokens
/api/fleet/service-tokens:
post:
- deprecated: true
description: Create a service token
operationId: '%2Fapi%2Ffleet%2Fservice-tokens#0'
parameters:
Loading

0 comments on commit bdd42ad

Please sign in to comment.