feat(timetable): take the current timetable into a scenario, scored like a generated one - #796
Merged
Merged
Conversation
…er day and room use
…oft, on the week grid
…wish, in time-boxed background steps
…ike a generated one
Contributor
Quality Report — ConductionNL/planninq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| check-l10n-js | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| composer | ✅ | ✅ 107/107 | |||
| npm | ✅ | ✅ 646/646 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ❌ | ||||
| Newman | ❌ | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it on any branch from the Actions tab, or locally with npx playwright test. |
||||
| Hydra gates | ✅ |
Quality workflow — 2026-09-30 05:54 UTC
Download the full PDF report from the workflow artifacts.
This was referenced Sep 30, 2026
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.
Timetable generator, section 6: take the current timetable into a scenario
Base: development (19711e0). Sits on #795 (section 5, the solver), which sits on #794, #793 and #791. Merge in that order, or merge this PR with a merge commit to land all five.
Change:
timetabling-generator(DECISIONS rows 17 and 21), section 6 of 9 (task 6.1). The change stays open;tt-scenario-comparemoves to built with section 7.What the user can now do
An admin creates a scenario with source "imported" and a week (
weekOf), opens it and presses "Take the current timetable". The scheduled lessons of that week become the scenario's lessons and placements, scored with the same scorer as a generated run. The page then shows how many lessons have a place, the lessons whose times are not a period of the week grid ("Not on a period of the week grid"), and, for an imported timetable only, a "Broken hard wishes" list: a breach is counted and shown, not hidden.How
lib/Service/TimetableScenarioImporter.php: reads the scheduledtimetableSessionrows of the scenario's week, keys each lessongroup:subject:nlike the input builder, maps its start and end to a period key and a length on the grid (TimetableGridService::periodTimes(), new), scores the week withTimetableScorer, and stores the scenariodonewithinput,placements,unplaced,brokenWishesandmetrics. A generated or published scenario, and a week without lessons, are refused.TimetableScenarioStore::scheduledLessons()(new) reads the window with RBAC off and re-checks status and start time in PHP, so the snapshot never depends on OpenRegister applying every filter.TimetableInputBuilder::solverWish()(was privatewish()): the importer shapes wishes exactly as a generated run does.POST /api/timetable/scenarios/{id}/import(TimetableScenarioController::importCurrent, admin:AuthorizedAdminSettingplus an admin check; 403 otherwise, 400 with the reason for a refused scenario).TimetableScenarioSections.vue): the button, the broken hard wishes list and the off-grid reason; helpersbrokenHardRows,canTakeCurrentTimetableinsrc/utils/timetableScenarios.js. 4 new strings in all 36 locales.Tests
tests/unit/Service/TimetableScenarioImporterTest.php(2), the real store, grid, input builder and scorer over an in-memory ObjectService: an imported timetable that breaks a hard wish showshardWishesBroken1 with the lesson named; a two-period lesson keeps length 2; a lesson off the period times is unplaced withoffGrid; a lesson of the next week is left out; the stored payload validates against the realtimetableScenariofragment (Opis). A generated scenario and an empty week are refused.tests/unit/Controller/TimetableScenarioControllerTest.php(+2): a non-admin is refused; an admin gets the status and metrics, or 400 with the reason.tests/vitest/timetableScenarios.spec.js(+3): broken hard wishes apart from soft ones, the off-grid reason, when the button shows.Red first: the importer tests failed with the class missing, the controller tests on the unknown
importerargument, the vitest cases on the missing helpers (lane loglane17/red-s6.log).Verification
At head 6bc8cd5 (development 19711e0 + #791 + #793 + #794 + #795 + this section):
composer check:strict1 (phpcs, one 151-character line) then phpcs 0 on the changed files; phpmd, psalm, phpstan 0; PHPUnit 530 (7 skipped). npm lint, stylelint, check:l10n, check:l10n-js, check:schema-l10n, check:manifest, vitest and build all 0. CI-shaped Hydra gates (hydra-gates@main, full coverage, this body): ALL 82 applicable gates passed.Live check
POST /apps/planninq/api/timetable/scenarios/<id>/importanswers 403.Inherited: the non-required Newman, PHPUnit (pgsql) and Quality Report jobs have been red on every PR since #758.
🤖 Generated with Claude Code