Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Auto-bundle Timeline API OpenAPI specs #188844

Merged
merged 22 commits into from
Jul 25, 2024

Conversation

maximpn
Copy link
Contributor

@maximpn maximpn commented Jul 22, 2024

Addresses: #184428

Summary

This PR adds scripts for automatic bundling of Timeline API OpenAPI specs as a part of PR pipeline. Corresponding result bundles are automatically committed to the Security Solution plugin x-pack/plugins/security_solution in the docs/openapi/ess/ and docs/openapi/serverless folders (similar to #186384).

@maximpn maximpn added release_note:skip Skip the PR/issue when compiling release notes docs Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Investigations Security Solution Investigations Team v8.16.0 labels Jul 22, 2024
@maximpn maximpn self-assigned this Jul 22, 2024
@maximpn maximpn force-pushed the add-automatic-timeline-api-bundling branch from fd2a7cb to 89d637e Compare July 22, 2024 14:16
@maximpn maximpn force-pushed the add-automatic-timeline-api-bundling branch from 89d637e to 383a756 Compare July 22, 2024 16:10
@maximpn maximpn marked this pull request as ready for review July 22, 2024 17:40
@maximpn maximpn requested review from a team as code owners July 22, 2024 17:40
@maximpn maximpn requested a review from nikitaindik July 22, 2024 17:40
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations)

@maximpn
Copy link
Contributor Author

maximpn commented Jul 22, 2024

Files by Code Owner

elastic/kibana-operations

  • .buildkite/scripts/steps/code_generation/security_solution_codegen.sh
  • .buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh

elastic/security-detection-rule-management

  • .buildkite/scripts/steps/code_generation/security_solution_codegen.sh
  • x-pack/plugins/security_solution/scripts/openapi/bundle.js
  • x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js
  • x-pack/plugins/security_solution/scripts/openapi/bundle_timeline.js

elastic/security-solution

  • x-pack/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/model/components.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/model/components.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.schema.yaml
  • x-pack/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml
  • x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml
  • x-pack/plugins/security_solution/package.json
  • x-pack/plugins/security_solution/scripts/openapi/bundle.js
  • x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js
  • x-pack/plugins/security_solution/scripts/openapi/bundle_timeline.js

elastic/security-threat-hunting-investigations

  • x-pack/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/model/components.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/model/components.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.schema.yaml
  • x-pack/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.gen.ts
  • x-pack/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.schema.yaml

@maximpn maximpn requested review from xcrzx and removed request for nikitaindik July 22, 2024 17:41
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @janmonschke @maximpn

Copy link
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes!

@janmonschke janmonschke merged commit efb2866 into elastic:main Jul 25, 2024
39 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jul 25, 2024
@maximpn maximpn deleted the add-automatic-timeline-api-bundling branch July 25, 2024 12:35
Ikuni17 added a commit that referenced this pull request Jul 26, 2024
@maximpn
Copy link
Contributor Author

maximpn commented Jul 26, 2024

Hi @Ikuni17,

Sorry for that. I planned to make an improvement in a following PR. I reapplied the changes with a fix in #189315.

jbudz pushed a commit that referenced this pull request Jul 31, 2024
…189315)

**Addresses**: #184428
**Relates to:** #188844

## Summary

The original [PR](#188844) was
rolled back by @Ikuni17 due to CI failures in `main` branch. It turned
the problem was caused by a bug in `check_for_changed_files()` which is
fixed in #189316.

This PR reapplies #188844 and it
also includes changes to reduce CI reruns (has to be rerun manually in
draft PRs) caused by changes to generated files. It's achieved by
reducing a number of `check_for_changed_files()` invocations.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting docs release_note:skip Skip the PR/issue when compiling release notes reverted Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Investigations Security Solution Investigations Team Team:Threat Hunting Security Solution Threat Hunting Team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants