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

[task_panels] Add params with kibana url and version to create the .kibana #80

Merged
merged 2 commits into from
Jan 29, 2018

Conversation

acs
Copy link
Member

@acs acs commented Jan 26, 2018

No description provided.

@acs acs requested a review from jgbarah January 26, 2018 22:17
Copy link
Contributor

@jgbarah jgbarah left a comment

Choose a reason for hiding this comment

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

Please, have a look at my comments. If you consider them appropriate, please submit a new commit. If not, let me know. I think I could leave without them being addressed ;-)

"kbn-version": self.conf['panels']['kibiter_version']
}

res = requests.post(k6_init_url, headers=k6_init_headers,
Copy link
Contributor

Choose a reason for hiding this comment

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

If you extend the exception handle to cover this call to requests.post, it will catch also the case when the "name or service not found" error happens. Do you think that's worthwhile?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, good point. My fault not to include the POST call in the try. This is why it was failing to you. Changed!

@@ -247,6 +247,16 @@ def general_params(cls):
"optional": True,
"default": "git",
"type": str
},
"kibiter_url": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it better to have a new section for Kibiter, and have these two new options in it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that probably we need to change the panel section name with kibiter name. All the params in the panelsection are related to kibiter. But this change breaks all current config files so I prefer to do it once the platform is more stable without so many changes. This is why I have added those new params to the panelsection.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, now I understand. Looking at the parameters, they are more like parameters of the dashboard than parameters of the service (in the sense that to produce the same dashboard on a different deployment, those parameters wouldn't change). That´s why I still see a reason for having a separate kibiter section.

But I see your point. So, you decide. If you prefer, keep it like it is now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I prefer to maintain to keep as it is now and in a next iteration rename the full section to Kibiter. So I think we are ready to merge this PR? l let that you do it! Thanks @jgbarah

ES6_KIBANA_INIT_DATA = '{"value": "*"}'
# We need the version before the .kibana exists so we can not find it
ES6_KIBANA_VERSION = "6.1.0-1"
ES6_KIBANA_INIT_HEADERS = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather keep this constant, to easy the code below (and spare the variable k6_init_headers, and its assignment on the fly).

Copy link
Member Author

Choose a reason for hiding this comment

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

So the only global constant is then ES6_KIBANA_INIT_DATA because ES6_KIBANA_VERSION is now defined in mordred config. I have left then:

ES6_KIBANA_INIT_DATA = '{"value": "*"}'
ES6_KIBANA_INIT_URL_PATH = "/api/kibana/settings/indexPattern:placeholder"

Copy link
Contributor

Choose a reason for hiding this comment

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

I was referring mainly to ES_KIBANA_INIT_HEADERS, sorry for not being clear enough.

Copy link
Member Author

@acs acs Jan 27, 2018

Choose a reason for hiding this comment

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

You can not define this as a global constant because it depends of the version that is a variable defined in mordred config (self.conf['panels']['kibiter_version']), and it is not available when this global variable will be defined.

The headers could be defined partially globally:

ES_KIBITER_INIT_HEADERS = {
                    "Accept": "application/json",
                    "Content-Type": "application/json",
                    "kbn-version": None
}

and later, complete it with the kbn-version value but it does not make sense IMHO (I found it too complex).

Copy link
Contributor

Choose a reason for hiding this comment

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

I was meaning something like you say, but I agree it is a bit weird. So, if you prefer, let's keep it as it is now.

@acs
Copy link
Member Author

acs commented Jan 27, 2018

@jgb all your comments addressed. Could you review them? Thanks!

@jgbarah
Copy link
Contributor

jgbarah commented Jan 29, 2018

OK. I'll open a ticket about the section name to propose opening a kibiter section.

But now, it seems there are conflicts, maybe due to your latest commits. Would you mind rebasing?

Alvaro del Castillo added 2 commits January 29, 2018 12:10
…index

Use global constants to define the Kibiter URL to create the .kibana index.
Manage the exception if the URL call fails.
@acs
Copy link
Member Author

acs commented Jan 29, 2018

Rebase completed. Could you then merge the PR? Thanks!

Copy link
Contributor

@jgbarah jgbarah 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 all your changes!

@jgbarah jgbarah merged commit 63e068b into chaoss:master Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants