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

Env contains distributable flag #40361

Merged
merged 2 commits into from
Jul 5, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/core/server/config/__snapshots__/env.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/core/server/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface PackageInfo {
branch: string;
buildNum: number;
buildSha: string;
dist: boolean;
}

export interface EnvironmentMode {
Expand Down Expand Up @@ -138,6 +139,7 @@ export class Env {
buildNum: isKibanaDistributable ? pkg.build.number : Number.MAX_SAFE_INTEGER,
buildSha: isKibanaDistributable ? pkg.build.sha : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
version: pkg.version,
dist: isKibanaDistributable,
Copy link
Contributor

@rudolf rudolf Jul 5, 2019

Choose a reason for hiding this comment

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

Although we used dist in LP what do you think of using a more descriptive key, we could use the full word distributable but isKibanaDistributable is probably even more descriptive like:

this.packageInfo = Object.freeze({
...
  version: pkg.version,
  isKibanaDistributable,
...
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wish we did, but suspect it slows down migration as require manual changing. I'd rename this flag when plugins migrated to NP and implemented with Typescript.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, how and where we introduce breaking changes probably warrants a bigger discussion and doesn't need to block this pr.

});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const packageInfo = {
buildNum: 1,
buildSha: '',
version: '7.0.0-alpha1',
dist: false,
};

afterEach(() => {
Expand Down