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

[Automatic Import] Modify codegen to autogenerate openAPI spec code #193243

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

bhapas
Copy link
Contributor

@bhapas bhapas commented Sep 18, 2024

Summary

#186085 introduced OpenAPI spec for Automatic Import APIs. Since there was a bug x-codegen-enabled was set to false.

This PR modifies it to true and node scripts/generate_openapi generated new API classes for the spec.

Checklist

For maintainers

@bhapas bhapas added bug Fixes for quality problems that affect the customer experience release_note:fix Team:Security-Scalability Team label for Security Integrations Scalability Team Feature:AutomaticImport labels Sep 18, 2024
@bhapas bhapas self-assigned this Sep 18, 2024
@bhapas bhapas added the backport:prev-major Backport to (8.x, 8.17, 8.16) the previous major branch and other branches in development label Sep 18, 2024
@bhapas bhapas marked this pull request as ready for review September 18, 2024 08:28
@bhapas bhapas requested a review from a team as a code owner September 18, 2024 08:28
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-scalability (Team:Security-Scalability)

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
integrationAssistant 46 49 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
integrationAssistant 947.8KB 947.9KB +17.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
integrationAssistant 3 4 +1
Unknown metric groups

API count

id before after diff
integrationAssistant 54 59 +5

History

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

cc @bhapas

@bhapas bhapas merged commit e4180d2 into elastic:main Sep 18, 2024
28 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 18, 2024
…lastic#193243)

## Summary

elastic#186085 introduced OpenAPI spec
for Automatic Import APIs. Since there was a
[bug](elastic#186221) `x-codegen-enabled`
was set to `false`.

This PR modifies it to `true` and `node scripts/generate_openapi`
generated new API classes for the spec.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit e4180d2)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.15 Backport failed because of merge conflicts
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 193243

Questions ?

Please refer to the Backport tool documentation

bhapas added a commit to bhapas/kibana that referenced this pull request Sep 18, 2024
…lastic#193243)

## Summary

elastic#186085 introduced OpenAPI spec
for Automatic Import APIs. Since there was a
[bug](elastic#186221) `x-codegen-enabled`
was set to `false`.

This PR modifies it to `true` and `node scripts/generate_openapi`
generated new API classes for the spec.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit e4180d2)

# Conflicts:
#	x-pack/plugins/integration_assistant/common/api/build_integration/build_integration.gen.ts
#	x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.gen.ts
#	x-pack/plugins/integration_assistant/common/api/check_pipeline/check_pipeline.gen.ts
#	x-pack/plugins/integration_assistant/common/api/model/common_attributes.gen.ts
#	x-pack/plugins/integration_assistant/common/api/model/processor_attributes.ts
#	x-pack/plugins/integration_assistant/common/api/related/related_route.gen.ts
@bhapas
Copy link
Contributor Author

bhapas commented Sep 18, 2024

💚 All backports created successfully

Status Branch Result
8.15

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

bhapas added a commit that referenced this pull request Sep 18, 2024
… code (#193243) (#193297)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Automatic Import] Modify codegen to autogenerate openAPI spec code
(#193243)](#193243)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Bharat
Pasupula","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-18T13:02:24Z","message":"[Automatic
Import] Modify codegen to autogenerate openAPI spec code (#193243)\n\n##
Summary\r\n\r\nhttps://github.com//pull/186085 introduced
OpenAPI spec\r\nfor Automatic Import APIs. Since there was
a\r\n[bug](#186221)
`x-codegen-enabled`\r\nwas set to `false`.\r\n\r\nThis PR modifies it to
`true` and `node scripts/generate_openapi`\r\ngenerated new API classes
for the spec.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e4180d211a06513cf51328da090ea14315880201","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","v9.0.0","backport:prev-major","Team:Security-Scalability","Feature:AutomaticImport"],"number":193243,"url":"https://github.com/elastic/kibana/pull/193243","mergeCommit":{"message":"[Automatic
Import] Modify codegen to autogenerate openAPI spec code (#193243)\n\n##
Summary\r\n\r\nhttps://github.com//pull/186085 introduced
OpenAPI spec\r\nfor Automatic Import APIs. Since there was
a\r\n[bug](#186221)
`x-codegen-enabled`\r\nwas set to `false`.\r\n\r\nThis PR modifies it to
`true` and `node scripts/generate_openapi`\r\ngenerated new API classes
for the spec.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e4180d211a06513cf51328da090ea14315880201"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193243","number":193243,"mergeCommit":{"message":"[Automatic
Import] Modify codegen to autogenerate openAPI spec code (#193243)\n\n##
Summary\r\n\r\nhttps://github.com//pull/186085 introduced
OpenAPI spec\r\nfor Automatic Import APIs. Since there was
a\r\n[bug](#186221)
`x-codegen-enabled`\r\nwas set to `false`.\r\n\r\nThis PR modifies it to
`true` and `node scripts/generate_openapi`\r\ngenerated new API classes
for the spec.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e4180d211a06513cf51328da090ea14315880201"}},{"url":"https://github.com/elastic/kibana/pull/193290","number":193290,"branch":"8.x","state":"OPEN"}]}]
BACKPORT-->
kibanamachine added a commit that referenced this pull request Sep 18, 2024
…code (#193243) (#193290)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Automatic Import] Modify codegen to autogenerate openAPI spec code
(#193243)](#193243)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Bharat
Pasupula","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-18T13:02:24Z","message":"[Automatic
Import] Modify codegen to autogenerate openAPI spec code (#193243)\n\n##
Summary\r\n\r\nhttps://github.com//pull/186085 introduced
OpenAPI spec\r\nfor Automatic Import APIs. Since there was
a\r\n[bug](#186221)
`x-codegen-enabled`\r\nwas set to `false`.\r\n\r\nThis PR modifies it to
`true` and `node scripts/generate_openapi`\r\ngenerated new API classes
for the spec.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e4180d211a06513cf51328da090ea14315880201","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","v9.0.0","backport:prev-major","Team:Security-Scalability","Feature:AutomaticImport"],"title":"[Automatic
Import] Modify codegen to autogenerate openAPI spec
code","number":193243,"url":"https://github.com/elastic/kibana/pull/193243","mergeCommit":{"message":"[Automatic
Import] Modify codegen to autogenerate openAPI spec code (#193243)\n\n##
Summary\r\n\r\nhttps://github.com//pull/186085 introduced
OpenAPI spec\r\nfor Automatic Import APIs. Since there was
a\r\n[bug](#186221)
`x-codegen-enabled`\r\nwas set to `false`.\r\n\r\nThis PR modifies it to
`true` and `node scripts/generate_openapi`\r\ngenerated new API classes
for the spec.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e4180d211a06513cf51328da090ea14315880201"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193243","number":193243,"mergeCommit":{"message":"[Automatic
Import] Modify codegen to autogenerate openAPI spec code (#193243)\n\n##
Summary\r\n\r\nhttps://github.com//pull/186085 introduced
OpenAPI spec\r\nfor Automatic Import APIs. Since there was
a\r\n[bug](#186221)
`x-codegen-enabled`\r\nwas set to `false`.\r\n\r\nThis PR modifies it to
`true` and `node scripts/generate_openapi`\r\ngenerated new API classes
for the spec.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e4180d211a06513cf51328da090ea14315880201"}}]}]
BACKPORT-->

Co-authored-by: Bharat Pasupula <[email protected]>
@ebeahan ebeahan added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:fix labels Sep 19, 2024
ilyannn added a commit that referenced this pull request Oct 7, 2024
## Summary

Previously our schema and `.gen` files were not in sync, in the sense that

```
git checkout main && yarn kbn bootstrap && node scripts/generate_openapi --rootDir ./x-pack/plugins/integration_assistant && git diff
```

returned a non-trivial diff, despite the implementation in #193243.

In this PR we

- add missing additionalProperties to the schema;
- generate and commit exactly the generated files.

There don't seem to be any effects from the change from `passthrough` to
`catchall`.

Tested with Teleport (see GitHub).
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 7, 2024
…5302)

## Summary

Previously our schema and `.gen` files were not in sync, in the sense that

```
git checkout main && yarn kbn bootstrap && node scripts/generate_openapi --rootDir ./x-pack/plugins/integration_assistant && git diff
```

returned a non-trivial diff, despite the implementation in elastic#193243.

In this PR we

- add missing additionalProperties to the schema;
- generate and commit exactly the generated files.

There don't seem to be any effects from the change from `passthrough` to
`catchall`.

Tested with Teleport (see GitHub).

(cherry picked from commit 1599e4f)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 7, 2024
…5302)

## Summary

Previously our schema and `.gen` files were not in sync, in the sense that

```
git checkout main && yarn kbn bootstrap && node scripts/generate_openapi --rootDir ./x-pack/plugins/integration_assistant && git diff
```

returned a non-trivial diff, despite the implementation in elastic#193243.

In this PR we

- add missing additionalProperties to the schema;
- generate and commit exactly the generated files.

There don't seem to be any effects from the change from `passthrough` to
`catchall`.

Tested with Teleport (see GitHub).

(cherry picked from commit 1599e4f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.17, 8.16) the previous major branch and other branches in development bug Fixes for quality problems that affect the customer experience Feature:AutomaticImport release_note:skip Skip the PR/issue when compiling release notes Team:Security-Scalability Team label for Security Integrations Scalability Team v8.15.2 v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants