Skip to content

Commit

Permalink
Merge pull request #1160 from james-garner-canonical/2024-10/feat/rep…
Browse files Browse the repository at this point in the history
…lace-existing-w-client-only

#1160

#### Description

Moving towards the goal of having schemas and generated code in `python-libjuju` only for the latest supported Juju versions (`3.1.9`, `3.3.6`, `3.5.4`, `3.5.3`), and using client only schemas (see #1099), this PR replaces the existing `3.1.X` and `3.3.0` schemas with their client-only counterparts.

#### QA Steps

Tests pass, but is there anything else we should check here?
  • Loading branch information
jujubot authored Oct 16, 2024
2 parents 79aac2c + 002a284 commit 927dd12
Show file tree
Hide file tree
Showing 17 changed files with 41,961 additions and 227,040 deletions.
351 changes: 3 additions & 348 deletions juju/client/_client.py

Large diffs are not rendered by default.

13,165 changes: 693 additions & 12,472 deletions juju/client/_client1.py

Large diffs are not rendered by default.

2,297 changes: 0 additions & 2,297 deletions juju/client/_client11.py

Large diffs are not rendered by default.

6,393 changes: 0 additions & 6,393 deletions juju/client/_client18.py

This file was deleted.

4,491 changes: 0 additions & 4,491 deletions juju/client/_client19.py

Large diffs are not rendered by default.

6,754 changes: 398 additions & 6,356 deletions juju/client/_client2.py

Large diffs are not rendered by default.

3,299 changes: 548 additions & 2,751 deletions juju/client/_client3.py

Large diffs are not rendered by default.

2,978 changes: 411 additions & 2,567 deletions juju/client/_client4.py

Large diffs are not rendered by default.

564 changes: 0 additions & 564 deletions juju/client/_client5.py

Large diffs are not rendered by default.

1,175 changes: 0 additions & 1,175 deletions juju/client/_client7.py

Large diffs are not rendered by default.

28,508 changes: 8,308 additions & 20,200 deletions juju/client/_definitions.py

Large diffs are not rendered by default.

88 changes: 1 addition & 87 deletions juju/client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,126 +29,40 @@
# in future this will likely be generated automatically (perhaps at runtime)
client_facades = {
'Action': {'versions': [7]},
'ActionPruner': {'versions': [1]},
'Admin': {'versions': [3]},
'Agent': {'versions': [3]},
'AgentLifeFlag': {'versions': [1]},
'AgentTools': {'versions': [1]},
'AllModelWatcher': {'versions': [4]},
'AllWatcher': {'versions': [3]},
'Annotations': {'versions': [2]},
'Application': {'versions': [17, 18, 19]},
'Application': {'versions': [17, 19]},
'ApplicationOffers': {'versions': [4]},
'ApplicationScaler': {'versions': [1]},
'Backups': {'versions': [3]},
'Block': {'versions': [2]},
'Bundle': {'versions': [6]},
'CAASAdmission': {'versions': [1]},
'CAASAgent': {'versions': [2]},
'CAASApplication': {'versions': [1]},
'CAASApplicationProvisioner': {'versions': [1]},
'CAASFirewaller': {'versions': [1]},
'CAASFirewallerSidecar': {'versions': [1]},
'CAASModelConfigManager': {'versions': [1]},
'CAASModelOperator': {'versions': [1]},
'CAASOperator': {'versions': [1]},
'CAASOperatorProvisioner': {'versions': [1]},
'CAASOperatorUpgrader': {'versions': [1]},
'CAASUnitProvisioner': {'versions': [2]},
'CharmDownloader': {'versions': [1]},
'CharmRevisionUpdater': {'versions': [2]},
'Charms': {'versions': [6]},
'Cleaner': {'versions': [2]},
'Client': {'versions': [6, 7]},
'Cloud': {'versions': [7]},
'Controller': {'versions': [11]},
'CredentialManager': {'versions': [1]},
'CredentialValidator': {'versions': [2]},
'CrossController': {'versions': [1]},
'CrossModelRelations': {'versions': [2]},
'CrossModelSecrets': {'versions': [1]},
'Deployer': {'versions': [1]},
'DiskManager': {'versions': [2]},
'EntityWatcher': {'versions': [2]},
'EnvironUpgrader': {'versions': [1]},
'ExternalControllerUpdater': {'versions': [1]},
'FanConfigurer': {'versions': [1]},
'FilesystemAttachmentsWatcher': {'versions': [2]},
'FirewallRules': {'versions': [1]},
'Firewaller': {'versions': [7]},
'HighAvailability': {'versions': [2]},
'HostKeyReporter': {'versions': [1]},
'ImageMetadata': {'versions': [3]},
'ImageMetadataManager': {'versions': [1]},
'InstanceMutater': {'versions': [3]},
'InstancePoller': {'versions': [4]},
'KeyManager': {'versions': [1]},
'KeyUpdater': {'versions': [1]},
'LeadershipService': {'versions': [2]},
'LifeFlag': {'versions': [1]},
'LogForwarding': {'versions': [1]},
'Logger': {'versions': [1]},
'MachineActions': {'versions': [1]},
'MachineManager': {'versions': [10]},
'MachineUndertaker': {'versions': [1]},
'Machiner': {'versions': [5]},
'MeterStatus': {'versions': [2]},
'MetricsAdder': {'versions': [2]},
'MetricsDebug': {'versions': [2]},
'MetricsManager': {'versions': [1]},
'MigrationFlag': {'versions': [1]},
'MigrationMaster': {'versions': [3]},
'MigrationMinion': {'versions': [1]},
'MigrationStatusWatcher': {'versions': [1]},
'MigrationTarget': {'versions': [1, 2]},
'ModelConfig': {'versions': [3]},
'ModelGeneration': {'versions': [4]},
'ModelManager': {'versions': [9]},
'ModelSummaryWatcher': {'versions': [1]},
'ModelUpgrader': {'versions': [1]},
'NotifyWatcher': {'versions': [1]},
'OfferStatusWatcher': {'versions': [1]},
'Payloads': {'versions': [1]},
'PayloadsHookContext': {'versions': [1]},
'Pinger': {'versions': [1]},
'Provisioner': {'versions': [11]},
'ProxyUpdater': {'versions': [2]},
'RaftLease': {'versions': [2]},
'Reboot': {'versions': [2]},
'RelationStatusWatcher': {'versions': [1]},
'RelationUnitsWatcher': {'versions': [1]},
'RemoteRelationWatcher': {'versions': [1]},
'RemoteRelations': {'versions': [2]},
'Resources': {'versions': [3]},
'ResourcesHookContext': {'versions': [1]},
'RetryStrategy': {'versions': [1]},
'SSHClient': {'versions': [4]},
'SecretBackends': {'versions': [1]},
'SecretBackendsManager': {'versions': [1]},
'SecretBackendsRotateWatcher': {'versions': [1]},
'Secrets': {'versions': [1, 2]},
'SecretsDrain': {'versions': [1]},
'SecretsManager': {'versions': [1, 2]},
'SecretsRevisionWatcher': {'versions': [1]},
'SecretsTriggerWatcher': {'versions': [1]},
'Singular': {'versions': [2]},
'Spaces': {'versions': [6]},
'StatusHistory': {'versions': [2]},
'Storage': {'versions': [6]},
'StorageProvisioner': {'versions': [4]},
'StringsWatcher': {'versions': [1]},
'Subnets': {'versions': [5]},
'Undertaker': {'versions': [1]},
'UnitAssigner': {'versions': [1]},
'Uniter': {'versions': [18, 19]},
'UpgradeSeries': {'versions': [3]},
'UpgradeSteps': {'versions': [2]},
'Upgrader': {'versions': [1]},
'UserManager': {'versions': [3]},
'UserSecretsDrain': {'versions': [1]},
'UserSecretsManager': {'versions': [1]},
'VolumeAttachmentPlansWatcher': {'versions': [1]},
'VolumeAttachmentsWatcher': {'versions': [2]},
}


Expand Down
6 changes: 6 additions & 0 deletions juju/client/facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ def buildTypes(schema, capture):
for kind in sorted((k for k in schema.types if not isinstance(k, str)),
key=lambda x: str(x)):
name = schema.types[kind]
if not name:
# when running on juju 3.1.0 client-only schemas, we get a seemingly empty entry with no name
# this breaks codegen when generating a class with no name so we explicitly skip it here
# note that this is not a problem with the original 3.1.0 full schema (client + others)
# nor is it a problem with client-only schemas for latter juju versions (e.g. 3.3.0)
continue
if name in capture and name not in NAUGHTY_CLASSES:
continue
args = Args(schema, kind)
Expand Down
Loading

0 comments on commit 927dd12

Please sign in to comment.