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

Update new elastic search request #105

Closed
wants to merge 5 commits into from
Closed

Update new elastic search request #105

wants to merge 5 commits into from

Conversation

sarathbrp
Copy link
Contributor

  1. Added verification is set to False since new elastic search uses https
  2. And while making requests it uses authentication header where it fetches key from Jenkins pipeline

@sarathbrp sarathbrp requested a review from jhutar January 10, 2024 22:59
@sarathbrp sarathbrp self-assigned this Jan 10, 2024
@@ -6,7 +6,7 @@


session = requests.Session()

session.verify=False
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello Sarath. This is a generic library. Do not do changes like this here.


import opl.http
import opl.status_data

# Environment variables for OpenSearch credentials
open_search_username = "insights_perf"
Copy link
Contributor

@jhutar jhutar Jan 11, 2024

Choose a reason for hiding this comment

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

Please do not hardcode stuff here. This should come from investigator config.


import opl.http
import opl.status_data

# Environment variables for OpenSearch credentials
open_search_username = "insights_perf"
open_search_password = os.environ.get('OPEN_SEARCH_PASSWORD')
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 add name of the variable to investigator config just to force user to understand it is needed.

@@ -21,7 +26,7 @@ def load(server, index, query, paths):
f"Querying ES with url={url}, headers={headers} and json={json.dumps(data)}"
)

response = opl.http.get(url, headers=headers, json=data)
response = opl.http.get(url, auth=HTTPBasicAuth(open_search_username, open_search_password), headers=headers, json=data)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not backwards compatible. We will not be able to migrate all our tests at one moment. We need the change that will not break current setup.

@sarathbrp sarathbrp closed this Jan 11, 2024
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.

2 participants