Skip to content
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

Symfony 4 upgrade #562

Closed
wants to merge 7 commits into from
Closed

Symfony 4 upgrade #562

wants to merge 7 commits into from

Conversation

Shaky212
Copy link
Contributor

This is the upgrade from Symfony 3.4 tot Symfony 4.4. The major steps are:

  • resolve deprecations
  • upgrade composer to Symfony 4.4
  • installl Symfony/flex

Within Symfony 4 the application and directory structure has changed. The app folder has partly been moved to the config folder en the .env environment. All twig templates have been moved to the templates folder.

Notice the .env contains a parameter administrator_teams used in the dashboard_saml.yaml and checked during compile time in Configuration.php. Previously this was an array, but not supported because of it's dynamic character. The administrator_teams is now a scalar, a string with comma separated values.

See also: https://symfonycasts.com/screencast/symfony4-upgrade/upgrade4

@Shaky212 Shaky212 force-pushed the feature/symfony-5-upgrade branch 12 times, most recently from 68880f9 to 118967e Compare November 21, 2022 15:54
Copy link
Contributor

@MKodde MKodde left a comment

Choose a reason for hiding this comment

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

Awesome work so far! I did note quiet a few issues you might need to address.

For example:

  • Some of the old, unused folders are still in the project web, app
  • Swiftmailer is still showing up in config
  • See code review below for more details.

MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###

locale=en
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm looking at this .env.dist file as a replacement for the parameters.yaml.dist file. From that perspective:

  • I'd love to see all comments that where previously there, instructing a user on how to fill the parameters.
  • While at it, please group related parameters (like they where in parameters.yaml.dist) and hence improve readability of this file.

Comment on lines 57 to 59
- name: Copy parameters.yml.dist to parameters.yml
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm cp /var/www/html/app/config/parameters.yml.dist /var/www/html/app/config/parameters.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to cp .env.dist .env?

docker-compose.override.yml
app/js/coverage
assets/js/coverage
/build/
Copy link
Contributor

Choose a reason for hiding this comment

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

/build/ stil in action? I thougth encore drops the web assets in the public/build folder.

.gitignore Outdated
Comment on lines 21 to 22
/web/build
/web/coverage
Copy link
Contributor

Choose a reason for hiding this comment

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

web folder is outahere right? If it is still in the repo. I think we should actually remove it from VCS!

Comment on lines 40 to +43
- name: Delete config
file: path={{spdashboard_data_dir}}/current/app/{{ item }} state=absent
with_items:
- config/parameters.yml
- config/parameters.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be a thing anymore right? If we need to remove some distributed configuration it should be a .env file we are removing here?

Copy link
Contributor

Choose a reason for hiding this comment

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

@quartje as you've been informed of. We are walking away from parameters.yaml configuration. And started using the .env way instead. May I ask you to review the changes (or missing changes) to the deployment code (ansible + github actions)? I will try to do so as well, but your Docker evengalist eagle eye will probably spot a thing or two 🦜

@@ -0,0 +1 @@
{"9628d851-abd1-2283-a8f1-a29ba5036174":{"key":"9628d851-abd1-2283-a8f1-a29ba5036174","issueType":"spd-request-change-request-prod","ticketStatus":"To Do"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

This file should not be here right?

@@ -0,0 +1,28 @@
<?php

//use App\Kernel;
Copy link
Contributor

Choose a reason for hiding this comment

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

rm -f?

@@ -33,7 +33,7 @@ class PrivacyQuestions
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\Column(type="integer", options={"autoincrement":true})
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this now a required option? Or a dev-left over?

Comment on lines -175 to -176
/** @var LoggerInterface $logger */
$logger = $this->get('logger');
Copy link
Contributor

Choose a reason for hiding this comment

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

🦾 🎖️

@@ -1,4 +1,4 @@
{% extends 'base.html.twig' %}
{% extends '../../../../../templates/base.html.twig' %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are the ../ required here. Given the other templates that can simply extend the base template by its name?

@@ -1,6 +1,7 @@
FROM ghcr.io/openconext/openconext-deploy/openconext-core:feature_build_image_with_teams_included AS openconext
COPY ./conf/prep_oc.sh /usr/local/sbin/prep_oc.sh
COPY ./conf/saml20_sp.json /tmp/saml20_sp.json
#COPY ./conf/saml20_sp.json /tmp/saml20_sp.json
Copy link
Contributor

Choose a reason for hiding this comment

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

Also on line 13, we install composer 1 in the fpm container. But that conflicts with our new composer packages installed. They require composer 2 to install. Please upgrade to composer 2 :)

@MKodde
Copy link
Contributor

MKodde commented Nov 22, 2022

The jest test still fail as they refer to old, moved fixture files. Should be an easy fix to get a fully green build!

@Shaky212 Shaky212 force-pushed the feature/symfony-5-upgrade branch 5 times, most recently from 7b47cc2 to 46f4d7d Compare December 6, 2022 09:52
Upgrade Symfony 4

Upgrade Symfony 4
@Shaky212 Shaky212 force-pushed the feature/symfony-5-upgrade branch 5 times, most recently from c21875e to 3a2b53f Compare December 8, 2022 14:48
These extensions are already installed in OpenConext-containers. No need
to waste all the cpu cycles here doing it twice.
@MKodde
Copy link
Contributor

MKodde commented Jan 4, 2023

Closing this PR, the work is continued on #565

@MKodde MKodde closed this Jan 4, 2023
@MKodde MKodde mentioned this pull request Jan 5, 2023
Shaky212 added a commit that referenced this pull request Jan 24, 2023
* Upgrade Symfony 5


A mighty PR where multiple disciplines entailing the Symfony upgrade come together.

Among them:
#562 Upgrade to Symfony 4 (in preparation to this SF5 upgrade)
#571 Move to Github actions for test integrations

At first these tasks where created separate. But to keep things more tight, I chose to merge/rebase them into this branch. Beside an upgrade to this version a major update of the security has been done. Most of the security part is handled within the stepup saml bundle and SPD is a consumer of this implementation.

see: https://www.pivotaltracker.com/story/show/173217517

Co-authored-by: Michiel Kodde <mkodde@ibuildings.nl>
Co-authored-by: Bart Geesink <bart.geesink@surf.nl>
@MKodde MKodde deleted the feature/symfony-5-upgrade branch July 5, 2023 09:04
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