refactor: migrate controllers away from ValidateHelper - #8383
vitormattos merged 2 commits into
Conversation
|
Thanks for opening your first pull request in this repository! ✌️ |
|
@vikas-kushwaha-dev could you check the DCO issue? |
vitormattos
left a comment
There was a problem hiding this comment.
The php-cs check confirms that the new validator imports need to be reordered.
composer run cs:check reports the same issue in three files:
lib/Controller/FileController.phplib/Controller/PageController.phptests/php/Unit/Controller/PageControllerTest.php
Could you please run composer run cs:fix and commit the resulting import ordering changes?
2f5a745 to
0abb92d
Compare
vitormattos
left a comment
There was a problem hiding this comment.
The code changes look good now. The import ordering issue is fixed.
There are two things left before this PR can be merged: the branch has a conflict with main, and the DCO check shows that the first commit is missing the required sign-off.
If you do not already have the LibreSign repository configured as upstream, you can add it with:
git remote add upstream https://github.com/LibreSign/libresign.git
git fetch upstreamThen rebase your branch on the current main and add the DCO sign-off to the commits:
git rebase --signoff upstream/mainIf Git reports a conflict, resolve the conflicting files, then run:
git add <resolved-files>
git rebase --continueRepeat this until the rebase finishes.
After that, update your PR branch with:
git push --force-with-lease origin refactor/8353-migrate-validate-helperPlease use --force-with-lease instead of --force, as it avoids overwriting unexpected remote changes.
LibreSign requires DCO sign-off on every commit. DCO (Developer Certificate of Origin) is a lightweight way to certify that you have the right to contribute the code under the project's license. Git records this with a line like:
Signed-off-by: Your Name <your@email>
Using git commit -s when creating commits adds this automatically. In this PR, your second commit already has the sign-off; the DCO check is reporting the first commit.
We also have this documented here:
https://github.com/LibreSign/documentation/blob/main/developer_manual/getting-started/commits.rst
More about DCO:
https://developercertificate.org/
After the rebase and push, GitHub should recalculate the conflict status and the DCO check.
0abb92d to
59ce952
Compare
|
Hi @vitormattos, I’ve addressed the requested changes. The branch has been rebased, the commit history has been cleaned up, and the DCO check is now passing. Could you please re-review the PR and approve the pending workflows when you have a chance? Thanks! |
Signed-off-by: vikas-kushwaha-dev <vikaskushwaha.dev00@gmail.com>
Signed-off-by: vikas-kushwaha-dev <vikaskushwaha.dev00@gmail.com>
59ce952 to
3964329
Compare
Resolves: #8353
📝 Summary
Migrates the remaining simple controller consumers away from
ValidateHelperand uses the focused validators directly.AccountController: removes the unusedValidateHelperdependency and import.FileController: replacesValidateHelperwithFileInputValidatorfor file validation andSigningRequestValidatorfor signing-request validation.PageController: replacesValidateHelperwithSigningRequestValidatorand updatesPageControllerTestaccordingly.This keeps the existing validation and signing-request behaviour unchanged while moving these controllers towards the dedicated validator classes.
No public API or UI behaviour is changed by this PR.
🧪 How to test
Run the affected controller tests:
The affected controller tests pass when run individually.
The complete unit test suite was also run locally. It completed all 3,860 tests, but the local devcontainer reported unrelated failures, primarily caused by Nextcloud
appdatapermission issues and API test state/authentication issues unrelated to this refactor.Additional check:
passes without errors.
⚙️ API / Back-end changes
ValidateHelperdependency fromAccountController.FileControllerto focused validators.PageControllertoSigningRequestValidator.PageControllerTest.🚧 Backport
None (
mainonly).✅ Checklist
git diff --checkpasses.🤖 AI (if applicable)