-
Notifications
You must be signed in to change notification settings - Fork 72
Migrate Silex to Symfony #2030
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
Draft
ryanrath
wants to merge
108
commits into
ubccr:main
Choose a base branch
from
ryanrath:migrate-silex-to-flex
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Migrate Silex to Symfony #2030
Conversation
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
Included in this commit is: - Added the symfony directories / files this includees: - config/ - src/ - templates/ - In an effort to keep the Symfony infrastructure seperate from the Silex / historical system I've set the "Symfony App" to be served from the public directory. This is why public is essentially the same as html just without the `controllers/` and `internal_dashboard` directories. - Rest Endpoints migrated so far ( OpenXDMoD ): - Summary Tab - Usage Tab - Metric Explorer Tab - Data Export Tab - Job Viewer Tab
Included in this commit is: - Added the symfony directories / files this includees: - config/ - src/ - templates/ - In an effort to keep the Symfony infrastructure seperate from the Silex / historical system I've set the "Symfony App" to be served from the public directory. This is why public is essentially the same as html just without the `controllers/` and `internal_dashboard` directories. - Rest Endpoints migrated so far ( OpenXDMoD ): - Summary Tab - Usage Tab - Metric Explorer Tab - Data Export Tab - Job Viewer Tab
I just want to checkpoint the changes I've made so far so as not to lose anything in the case of a problem w/ my development block.
- Migrated internal_dashboard/controllers/mailer.php to a Symfony Controller - for enum_target_addresses and send_plain_mail operations - Updated the expected output for the enum_target_addresses tests so that they're in line with the new controller.
Since this is going in to xdmod11.0 we will only be supporting el8 builds and as such only need one composer.json file again ( and there was much rejoicing! )
These changes add the ability to use API tokens to the new REST stack. - BaseController.php: Added a new `$tokenHelper` member variable so that child classes can support token authentication - WarehouseExportController.php: - Utilized the new `$tokenHelper` instance to implement token authentication for the `getRealms` function. - Updated the way that authentication was handled so that tests passed for: - `getRequests` - `createRequests` - Updated `deleteRequests` so that the request ids are provided as a parameter vs in the body of the requests due to DELETE requests not having a body.
This function needs to be called to ensure that user login counts are properly recorded ( via the SessionManager ).
Somewhat Automated error handling that helps keep the same behavior from the old rest stack.
empty will allow us to also capture when the userid value is an empty string as opposed to just null.
These changes allow us to mimic the same responses as were received from the old rest framework.
The previous function `CCR.invokePost` would do a pre-flight check to ensure that a user was authenticated / authorized to make the call before actually making it. That file is no longer needed / exists so this function call was changed to be the same as what occurs when a user was determined to be authorized. The authentication / authorization is now handled on the backend for each rest call.
These changes were just needed beacuse of the new version of PHPUnit.
Due to the way that the new rest stack interprets urls the leading `/` needed to be removed from these tests.
Since we can now return status codes other than 200, this let's us have an expected http_code.
This form of `assertEquals` has been deprecated in the newer versions of PHPUnit, this commit just updates them to the currently supported version called `assertEqualsWithDelta`.
The error messages for missing or malformed parameter values has been updated slightly in the new REST stack, the message still indicate the same occurence, but the wording is different.
These changes should have been in the previous commit.
This reflects the new REST url. A quick note, this change is accounted for on the front end by setting the two REST properties in portal_settings.ini to an empty string. Which is then js variable `XDMoD.rest.url`.
The current rest stack defaults to setting the content-type to application/json when it returns json so where before we would be getting back "json" but expected the content-type to be `text/html` we can now update it to reflect the new content-type. Included in this commit are also some massaging of the expected http code, most often it's expecting a 4** error code where before we had a 200. There were also some places where we expected the returned value to be stringified json that needed to be `json_decode`d, but now that it's actually returning json it's decoded for us and we're presented with an array as opposed to a string. Some additional debugging was also added.
Added some assertions so that the new version of PHPUnit would run the tests and added a return type definition to keep PHP 7.2 happy.
PHPUnit deprecated this function call but thankfully some nice person sucked out the implementation from PHPUnit and put it in a new composer library. This change is just accounting for that change.
We'll expect PHP Deprecated errors until we have everything fully upgraded.
Some entries for 'PHP Notice' are added to the php_errors.log file for attempting to fread a directory. These should be ignored.
- Deleted remnants of change in `html/` - Removed Highcharts libraries from `public/gui/lib/highcharts` as we're using plotly now. - Updated versions of plotly and jQuery - updated public/highchart_template.html to public/plotly_template.html - updated public/index.php so that it works w/ organizations being an array vs. an object.
In PHP8.2 it's required that to reference a variable from within a string you now need to do `{$variable}` as opposed to `${variable}`.
this code was previously referencing `i` which isn't a php variable.
Classes that implement functions to comply with PHP Iterators need to specify function return types.
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.
Description
Motivation and Context
Tests performed
Checklist: