Skip to content

Conversation

@TamaroWalter
Copy link
Collaborator

@TamaroWalter TamaroWalter commented Jul 2, 2025

📋 Kind of PR

  • Fixes a bug
  • Updates for a new Moodle version
  • Adds a new feature of functionality
  • Improves or enhances existing features
  • Refactoring: restructures code for better performance or maintainability
  • Testing: add missing or improve existing tests
  • Miscellaneous: code cleaning (without functional changes), documentation, configuration, ...

🧩 Description

This PR updates ratingallocate to the new moodle version. This includes:

  • new coding guidelines, phpunit guidelines ragarding @cover annotations
  • fixing wrong phpunit/behat-tests

Additionally:

  • new workflow files
  • new PR-template
  • moving classes from the locallib to own class files
  • add Changes.md

✅ Checklist

Please confirm the following (check all that apply):

  • I have phpunit and/or behat tests that cover my changes or additions.
  • Code passes the code checker without errors and warnings.
  • Code passes the moodle-ci/cd pipeline on all supported Moodle versions or the ones the plugin supports.
  • Code does not have var_dump() or var_export or any other debugging statements that should not appear on the productive branch.
  • Code only uses language strings instead of hard-coded strings.
  • If there are changes in the database: I updated/created the necessary upgrade steps in db/upgrade.php and updated the version.php.
  • If it is a Moodle update PR: I read the release notes, updated the version.php and added the new moodle version to the workflow file. I ran all tests thoroughly checking for errors.

🧱 Related Issue


🗒️ Additional Notes

@TamaroWalter TamaroWalter self-assigned this Jul 2, 2025
@TamaroWalter TamaroWalter added the WIP Work in progress - not ready to merge label Jul 2, 2025
@TamaroWalter TamaroWalter changed the title WIP: Update/500 Update/500 Jul 4, 2025
@TamaroWalter TamaroWalter requested a review from dlmsr July 4, 2025 11:46
@TamaroWalter TamaroWalter removed the WIP Work in progress - not ready to merge label Jul 4, 2025
Copy link
Member

@dlmsr dlmsr left a comment

Choose a reason for hiding this comment

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

Hi @TamaroWalter,

thanks for the PR. Here is the review you requested.

  • commit message of 9883f33 does not match the diff,
    better: ‘Delete trailing whitespace in PR template’

  • Squash 487ce90 and 1a5bda4 into one commit with message:

    Split locallib.php apart and use class autoloading
    
    Moodle supports a class autoloading mechanism. Move the classes defined
    in locallib.php into their own files under classes/.
    
    

    Also there is something other going on in these commits, namely some
    code formatting. Please refrain from doing so in the future. I know
    it’s sometimes hard to resist 😉

  • Squash fec5eb3 (improve changes.md styling) and ad6f935 (add
    changes.md) but before edit fec5eb3 (improve changes.md styling) and
    delete the trailing whitespace.

  • 1622eb7 does more than adding new coverage annotations. Please split
    in this case.

Ideally we should then end up with the following history:

* Sync with Learnweb's centralized pull request template
* Add new coverage annotations to unit tests
* Change indentation (why though?)
* Fix typo in method name of class ratingallocate
* Merge nested if into single if
* Add CHANGES.md
* Split locallib.php apart and use class autoloading
* Delete trailing whitespace in PR template

We should go for a follow-up PR that moves the strategies also into
classes/ and into a common namespace. As well as some other classes
which do not reside under classes/. WDYT?

I will add some additional comments to some changes in the GitHub diff
for this PR.

Copy link
Member

@dlmsr dlmsr left a comment

Choose a reason for hiding this comment

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

See inline comments.

I know it's a lot 🤕 sorry

@dlmsr dlmsr added this to the Release 5.0.0 milestone Jul 11, 2025
dlmsr and others added 12 commits August 13, 2025 08:03
This reverts commit 9a93fad.

The pull request template is added and kept in sync by a bot which is
defined in the repository for the centralized workflows.
Moodle supports a class autoloading mechanism. Move the classes defined
in locallib.php into their own files under classes/.
add the link to the adressed issue and remove unnecessary information about changes in the locallib
Add missing cover annotations and add new coverage annotation style for phpunit 12
Replace qualifiers with imports and long if-chains with the php match-statement. Make array definitions more compact.
@dlmsr dlmsr merged commit 1961fab into main Aug 13, 2025
77 of 78 checks passed
@dlmsr dlmsr deleted the update/500 branch September 3, 2025 18:03
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.

3 participants