Skip to content

Commit

Permalink
[Security Solution] Show deprecated bulk endpoints in Upgrade Assista…
Browse files Browse the repository at this point in the history
…nt: some clean-up (elastic#209545)

**Addresses:** elastic#193184
**Is a follow-up to:** elastic#207091,
elastic#208090,
elastic#207906

## Summary

This PR follows after our recent changes made to the Upgrade Assistant
and does some minor cleanup:

- The doc link is renamed to `legacyRuleManagementBulkApiDeprecations`
for the sake of being more specific.
- The deprecation level is changed to `warning` in accordance to what we
have in `8.x` and `8.18`.
  • Loading branch information
banderror authored Feb 14, 2025
1 parent e21c5d0 commit 262969d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
aiAssistant: `${SECURITY_SOLUTION_DOCS}security-assistant.html`,
signalsMigrationApi: `${SECURITY_SOLUTION_DOCS}signals-migration-api.html`,
legacyEndpointManagementApiDeprecations: `${KIBANA_DOCS}breaking-changes-summary.html#breaking-199598`,
legacyBulkApiDeprecations: `${KIBANA_DOCS}breaking-changes-summary.html#breaking-207091`,
legacyRuleManagementBulkApiDeprecations: `${KIBANA_DOCS}breaking-changes-summary.html#breaking-207091`,
},
query: {
eql: `${ELASTICSEARCH_DOCS}eql.html`,
Expand Down
2 changes: 1 addition & 1 deletion src/platform/packages/shared/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export interface DocLinks {
readonly detectionEngineOverview: string;
readonly signalsMigrationApi: string;
readonly legacyEndpointManagementApiDeprecations: string;
readonly legacyBulkApiDeprecations: string;
readonly legacyRuleManagementBulkApiDeprecations: string;
};
readonly query: {
readonly eql: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export const bulkCreateRulesRoute = (
logger: Logger,
docLinks: DocLinksServiceSetup
) => {
const securityDocLinks = docLinks.links.securitySolution;

router.versioned
.post({
access: 'public',
Expand All @@ -67,8 +69,8 @@ export const bulkCreateRulesRoute = (
},
options: {
deprecated: {
documentationUrl: docLinks.links.securitySolution.legacyBulkApiDeprecations,
severity: 'critical',
documentationUrl: securityDocLinks.legacyRuleManagementBulkApiDeprecations,
severity: 'warning',
reason: {
type: 'migrate',
newApiMethod: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ export const bulkDeleteRulesRoute = (
authz: { requiredPrivileges: ['securitySolution'] },
},
};

const securityDocLinks = docLinks.links.securitySolution;

router.versioned.delete(routeConfig).addVersion(
{
version: '2023-10-31',
Expand All @@ -142,8 +145,8 @@ export const bulkDeleteRulesRoute = (
},
options: {
deprecated: {
documentationUrl: docLinks.links.securitySolution.legacyBulkApiDeprecations,
severity: 'critical',
documentationUrl: securityDocLinks.legacyRuleManagementBulkApiDeprecations,
severity: 'warning',
reason: {
type: 'migrate',
newApiMethod: 'POST',
Expand All @@ -154,6 +157,7 @@ export const bulkDeleteRulesRoute = (
},
handler
);

router.versioned.post(routeConfig).addVersion(
{
version: '2023-10-31',
Expand All @@ -164,8 +168,8 @@ export const bulkDeleteRulesRoute = (
},
options: {
deprecated: {
documentationUrl: docLinks.links.securitySolution.legacyBulkApiDeprecations,
severity: 'critical',
documentationUrl: securityDocLinks.legacyRuleManagementBulkApiDeprecations,
severity: 'warning',
reason: {
type: 'migrate',
newApiMethod: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const bulkPatchRulesRoute = (
logger: Logger,
docLinks: DocLinksServiceSetup
) => {
const securityDocLinks = docLinks.links.securitySolution;

router.versioned
.patch({
access: 'public',
Expand All @@ -61,8 +63,8 @@ export const bulkPatchRulesRoute = (
},
options: {
deprecated: {
documentationUrl: docLinks.links.securitySolution.legacyBulkApiDeprecations,
severity: 'critical',
documentationUrl: securityDocLinks.legacyRuleManagementBulkApiDeprecations,
severity: 'warning',
reason: {
type: 'migrate',
newApiMethod: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export const bulkUpdateRulesRoute = (
logger: Logger,
docLinks: DocLinksServiceSetup
) => {
const securityDocLinks = docLinks.links.securitySolution;

router.versioned
.put({
access: 'public',
Expand All @@ -65,8 +67,8 @@ export const bulkUpdateRulesRoute = (
},
options: {
deprecated: {
documentationUrl: docLinks.links.securitySolution.legacyBulkApiDeprecations,
severity: 'critical',
documentationUrl: securityDocLinks.legacyRuleManagementBulkApiDeprecations,
severity: 'warning',
reason: {
type: 'migrate',
newApiMethod: 'POST',
Expand Down

0 comments on commit 262969d

Please sign in to comment.