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

Schema gen #10336

Merged
merged 7 commits into from
Jun 17, 2019
Merged

Schema gen #10336

merged 7 commits into from
Jun 17, 2019

Conversation

SimonRichardson
Copy link
Member

Description of change

In order to provide a clean workflow for python-libjuju (pylibjuju), we
need to find a way to create a schema (JSON) for pylibjuju so that
when generating the new set of client definitions in pylibjuju we're not
required to jump through hoops at updating and change schemagen.

Schemagen tags juju at a given hash, which means recording all the
correct dependencies from juju along with pylibjuju as well. This isn't
trivial as we also need to work with different branches and can become
confusing when explain the setup.

Instead the work flow will be, juju will always contain a schema.json
and then when making pylibjuju we can just consume it.

QA steps

make rebuild-schema

Then run to verify:

./scripts/verify.sh

Note: this supersedes #10305

The following is the initial commit of the describe API. Currently
this uses the api server directly, future PRs will remove this
dependency and instead talk directly to the controller.
The following generates the schema on build, this ensures that the
schema is always is up to date for all potential clients
The following removes the describe-api command. Instead we ensure
that there is a json file in apiserver/facades/schema.json that
represents the current schema of the api server facades.

This file can then be used for pylibjuju to render the client at
any point.

Included in is the ability to verify the schema is up to date and
if they're not, to error out and show the developer what to do.
The following changes use the git to check the source, that way
we can know what they're pushing is in fact what they want to check.

We also now check against a tmp file so not to spoil the repo.
@SimonRichardson SimonRichardson changed the base branch from develop to 2.6 June 17, 2019 09:02
@SimonRichardson SimonRichardson mentioned this pull request Jun 17, 2019
Copy link
Member

@manadart manadart left a comment

Choose a reason for hiding this comment

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

Nicely done; QA all good.

@SimonRichardson
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit 26f0165 into juju:2.6 Jun 17, 2019
@SimonRichardson SimonRichardson deleted the schema-gen branch June 17, 2019 11:40
SimonRichardson added a commit to SimonRichardson/python-libjuju that referenced this pull request Jun 17, 2019
Schemagen is no longer required because Juju itself has incorporated
the schema generation into the workflow of Juju. This should make it
a lot easier to build upon pylibjuju if it's always up to date with
Juju.

Work to do this has already been completed, see:

 1. juju/juju#10336
 2. juju/juju#10338

This should support 2.6 and onwards. Older releases can be done
the old way, but it requires you to have schemagen installed in the
old positions. The error messages might be more cryptic because of
that.
@babbageclunk
Copy link
Contributor

Awesome! Love a 38kloc PR. :D

@babbageclunk
Copy link
Contributor

I tried to look at the output json and github told me to sod off.

jujubot added a commit to juju/python-libjuju that referenced this pull request Jun 18, 2019
#315

Schemagen is no longer required because Juju itself has incorporated
the schema generation into the workflow of Juju. This should make it
a lot easier to build upon pylibjuju if it's always up to date with
Juju.

Work to do this has already been completed, see:

 1. juju/juju#10336
 2. juju/juju#10338

This should support 2.6 and onwards. Older releases can be done
the old way, but it requires you to have schemagen installed in the
old positions. The error messages might be more cryptic because of
that.
jujubot added a commit that referenced this pull request Jun 18, 2019
#10338

## Description of change

This is a port forward of #10336 - with the **addition** of the required
`make rebuild-schema`.

## QA steps

Tests pass
jujubot added a commit that referenced this pull request Jun 19, 2019
#10352

## Description of change

Merge 2.6 forward to bring in:
- #10340 from hpidcock/1831682-k8s-bootstrap-errors
- #10347 from hpidcock/1832777-enable-ha-panic-fix
- #10332 from hpidcock/1832608-statefulset-servicename
- #10330 from ycliuhw/fix/podspec-cmd-args-parsing
- #10335 from babbageclunk/remove-saas-bug
- #10343 from hmlanigan/schema
- #10337 from SimonRichardson/missing-exit
- #10336 from SimonRichardson/schema-gen
- #10327 from manadart/2.6-cache-entity-copies
- #10328 from ycliuhw/fix/warn-message
- #10320 from hpidcock/1832608-statefulset-servicename
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