Skip to content

metrics: configure secrets #279

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

Merged
merged 2 commits into from
Jun 25, 2024
Merged

metrics: configure secrets #279

merged 2 commits into from
Jun 25, 2024

Conversation

mtanzim
Copy link
Collaborator

@mtanzim mtanzim commented Jun 25, 2024

Thank you for contributing to the Cohere Toolkit!

  • PR title: "area: description"

    • Where "area" is whichever of interface, frontend, model, tools, backend, etc. is being modified. Use "docs: ..." for purely docs changes, "infra: ..." for CI changes.
    • Example: "deployment: add Azure model option"
  • PR message: Delete this entire checklist and replace with

    • Description: a description of the change
    • Issue: the issue # it fixes, if applicable
    • Dependencies: any dependencies required for this change
  • Add tests and docs: Please include testing and documentation for your changes

  • Lint and test: Run make lint and make run-tests

AI Description

This pull request updates the MetricsDataBase class in the module to include a new field, secret, which is assigned the value "secret". This change is reflected in both the src/backend/schemas/metrics.py and src/backend/services/metrics.py files.

Additionally, the following modifications are made:

  • The REPORT_SECRET environment variable is introduced in src/backend/services/metrics.py, retrieving its value via os.getenv.
  • In the report_metrics function, a check for REPORT_SECRET is added before verifying the signal type. If REPORT_SECRET is not set, an error message is logged, and the function returns early.
  • The hardcoded value assignment to data.secret is replaced with the use of the REPORT_SECRET environment variable in the wrap_and_log_data function.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@8559c24). Learn more about missing BASE report.

Files Patch % Lines
src/backend/services/metrics.py 28.57% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #279   +/-   ##
=======================================
  Coverage        ?   85.55%           
=======================================
  Files           ?      156           
  Lines           ?     5816           
  Branches        ?        0           
=======================================
  Hits            ?     4976           
  Misses          ?      840           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tanzimCohere tanzimCohere merged commit 487f01b into main Jun 25, 2024
2 checks passed
@tanzimCohere tanzimCohere deleted the tanzim/metrics-secrets branch June 25, 2024 14:36
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.

4 participants