DoctrineEncryptBundle icon indicating copy to clipboard operation
DoctrineEncryptBundle copied to clipboard

Realllow usage of php 7.2+, CI using github actions, demoprojects and other improvements

Open Zombaya opened this issue 3 years ago • 9 comments

After seeing that with the release of 5.1.0 all support for php 7.2-7.4 was dropped, I wanted to re-add this to the library since I believe this was a bit too drastic of a move which was also not really necessary in my opinion.

To verify that my changes were going to be valid, I've made sure all the unit-tests run again, added two demo-projects using symfony 4.4 and symfony 6.0 with unit-tests to make sure it is all supported.

I've also backported a fix for performance issues with child-classes of abstract classes with encrypted fields as I would be upgrading our project depending on this library, which was already using this fix in production for over a year using a patch. If needed, I can create a seperate PR for this fix and extract the commits from this PR.

Overview of changes

  • Re-allow usage of php 7.2-7.4
  • Add dependency on doctrine/annotations and doctrine/doctrine-bundle to composer.json
  • Add .gitattributes-file to strip out unnecessary files on packagist.com for usage of the library
    • More information on https://php.watch/articles/composer-gitattributes
  • Renamed Tests to tests to be more in line with other libraries
  • Removal of unnecessary phpunit-result-cache-file from repository
  • Make sure all unittests run on php 7.2-8.1 using both lowest and latest dependencies
  • Add Continuous Integration using github actions
    • Example of a run
    • Add statistical analysis
      • Make sure composer.json is valid
      • Make sure all php-files are valid php in php 7.2-8.1
      • Make sure no undefined classes or variables are used (PHPStan)
  • Make sure all commands return 0 instead of 1 when successfully completing
    • See https://symfony.com/doc/current/console.html#creating-a-command
       // return this if there was no problem running the command
       // (it's equivalent to returning int(0))
       return Command::SUCCESS
      
    • https://en.wikipedia.org/wiki/Exit_status#POSIX

      POSIX-compatible systems typically use a convention of zero for success and nonzero for error.

  • Add PHPStan (level 0) to avoid errors with undefined classes or variables
    • Also runs in CI
  • Add demoprojects
    • Using symfony 4.4 and 6.0
    • Shared database, secret and templates for easy comparison between demo's
    • Example-entity using annotation and example-entity using attributes
    • AttributeReader is only used in php >= 8.0
    • Has unit/integration-test which is integrated in CI to validate demo's are valid and works with library
    • Use sqlite as database to make it easy to run in CI and for users to test out
    • Added README.md's to help test out the demo-projects
  • Add fix to avoid updating non-changed childclasses of abstract parent classes with an encrypted field
    • with unittest
    • with port of tests written by @sh41 in #41

Zombaya avatar Feb 13 '22 19:02 Zombaya

@Zombaya Thank your for your work! We're using your great fork for a while now.

As this repository, does not seem the get any attention from the owner, what do you think about releasing your own fork on packagist? Probably under a new package name?

virtualize avatar Jul 06 '22 15:07 virtualize

To be honest, I've been long been thinking about asking @absolute-quantum about his idea about moving this project to an organization so more people would be able to contribute and take a bit of control of this project as it seems he/she has lost a bit of interest/time/motivation to do a lot of work on this project.

I was thinking of trying to get some other people who have actively worked on this project involved.

I'd rather do this as to avoid having many people working on their own separate branch of this project, which is also a reason why I did not publish a fork of my own on packagist.

The main reason I haven't done this is because I work on this project on company time and we do not use this project very heavily, so I can not really justify for my company nor myself on devoting management time on this project other than the improvements I made so far or (further improvements I might make).

I'm not really up for maintaining a project like this myself, although I'm more than happy to contribute once in a while. Because I'm not always able or would be willing to devote time to this, I don't think I'd make a good maintainer myself.

That being said, I'd do like to thank @absolute-quantum for the time he/she put in over the years, even though the fire was gone in the last couple of years.

All in all, I'd like to hear other peoples thoughts about the possible future of this project or a fork of it.

Zombaya avatar Jul 06 '22 18:07 Zombaya

Thanks @Zombaya for your explanation, I can totally understand, so I created an issue for that asking the owner here

Which organisations do you think we could ask? On top of my head FriendsOfSymfony possibly?

virtualize avatar Jul 08 '22 09:07 virtualize

I was thinking more in the line of creating an organisation DoctrineEncryptBundle, so the project would become DoctrineEncryptBundle\DoctrineEncryptBundle.

Asking to become part of the FriendsOfSymfony-organisation is also a good idea and they might have some good ideas on how to proceed from here, even if we are not joining their organisation.

Asking around on #symfony on freenode, sending an email to [email protected] or creating on issue on https://github.com/FriendsOfSymfony/friendsofsymfony.github.io are all possible ways to contact them.

I have no experience with maintaining a project or taking over a project, so no idea what the best practices are for this.

I will not be available for the next three weeks because of personal time off so I will not be very responsive during that time. Feel free to include me however, just don't expect a quick answer :slightly_smiling_face:.

Zombaya avatar Jul 08 '22 11:07 Zombaya

Hey, i'm not sure what to do with the repo because: yes i'm not active anymore. If anyone has an idea what to do with the project be my guest, i'd be happy to help!

absolute-quantum avatar Mar 20 '23 14:03 absolute-quantum

hi, @Zombaya did you get any response from FriendsOfSymfony? @absolute-quantum if I am willing to take up the maintenance and ownership of the project, will you be able to transfer the repo ownership or do we have to fork the repo and take it ahead?

cs-akash-jarad avatar Apr 06 '23 15:04 cs-akash-jarad

I did not reach out to FriendsOfSymfony as I did not see an up to date way to contact them. I didn't spend more time into investigating onto how to best take over an existing project.

I'm still in the same place as before, I'm willing to occasionally work on the project but I'm not able to be involved constantly or maintain it on a regular basis.

Zombaya avatar Apr 06 '23 15:04 Zombaya

@absolute-quantum will you be able to transfer the repo ownership or do we have to fork the repo and take it ahead?

cs-akash-jarad avatar Apr 26 '23 05:04 cs-akash-jarad

Due to various Doctrine ORM deprecations including:

  • getEntity() is deprecated
  • getEntityManager() is deprecated
  • Using Doctrine subscribers as services is deprecated, declare listeners instead

Discussions in this pull https://github.com/absolute-quantum/DoctrineEncryptBundle/pull/65 request.

These 2 comments specifically:

  • https://github.com/absolute-quantum/DoctrineEncryptBundle/pull/65#issuecomment-1476301156
  • https://github.com/absolute-quantum/DoctrineEncryptBundle/pull/65#issuecomment-1178882618

I need to ensure that my projects will be able to upgrade to new versions of packages and not fall behind, so I created the DoctrineEncryptBundle organisation forked the pull request's repository from integr8rs:master-fixes and created the following package https://packagist.org/packages/doctrineencryptbundle/doctrine-encrypt-bundle

I know about some issues in the version I released (5.3.0) Example: issue (https://github.com/DoctrineEncryptBundle/DoctrineEncryptBundle/issues/1) that have already been closed. It will be in a release in the next couple days as I do plan on looking fixing a few issues that I know about.

I do need to still add another Owner and probably more members to the organisation. Volunteers would be appreciated.

r3hp1c avatar Jul 17 '23 12:07 r3hp1c