✨(backend) add --owned-batch-orders option to create_dev_data#1331
Open
kernicPanel wants to merge 3 commits intobatch-orders-v2from
Open
✨(backend) add --owned-batch-orders option to create_dev_data#1331kernicPanel wants to merge 3 commits intobatch-orders-v2from
kernicPanel wants to merge 3 commits intobatch-orders-v2from
Conversation
Allows assigning batch orders to user10, the default user used to connect on Richie. Disabled by default to keep the dev-data command fast when this fixture is not needed.
Using the GNU make `--` convention stops make from parsing trailing
flags as its own options, letting us write:
make dev-data -- --owned-batch-orders --credential
instead of the awkward ARGS="..." form.
There was a problem hiding this comment.
Pull request overview
This PR improves the dev dataset generation workflow by making it possible to generate batch orders explicitly owned by Richie’s default user (user10), and by making it easier to forward flags to the create_dev_data Django management command from make dev-data.
Changes:
- Add an
owned_batch_orderstoggle toDemo.generate_simple, including an interactive menu entry. - Expose the toggle as
--owned-batch-orderson thecreate_dev_datamanagement command. - Rework the
dev-dataMakefile target to forward extra CLI tokens tocreate_dev_data.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/backend/joanie/tests/testing_utils.py |
Adds an owned_batch_orders flag and gates creation/assignment of the user10 batch-order owner and related order ownership updates. |
src/backend/joanie/demo/management/commands/create_dev_data.py |
Adds the --owned-batch-orders CLI flag and forwards it into Demo.generate_simple. |
Makefile |
Introduces argument forwarding from make dev-data … to manage.py create_dev_data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
When running
make dev-data, batch orders are created without an explicitowner, which makes it impossible to exercise the "owned batch orders" flow
as the user connected on Richie (user10). The code to wire user10 onto
batch orders existed but was commented out, so there was no way to opt in.
On top of that,
make dev-datarequired the awkwardARGS="--credential"form to forward flags tocreate_dev_data, whichhurt discoverability when stacking multiple flags.
Proposal
user10batch-order owner fixture ingenerate_simpleand gate it behind a new
owned_batch_ordersflag (disabled bydefault). The flag also surfaces in the interactive
select_multiplemenu as "Owned batch orders".
--owned-batch-orderson thecreate_dev_datamanagement command.dev-dataMakefile target so flags after--areforwarded to
create_dev_data, enabling:make dev-data -- --owned-batch-orders --credential