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

Propagate TheHive deprecation warnings #378

Open
JuanTecedor opened this issue Jan 6, 2025 · 2 comments
Open

Propagate TheHive deprecation warnings #378

JuanTecedor opened this issue Jan 6, 2025 · 2 comments

Comments

@JuanTecedor
Copy link

After working in "Fix deprecations in the query filters" (issue, PR), it'd be nice to propagate the TheHive deprecation warnings to TheHive4py, so that they could be more easily detected. I'm thinking of using the pytest_sessionfinish hook:

tests/utils.py

def propagate_thehive_warnings(container_name: str):
    output_lines = subprocess.run(
        shlex.split(f"docker logs {container_name}"),
        capture_output=True,
        text=True
    ).stdout.lower().splitlines()
    for output_line in output_lines:
        if "deprecated" in output_line:
            warnings.warn(output_line)

tests/conftest.py

def pytest_sessionfinish(session, exitstatus):
    propagate_thehive_warnings(CONTAINER_NAME)

Thoughts?

@Kamforka
Copy link
Collaborator

Kamforka commented Jan 7, 2025

Interesting idea, but I don't think that the internal logs of TheHive should be the concern of thehive4py, I believe we should stop at the API level.

@JuanTecedor
Copy link
Author

You're right that this falls outside the scope of TheHive4py's responsibilities.

Also, the deprecation checks are likely only relevant when the TheHive image tag is updated.

Feel free to close this issue

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

No branches or pull requests

2 participants