Skip to content

Conversation

@ryan-pratt
Copy link
Contributor

If you only pass three values (like the example in our docs), Ruby unpacks nil but Python throws ValueError: not enough values to unpack (expected 4, got 3)

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.18%. Comparing base (6ba6927) to head (3a6cf8a).

Files with missing lines Patch % Lines
openc3/lib/openc3/utilities/secrets.rb 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2736      +/-   ##
==========================================
- Coverage   79.19%   79.18%   -0.02%     
==========================================
  Files         670      670              
  Lines       54253    54259       +6     
  Branches      734      734              
==========================================
- Hits        42967    42964       -3     
- Misses      11206    11215       +9     
  Partials       80       80              
Flag Coverage Δ
python 81.00% <ø> (-0.02%) ⬇️
ruby-api 83.61% <ø> (-0.05%) ⬇️
ruby-backend 82.20% <25.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


def setup(self, secrets):
for type, key, data, secret_store in secrets:
for type, key, data, *extra in secrets:
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we also check that they array has at least 3 elements as well? If secrets is [1,2] it will raise ValueError: not enough values to unpack (expected at least 3, got 2)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be an invalid config. Shouldn't we error in that case?

Copy link
Member

Choose a reason for hiding this comment

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

How do these secrets get set? As long as it is validated when it is set then there can only be 3 or 4 items. I'm just not sure where or if this validation is occuring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They come from the microservice config. I don't see checks earlier in the microservice initialization logic than here, so I'm adding a check here

@jmthomas jmthomas self-requested a review January 17, 2026 16:46
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