Skip to content

refactor config validation#617

Open
simonLeary42 wants to merge 11 commits intomainfrom
update-config-validation
Open

refactor config validation#617
simonLeary42 wants to merge 11 commits intomainfrom
update-config-validation

Conversation

@simonLeary42
Copy link
Copy Markdown
Member

@simonLeary42 simonLeary42 commented Feb 12, 2026

  • moved config validation from UnityMailer to UnityDeployment
  • simplified existing validation in UnityDeployment
  • enabled typed config, so some integers and booleans need to be unquoted
root@web:/var/www/unity-web-portal/workers# ./configtest.php
PHP Fatal error:  Uncaught UnityWebPortal\lib\exceptions\InvalidConfigurationException: $CONFIG["expiry"]["idlelock_warning_days"] must be monotonically increasing in /var/www/unity-web-portal/resources/lib/UnityDeployment.php:81
Stack trace:
#0 /var/www/unity-web-portal/resources/lib/UnityDeployment.php(22): UnityWebPortal\lib\UnityDeployment::validateConfig(Array)
#1 /var/www/unity-web-portal/resources/config.php(5): UnityWebPortal\lib\UnityDeployment::getConfig()
#2 /var/www/unity-web-portal/resources/autoload.php(38): require_once('...')
#3 /var/www/unity-web-portal/workers/init.php(17): require_once('...')
#4 /var/www/unity-web-portal/workers/configtest.php(2): include('...')
#5 {main}
  thrown in /var/www/unity-web-portal/resources/lib/UnityDeployment.php on line 81

@simonLeary42 simonLeary42 force-pushed the update-config-validation branch 5 times, most recently from 6fa06d4 to 0fabcf1 Compare February 12, 2026 17:15
@simonLeary42 simonLeary42 force-pushed the update-config-validation branch from add8e16 to e7843af Compare March 11, 2026 12:17
@simonLeary42 simonLeary42 force-pushed the update-config-validation branch 4 times, most recently from df95b0a to 3bdc835 Compare April 6, 2026 15:19
@simonLeary42 simonLeary42 requested a review from Copilot April 6, 2026 15:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors configuration validation by centralizing SMTP and expiry config checks in UnityDeployment and adds a CLI script to validate configs during deployment updates.

Changes:

  • Moved SMTP validation out of UnityMailer into UnityDeployment and tightened ssl_verify handling to be boolean.
  • Reworked expiry validation using assertion-based helpers and wrapped assertion failures as InvalidConfigurationException.
  • Added a workers/configtest.php script and documented running it during upgrade; updated base config and changelog for the ssl_verify type change.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
workers/configtest.php Adds a CLI entrypoint to load the app and trigger config validation.
resources/lib/UnityMailer.php Removes SMTP config validation and updates ssl_verify check to strict boolean.
resources/lib/UnityDeployment.php Centralizes SMTP/expiry validation using assertion-based helpers.
README.md Documents running the new config test script during upgrade.
deployment/config.base.ini Changes [smtp] ssl_verify default from string to boolean.
CHANGELOG.md Notes the breaking change in [smtp] ssl_verify type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread resources/lib/UnityDeployment.php
Comment thread resources/lib/UnityDeployment.php
@simonLeary42 simonLeary42 force-pushed the update-config-validation branch from b7c96df to 1707ec9 Compare April 6, 2026 15:29
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