Skip to content

Commit

Permalink
Merge branch 'master' into kertal-pr-2019-10-09-discover-readonly-error
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 12, 2019
2 parents aff471d + 3476b19 commit c926c7e
Show file tree
Hide file tree
Showing 214 changed files with 49,228 additions and 3,932 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
/x-pack/legacy/plugins/encrypted_saved_objects/ @elastic/kibana-security
/src/legacy/server/csp/ @elastic/kibana-security
/x-pack/plugins/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security

# Kibana Stack Services
/packages/kbn-analytics/ @elastic/kibana-stack-services
Expand Down
2 changes: 2 additions & 0 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ files:
- 'x-pack/legacy/plugins/rollup/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
ignore:
- 'x-pack/legacy/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/lens/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/maps/**/*.s+(a|c)ss'
rules:
Expand Down
2 changes: 1 addition & 1 deletion docs/management/dashboard_only_mode/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[xpack-dashboard-only-mode]]
== Dashboard-only mode

deprecated[7.4.0, Using the `kibana_dashboard_only_user` role is deprecated. Use <<kibana-feature-privileges,feature privileges>> instead.]
deprecated[7.4.0, "Using the `kibana_dashboard_only_user` role is deprecated. Use <<kibana-feature-privileges,feature privileges>> instead."]

In dashboard-only mode, users have access to only the *Dashboard* app.
Users can view and filter the dashboards, but cannot create, edit, or delete
Expand Down
4 changes: 4 additions & 0 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ running behind a proxy. Use the `server.rewriteBasePath` setting to tell Kibana
if it should remove the basePath from requests it receives, and to prevent a
deprecation warning at startup. This setting cannot end in a slash (`/`).

[[server-cors]]`server.cors:`:: *Default: `false`* Set to `true` to enable CORS support. This setting is required to configure `server.cors.origin`.

`server.cors.origin:`:: *Default: none* Specifies origins. "origin" must be an array. To use this setting, you must set `server.cors` to `true`. To accept all origins, use `server.cors.origin: ["*"]`.

`server.customResponseHeaders:`:: *Default: `{}`* Header names and values to
send on all responses to the client from the Kibana server.

Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ data to UI frameworks and provides methods for the direct translation.

Here is the public API exposed by this engine:

- `addMessages(messages: Map<string, string>, [locale: string])` - provides a way to register
- `addTranslation(newTranslation: Translation, [locale: string])` - provides a way to register
translations with the engine
- `getMessages()` - returns messages for the current language
- `getTranslation()` - returns messages for the current language
- `setLocale(locale: string)` - tells the engine which language to use by given
language key
- `getLocale()` - returns the current locale
Expand All @@ -78,6 +78,7 @@ For the detailed explanation, see the section below
translate message by id. `description` is optional context comment that will be extracted
by i18n tools and added as a comment next to translation message at `defaultMessages.json`.
- `init(messages: Map<string, string>)` - initializes the engine
- `load(translationsUrl: string)` - loads JSON with translations from the specified URL and initializes i18n engine with them.

#### I18n engine internals

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/src/failed_tests_reporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To fetch some JUnit reports from a recent build on CI, visit its `Google Cloud S
copy(`wget "${Array.from($$('a[href$=".xml"]')).filter(a => a.innerText === 'Download').map(a => a.href.replace('https://storage.cloud.google.com/', 'https://storage.googleapis.com/')).join('" "')}"`)
```

This copies a script to download the reporets, which can be executed in the `test/junit` directory.
This copies a script to download the reports, which you should execute in the `test/junit` directory.

Next, run the CLI in `--dry-run` mode so that it doesn't actually communicate with Github.

Expand Down
69 changes: 48 additions & 21 deletions packages/kbn-test/src/failed_tests_reporter/github_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,41 +61,68 @@ export class GithubApi {
}
}

async getAllFailedTestIssues() {
this.log.info('Fetching failed-test issues');
const issues: GithubIssue[] = [];
let nextRequest: RequestOptions = {
private failedTestIssuesPageCache: {
pages: GithubIssue[][];
nextRequest: RequestOptions | undefined;
} = {
pages: [],
nextRequest: {
safeForDryRun: true,
method: 'GET',
url: Url.resolve(BASE_URL, 'issues'),
params: {
state: 'all',
per_page: '100',
labels: 'failed-test',
sort: 'updated',
direction: 'desc',
},
};

while (true) {
const resp = await this.request<GithubIssue[]>(nextRequest, []);
},
};

for (const issue of resp.data) {
issues.push(issue);
/**
* Iterate the `failed-test` issues from elastic/kibana, each response
* from Github is cached and subsequent calls to this method will first
* iterate the previous responses from Github, then start requesting
* more pages of issues from github until all pages have been cached.
*
* Aborting the iterator part way through will prevent unnecessary request
* to Github from being issued.
*/
async *iterateCachedFailedTestIssues() {
const cache = this.failedTestIssuesPageCache;

// start from page 0, and progress forward if we have cache or a request that will load that cache page
for (let page = 0; page < cache.pages.length || cache.nextRequest; page++) {
if (page >= cache.pages.length && cache.nextRequest) {
const resp = await this.request<GithubIssue[]>(cache.nextRequest, []);
cache.pages.push(resp.data);

const link =
typeof resp.headers.link === 'string' ? parseLinkHeader(resp.headers.link) : undefined;

cache.nextRequest =
link && link.next && link.next.url
? {
safeForDryRun: true,
method: 'GET',
url: link.next.url,
}
: undefined;
}

const parsed =
typeof resp.headers.link === 'string' ? parseLinkHeader(resp.headers.link) : undefined;
if (parsed && parsed.next && parsed.next.url) {
nextRequest = {
safeForDryRun: true,
method: 'GET',
url: parsed.next.url,
};
} else {
break;
for (const issue of cache.pages[page]) {
yield issue;
}
}
}

return issues;
async findFailedTestIssue(test: (issue: GithubIssue) => boolean) {
for await (const issue of this.iterateCachedFailedTestIssues()) {
if (test(issue)) {
return issue;
}
}
}

async editIssueBodyAndEnsureOpen(issueNumber: number, newBody: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ export function runFailedTestsReporterCli() {
}

const githubApi = new GithubApi(log, process.env.GITHUB_TOKEN, dryRun);
const issues = await githubApi.getAllFailedTestIssues();
const reportPaths = await globby(['target/junit/**/*.xml'], {
cwd: REPO_ROOT,
absolute: true,
});

for (const reportPath of reportPaths) {
for (const failure of await getFailures(log, reportPath)) {
const existingIssue = issues.find(
const existingIssue = await githubApi.findFailedTestIssue(
i =>
getIssueMetadata(i.body, 'test.class') === failure.classname &&
getIssueMetadata(i.body, 'test.name') === failure.name
Expand Down
10 changes: 10 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'renovate:major',
],
},
separateMajorMinor: false,
masterIssue: true,
masterIssueApproval: true,
rangeStrategy: 'bump',
Expand Down Expand Up @@ -77,6 +78,7 @@
reviewers: [
'markov00',
],
masterIssueApproval: false,
},
{
groupSlug: 'mocha',
Expand Down Expand Up @@ -623,6 +625,14 @@
'@types/zen-observable',
],
},
{
groupSlug: 'archiver',
groupName: 'archiver related packages',
packageNames: [
'archiver',
'@types/archiver',
],
},
{
groupSlug: 'base64-js',
groupName: 'base64-js related packages',
Expand Down
14 changes: 9 additions & 5 deletions src/dev/build/build_distributables.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function buildDistributables(options) {
const config = await getConfig({
isRelease,
versionQualifier,
targetAllPlatforms
targetAllPlatforms,
});

const run = createRunner({
Expand Down Expand Up @@ -143,16 +143,20 @@ export async function buildDistributables(options) {
* package platform-specific builds into archives
* or os-specific packages in the target directory
*/
if (createArchives) { // control w/ --skip-archives
if (createArchives) {
// control w/ --skip-archives
await run(CreateArchivesTask);
}
if (createDebPackage) { // control w/ --deb or --skip-os-packages
if (createDebPackage) {
// control w/ --deb or --skip-os-packages
await run(CreateDebPackageTask);
}
if (createRpmPackage) { // control w/ --rpm or --skip-os-packages
if (createRpmPackage) {
// control w/ --rpm or --skip-os-packages
await run(CreateRpmPackageTask);
}
if (createDockerPackage) { // control w/ --docker or --skip-os-packages
if (createDockerPackage) {
// control w/ --docker or --skip-os-packages
await run(CreateDockerPackageTask);
}

Expand Down
Loading

0 comments on commit c926c7e

Please sign in to comment.