feat/add-popular-tasks - #1708
Conversation
…/loco into feat/add-popular-tasks
|
Hi @kaplanelad, I refactored the code and fixed the remaining issues. |
|
Hi @kaplanelad, is it ok like this? |
looks better. thanks. |
|
Hi @kaplanelad, just a quick heads-up: the CI is now passing and all tests are running successfully. Thank you! |
|
How group related to delete user task? |
|
The otherwise the test fails with the following error: That's why I had to add the this seems to be caused by the following test: |
|
From where the group came from? |
That also caught my attention 🙂 I didn’t intentionally introduce groups on my side. From what I could tell, the groups table is implicitly required by the ActiveModel::delete implementation. When the table is missing, the delete call fails at runtime, which is what caused the test to break. I traced this back to the CreateJoinTableUsersAndGroups migration generated in the test. That seems to be where the dependency comes from, even though groups itself isn’t created explicitly beforehand. The migration was added purely to make the test pass and avoid the runtime error — happy to change this if there’s a more intended approach 👍 |
|
Please clarify where the groups migration comes from specifically, explain that ActiveModelTrait::delete requires all related tables to exist. this is not clear to me Also, please remove the commented-out test code in new.rs not sure if why it commended |
|
Hi @kaplanelad, sorry for the delay. It looks like the tester.run_generate_migration(&vec!["CreateJoinTableUsersAndGroups", "count:int"]);Inside let base_command = vec!["loco", "generate", "migration"];and then extended with From what I can see, creating a user in the wizard task works without issues. However, when the user is deleted, the presence of the One possible explanation could also be related to how the ORM handles relations. Creating a user only inserts into the Please let me know if I might be misunderstanding something here. Best regards! |
Verified 4 triage PRs + onboarding-cluster issues against the branch: 5 fixed-in-1.0.0 (#1758/#1749, #1770/#1759, #1768, #1729), #1755 was a real bug (fixed 47d0391), #1708 defer, #1771 partial-adopt (11ce376). Finished reply drafts in RELEASE-1.0.0-verification-replies.md. Green gate updated to run loco-gen --all-features (default features masked stale int→i64 snapshots).
|
Hi @floscodes — thanks for sticking with this. |
The generated app never needed a `groups` table: users::Model has no relation to it, and the user:delete task test doesn't reference it either. The real dependency came from the pre-existing wizard-test step generating a CreateJoinTableUsersAndGroups migration, whose FK reference to a non-existent `groups` table failed at migrate time - unrelated to user:delete. Point that step at `movies` instead, which already exists by then, and revert the groups migration added to base_template as a workaround. Also restore the run_test() assertion after project generation instead of the println! that was silently swallowing failures.
|
Hi, @jondot, thanks for the detailed feedback — you were right to push back, and I found the actual root cause.
I've pushed a fix that:
So |
This PR adds a user deletion functionality to popular tasks.