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

feat: Create levels 110-122 #1509

Merged
merged 9 commits into from
Nov 1, 2023
Merged

feat: Create levels 110-122 #1509

merged 9 commits into from
Nov 1, 2023

Conversation

faucomte97
Copy link
Contributor

@faucomte97 faucomte97 commented Oct 31, 2023

This PR:

  • Adds in the data for levels 110-122, including path, origin, destination, level type, theme, decors and blocks.
  • Adds model_solution number for suitable levels.
  • Adds tests for all new levels.
  • Includes the new blocks in the path finder logic so they count towards the model solution number.

This change is Reviewable

@faucomte97 faucomte97 self-assigned this Oct 31, 2023
Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 9 files at r1, all commit messages.
Reviewable status: 4 of 9 files reviewed, all discussions resolved (waiting on @faucomte97)

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewable status: 4 of 9 files reviewed, 2 unresolved discussions (waiting on @faucomte97)


game/migrations/0086_loop_levels.py line 460 at r1 (raw file):

    Episode = apps.get_model("game", "Episode")

    for levelID in range(110, 154):

Don't pull these into memory. Do a bulk delete on the sql server instead.

Level.objects.filter(id__in=range(110, 154)).delete()


game/migrations/0086_loop_levels.py line 471 at r1 (raw file):

    Episode.objects.get(pk=14).delete()
    Episode.objects.get(pk=13).delete()
    Episode.objects.get(pk=12).delete()

bulk delete

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 9 files at r1.
Reviewable status: 5 of 9 files reviewed, 2 unresolved discussions (waiting on @faucomte97)

Copy link
Contributor Author

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 5 of 9 files reviewed, 2 unresolved discussions (waiting on @faucomte97 and @SKairinos)


game/migrations/0086_loop_levels.py line 460 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

Don't pull these into memory. Do a bulk delete on the sql server instead.

Level.objects.filter(id__in=range(110, 154)).delete()

Done.


game/migrations/0086_loop_levels.py line 471 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

bulk delete

Done.

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 5 of 9 files reviewed, 1 unresolved discussion (waiting on @faucomte97)


game/migrations/0086_loop_levels.py line 460 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Done.

Have you tested this? Does it not break because episode_109 has a FK to episode_110?


game/migrations/0086_loop_levels.py line 471 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Done.

Have you tested this? Does it not break because episode_11 has a FK to episode_12?

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 9 files at r1, 1 of 1 files at r2.
Reviewable status: 7 of 9 files reviewed, 1 unresolved discussion (waiting on @faucomte97)

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 9 files at r1.
Reviewable status: 8 of 9 files reviewed, 2 unresolved discussions (waiting on @faucomte97)


game/static/game/js/blocklyControl.js line 327 at r2 (raw file):

      n += count(conditionBlock);
    } else if (block.type === "variables_get" || block.type === "math_number") {
      n++

validate that parent is directly or indirectly connected to start block

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 9 files reviewed, 3 unresolved discussions (waiting on @faucomte97)


game/static/game/js/blocklyControl.js line 324 at r2 (raw file):

      n += count(nextBlock);
    } else if (block.type === "logic_negate" || block.type === "logic_compare") {
      var conditionBlock = block.inputList[0].connection.targetBlock();

validate that children are connected to start block

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 9 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)


game/migrations/0086_loop_levels.py line 471 at r1 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…

Have you tested this? Does it not break because episode_11 has a FK to episode_12?

must do

Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Merging #1509 (210f854) into master (7246232) will decrease coverage by 0.08%.
The diff coverage is 89.01%.

❗ Current head 210f854 differs from pull request most recent head f6bd86e. Consider uploading reports for the commit f6bd86e to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1509      +/-   ##
==========================================
- Coverage   91.66%   91.58%   -0.08%     
==========================================
  Files         110      110              
  Lines        5793     5870      +77     
==========================================
+ Hits         5310     5376      +66     
- Misses        483      494      +11     
Files Coverage Δ
game/admin.py 100.00% <100.00%> (ø)
game/end_to_end_tests/test_play_through.py 98.93% <100.00%> (+0.11%) ⬆️
game/messages.py 99.06% <ø> (ø)
game/urls.py 100.00% <ø> (ø)
game/views/level.py 73.27% <100.00%> (-0.13%) ⬇️
game/views/level_solutions.py 100.00% <100.00%> (ø)
game/migrations/0086_loop_levels.py 90.09% <74.35%> (-9.91%) ⬇️

... and 1 file with indirect coverage changes

Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)

@faucomte97 faucomte97 merged commit 8b8d572 into master Nov 1, 2023
3 checks passed
@faucomte97 faucomte97 deleted the while_loop_levels branch November 1, 2023 14:02
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.

2 participants