Skip to content

add kibana.jsonc files to existing packages#138965

Merged
spalger merged 13 commits intoelastic:mainfrom
spalger:implement/kibana-packages-manifest
Sep 8, 2022
Merged

add kibana.jsonc files to existing packages#138965
spalger merged 13 commits intoelastic:mainfrom
spalger:implement/kibana-packages-manifest

Conversation

@spalger
Copy link
Copy Markdown
Contributor

@spalger spalger commented Aug 17, 2022

⚠️ Reviewers ⚠️

Beyond the code-owner specific changes you see will you also please search for the new lines in .github/CODEOWNERS that mention your team/teams? These new lines represent the packages for which your team has been assigned ownership. Ownership is now going to automatically create codeowner entries so you don't need to manually setup codeowner-entries anymore.


This PR implements the new kibana.jsonc package manifest file which will be the only "boilerplate" file in packages and will include the details necessary to generate all other metadata files on-demand. This file's schema was outlined in #137611 and is relatively sparse on details for now. I'll be working on generating package.json files based on the kibana.json file next.

Improvements:

  • node scripts/generate package now asks for the name of the package interactively when not specified on the command line.
  • The "owner" field in kibana.jsonc is required to be a string starting with @ and is injected into the codeowners file as the default codeowner for the package. This will enable code-ownership of many packages which currently don't have an owner, and will allow us to validate the owners in a "soft" way by leveraging the codeowners validation that Github provides. The values of these "owner" fields were based on the existing codeowner entries, text-based owner values in package.json files, and in a few cases the package id.
    • node scripts/generate package will interactively ask for an owner if it's not supplied on the command line. The owner is then validated and suggestions are provided when the value isn't an actual team in the @elastic org.
    • At this time, in order to specify a non-team owner users must pass the owner via --owner CLI flag
  • This PR moves the kibana.devOnly flag from the package.json file to the kibana.jsonc file. This field determines if the package should be in the deps or devDeps, and whether the package can import devDeps or not. This field is now feeding into the eslint config properly and doing import checking in places which were previously broken. These fixes led to the following packages being moved to "devOnly":
    • @kbn/apm-synthtrace
    • @kbn/eslint-plugin-disable
    • @kbn/eslint-plugin-imports
    • @kbn/kibana-manifest-schema

@spalger spalger force-pushed the implement/kibana-packages-manifest branch 15 times, most recently from 2101788 to 5b04812 Compare August 24, 2022 17:02
Comment thread scripts/kibana_jsonc_migration.js Outdated
@spalger spalger force-pushed the implement/kibana-packages-manifest branch 3 times, most recently from 25962a1 to 7348364 Compare September 7, 2022 04:04
@spalger spalger force-pushed the implement/kibana-packages-manifest branch from 7348364 to 60ec59d Compare September 7, 2022 04:08
@spalger spalger added Team:Operations Kibana-Operations Team release_note:skip Skip the PR/issue when compiling release notes labels Sep 7, 2022
@spalger spalger marked this pull request as ready for review September 7, 2022 13:42
@spalger spalger requested review from a team September 7, 2022 13:42
@spalger spalger requested review from a team as code owners September 7, 2022 13:42
Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

VisEditors additions LGTM

Comment thread .github/CODEOWNERS Outdated
Comment thread .github/CODEOWNERS
packages/kbn-react-field @elastic/kibana-app-services
packages/kbn-repo-source-classifier @elastic/kibana-operations
packages/kbn-repo-source-classifier-cli @elastic/kibana-operations
packages/kbn-rule-data-utils @elastic/apm-ui
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we be the only code owners here? cc @dgieselaar

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably all of Obs + Security.

Comment thread .buildkite/scripts/steps/checks/bazel_packages.sh
Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

kibana-gis changes LGTM

Copy link
Copy Markdown
Contributor

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

I tested the three generate cli commands, manually verified package.json in the build, and that kibana.jsonc was removed.

Maybe in the future we'll have to add an offline flag to node scripts/generate, but not worried about it atm.

@spalger
Copy link
Copy Markdown
Contributor Author

spalger commented Sep 8, 2022

@jbudz Updated in 287225e (#138965)

image

Copy link
Copy Markdown
Member

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

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

LGTM - tested.

Copy link
Copy Markdown
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

ML team related changes LGTM, also checked CODEOWNERS.

Copy link
Copy Markdown
Contributor

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

Kibana Security related changes LGTM (including the ones in CODEOWNERS).

@spalger
Copy link
Copy Markdown
Contributor Author

spalger commented Sep 8, 2022

Alright, we have approvals from the vast majority of folks so I'm going to merge this once CI passes unless someone objects in that time.

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

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
@kbn/kibana-manifest-parser 4 - -4
@kbn/kibana-manifest-schema 91 96 +5
total +1

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
@kbn/kibana-manifest-parser 3 - -3
Unknown metric groups

API count

id before after diff
@kbn/kibana-manifest-parser 7 - -7
@kbn/kibana-manifest-schema 91 97 +6
total -1

ESLint disabled in files

id before after diff
@kbn/bazel-packages 0 1 +1
@kbn/jsonc 1 - -1
total -0

ESLint disabled line counts

id before after diff
@kbn/ui-shared-deps-npm 0 1 +1
lens 27 25 -2
total -1

Total ESLint disabled count

id before after diff
@kbn/bazel-packages 0 1 +1
@kbn/jsonc 1 - -1
@kbn/ui-shared-deps-npm 0 1 +1
lens 30 28 -2
total -1

History

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

@spalger spalger merged commit 3249146 into elastic:main Sep 8, 2022
@spalger spalger deleted the implement/kibana-packages-manifest branch September 8, 2022 20:31
@kibanamachine kibanamachine added v8.5.0 backport:skip This PR does not require backporting labels Sep 8, 2022
guskovaue pushed a commit to guskovaue/kibana that referenced this pull request Sep 12, 2022
* [packages] add kibana.jsonc files

* auto-migrate to kibana.jsonc

* support interactive pkg id selection too

* remove old codeowners entry

* skip codeowners generation when .github/CODEOWNERS doesn't exist

* fall back to format validation if user is offline

* update question style

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
jbudz added a commit that referenced this pull request Sep 25, 2024
As best I can tell this was default assigned to operations during a
large refactor - #138965.

Operations is mostly disconnected from the UI. I'm proposing
transferring this over to area teams where flot is in use - stack
monitoring, canvas, and timelion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Operations Kibana-Operations Team v8.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.