-
Notifications
You must be signed in to change notification settings - Fork 14
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
DO NOT MERGE: Review PR for ProjectService and Pytest plugin #672
base: main
Are you sure you want to change the base?
Conversation
This adds a pytest plugin for craft-application, including the fixtures: 1. debug_mode: This fixture puts the app into debug mode by default. 2. production_mode: Overrides debug_mode for a function. This is a breaking change because debug_mode is an auto-used fixture, meaning any tests that rely on production mode will break.
…655) This modifies the fake_host_architecture fixture in the pytest plugin so it makes craft_parts also think it's running on that machine.
Removes the ability to use secrets. This can be added to applications if necessary using the prototype secrets service.
This makes the ServiceFactory no longer a dataclass. It's only a dataclass for historical reasons around the old way of registering services, but this is no longer necessary.
This moves set_kwargs() from pending deprecation to deprecated. It doesn't change any behaviour other than the type of warning that it raises.
This adds the project service and makes the relevant changes to the rest of the application to handle it. Some tests have been disabled because of necessary future changes before we can merge this feature branch.
This adds a BuildPlanService that creates build plans for crafts.
These were deprecated, so we can remove them.
This creates partitioncraft, a very basic craft app that uses partitions.
…ft (#674) This modifies the ProjectService so that it will work for Imagecraft. Most specifically, it adds a get_partitions_for method that is a generic partition generator and changes the prime project's partitions to a property. Co-authored-by: Upils <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving this review as a comment, since more pages are planned.
I don't feel qualified to review the docstrings, so I left them as-is.
- A new :doc:`services/project` now handles the creation and management of the project | ||
for this run of the application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this run
Looking at this sentence in isolation, I'm not quite sure what this means. I might be missing something obvious?
- Setting the arguments for a service using the service factory's ``set_kwargs`` is | ||
deprecated. Use ``update_kwargs`` instead or file `an issue | ||
<https://github.com/canonical/craft-application/issues/new?template=bug.yaml>`_ | ||
if you still need this method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to be clearer about our intent here. If this is an experimental change that is subject to change from feedback, I think we should state that plainly.
Testing | ||
======= | ||
|
||
- A new :doc:`pytest-plugin` with a fixture that enables production mode for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- A new :doc:`pytest-plugin` with a fixture that enables production mode for the | |
- Added a new :doc:`pytest-plugin` with a fixture that enables production mode for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting here that we're using past tense in this changelog, unlike the product changelogs.
Services | ||
======== | ||
|
||
- A new :doc:`services/project` now handles the creation and management of the project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit iffy on the way we're stating this, since (I believe) we're replacing a class with a service with the same name. Will that have an effect on how it's instantiated?
~~~~~~~~~~~~~~~~ | ||
|
||
At this step, any user-added grammar is validated using | ||
:external+craft-grammar:doc:`Craft Grammar <index>`. No grammar is applied yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applied
Later we use "processed". Same idea?
during the application-specific transforms step, meaning that transforms may add | ||
grammar-aware syntax if needed. | ||
|
||
Validate Pydantic model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate Pydantic model | |
Validate the Pydantic model |
craft-application includes a `pytest`_ plugin to help ease the testing of apps that use | ||
it as a framework. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
craft-application includes a `pytest`_ plugin to help ease the testing of apps that use | |
it as a framework. | |
The pytest plugin makes testing apps that use `pytest`_ easier. |
Auto-used fixtures | ||
~~~~~~~~~~~~~~~~~~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this an H2.
~~~~~~~~~~~~~~~~~~ | ||
|
||
Some fixtures are automatically enabled for tests, changing the default behaviour of | ||
applications during the testing process. This is kept to a minimum, but is done when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applications during the testing process. This is kept to a minimum, but is done when | |
applications during the testing process. Fixtures generally only change behaviour when |
This PR is for reviewing documentation on the hybrid-commands feature branch. Fixes should be collected into another PR.
Stuff to review here:
ProjectService
(rST source, python source)There will be more later, but this is what's currently on that feature branch.
CRAFT-4305