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

feat: enable to source customHeaders from the config file #1339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

muscionig
Copy link
Contributor

📑 Description

This PR introduces the ability to read custom headers directly from the configuration file. The existing behavior is preserved: custom headers passed via the CLI are appended to those specified in the configuration file, which can be left empty.

Upon reviewing the source code, I noticed that customHeaders are sometimes "blanked" to prevent exposing sensitive data.

// we blank out the custom headers for data protection reasons
This likely explains why the initial implementation did not support reading customHeaders from the configuration file. However, this limitation prevents the operator from leveraging customHeaders in configurations.

This PR addresses the issue by enabling customHeaders to be defined in the configuration file, making it more flexible and useful for the operator.

Please confirm if my understanding aligns with the intended behavior, and let me know if you would prefer I open an issue for tracking this change. Also, I noticed the documentation has a section regarding customHeaders, I'll be happy to update that one as well if this change is acceptable.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Here is an example of writing the headers in the configuration file:

ai:
    providers:
        - name: openai
          ...
          customHeaders:
            - Header-1: value-header-1
            - Header-2: value-header-2
    defaultprovider: openai
kubeconfig: ""
kubecontext: ""

@muscionig muscionig requested review from a team as code owners December 3, 2024 06:55
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 34.14%. Comparing base (173e4dc) to head (8ec2db0).
Report is 39 commits behind head on main.

Files with missing lines Patch % Lines
pkg/analysis/analysis.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1339      +/-   ##
==========================================
- Coverage   34.76%   34.14%   -0.62%     
==========================================
  Files          94       97       +3     
  Lines        6342     6495     +153     
==========================================
+ Hits         2205     2218      +13     
- Misses       4046     4185     +139     
- Partials       91       92       +1     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Proposed
Development

Successfully merging this pull request may close these issues.

1 participant