Skip to content

feat: Add values json schema#1110

Merged
dan-fernandes merged 60 commits intomainfrom
add-values-json-schema
Aug 20, 2025
Merged

feat: Add values json schema#1110
dan-fernandes merged 60 commits intomainfrom
add-values-json-schema

Conversation

@dan-fernandes
Copy link
Copy Markdown
Contributor

Fixed #1095

@dan-fernandes dan-fernandes requested a review from a team as a code owner July 8, 2025 09:16
@dan-fernandes dan-fernandes changed the title Add values json schema feat: Add values json schema Jul 8, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.52%. Comparing base (6eca7b8) to head (9be1fd7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1110      +/-   ##
==========================================
+ Coverage   94.49%   94.52%   +0.02%     
==========================================
  Files          41       41              
  Lines        2544     2557      +13     
==========================================
+ Hits         2404     2417      +13     
  Misses        140      140              

☔ 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.

Comment thread .github/workflows/_test.yml Outdated
Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml Outdated
Comment thread src/blueapi/cli/cli.py
Comment on lines +129 to +133
with output.open("w") as stream:
json.dump(schema, stream, indent=4)
stream.write("\n")
else:
print(json.dumps(schema))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
with output.open("w") as stream:
json.dump(schema, stream, indent=4)
stream.write("\n")
else:
print(json.dumps(schema))
with output.open("w") as stream:
write_schema_as_yaml(output, schema)
else:
print_schema_as_yaml(schema)

Can we re-use these functions from schema or do we need to write explicitly json? Yaml is a superset of Json, so if the Helm schema plugin can support yaml we could pass both as yaml - or if it doesn't, handle both as json and the api_schema handling should be OK.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we do, should then move them from openapi.py to cli.py and make them private?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not convinced of the benefits that this change will bring. While YAML is a superset, is there anything wrong with being more specific about the language you're using?

I am open to the fact I may be wrong.

What I would consider is moving the json commands I've written into their own write_schema_as_json equivalent?

Comment thread tests/unit_tests/test_cli.py Outdated
Comment thread .github/workflows/_test.yml Outdated
Comment thread tests/unit_tests/test_cli.py
Comment thread tests/unit_tests/test_cli.py Outdated
Comment thread tests/unit_tests/test_config.py Outdated
Comment thread helm/blueapi/.schema.yaml
Comment thread .github/workflows/_test.yml Outdated
@dan-fernandes dan-fernandes merged commit 08334bc into main Aug 20, 2025
17 checks passed
@dan-fernandes dan-fernandes deleted the add-values-json-schema branch August 20, 2025 12:58
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.

No values.schema.json

2 participants