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

Investigate empty name in code generation with client-only schemas for Juju 3.1.0 #1161

Open
james-garner-canonical opened this issue Oct 16, 2024 · 0 comments
Labels
area/schema-changes Updates the Juju API schema hint/3.x going on main branch priority/low low priority

Comments

@james-garner-canonical
Copy link
Contributor

Description

#1160 will introduce a small change to codegen in facade.py, skipping items with an empty name. This is only an issue when using client-only schemas for older Juju versions like 3.1.0. Newer versions don't have the problem. Juju 3.1.0 full (not client-only) schema doesn't have this problem. It would be worthwhile to investigate why this happens.

See: #1160 (comment)

There don't appear to be any missing facades, so it's not that a facade isn't being populated properly. There don't seem to be any empty entries in the schema json either. So it appears to be a bug in codegen itself, maybe getting a key that isn't there and leaving a template filled with default values?

Investigating this could be a good opportunity to type annotate facade.py if that's helpful when tracing the flow of execution for code generation.

Urgency

Casually reporting

Python-libjuju version

main

Juju version

3.1.0 schema (client-only)

Reproduce / Test

# Look for `if not name` in `facade.py`. You can remove this check and run with client-only 3.1.0 schema to get a crash when it tries to make a class without a name, or catch the bad case here for further investigation.
@james-garner-canonical james-garner-canonical added kind/bug indicates a bug in the project hint/3.x going on main branch priority/normal normal priority area/schema-changes Updates the Juju API schema labels Oct 16, 2024
@james-garner-canonical james-garner-canonical removed their assignment Nov 7, 2024
@james-garner-canonical james-garner-canonical added priority/low low priority and removed kind/bug indicates a bug in the project priority/normal normal priority labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema-changes Updates the Juju API schema hint/3.x going on main branch priority/low low priority
Projects
None yet
Development

No branches or pull requests

1 participant