Skip to content

Commit

Permalink
Merge 4 to 5 (mautic#11044)
Browse files Browse the repository at this point in the history
* Edit comment

* Changed date format

* refactor(assetslist): use short date and long date with tooltip

* change redis to v5 because it is needed for symfony/mailer

* Add a migration for lead_lists table.

* Add SQL queries for migration.

* Add definition of the last_build_date field to the model.

* Fix migration.

* Fix migration.

* Implement notification in the template.

* Add a config and a form for segment settings.

* Add a template for the config.

* Fix translations

* Fix translations

* Use an actual value from the config in the template.

* Update last_built_date value when we execute mautic:segments:update command.

* Update last_built_date value when we execute mautic:segments:update command.

* Fix code style.

* Update last_built_date when we create a segment.

* Fix a bug  with built_last_date when cloning LeadList entity.

* Fix method return type.

* Fix class name.

* Fix UpdateLeadListsCommand command.

* Add a segment config type test.

* Add a config subscriber test.

* Fix pluralization.

* Add tests for LeadList entity class.

* Refactor variables names (as was suggessted here https://github.com/mautic-inc/mautic-cloud/pull/942/files#r475729087).

* Rename LeadList::updateLastBuiltDate to LeadList::setLastBuiltDateToCurrentDatetime as suggested here: https://github.com/mautic-inc/mautic-cloud/pull/942/files#r475720725

* CS fixes

* Type fixes

* PHP 7.4 syntax sugar

* Fixing a bug caused by cherry-picking discovered by unit tests (:tada:)

* Adding test for the issue found during testing

The condition for max contacts param was opposit to what we want

* Forgot to add the test

* CS fix

* Asserting also the segment member count

* Set default values for original_is_published_value and column_is_not_created columns so older migrations won't fail

* Updating migrations to M4

* Fixing comparison value for the default value

* Fix accessibility of HTML Emails

* Add unit tests

* Remove unused class reported from PHPStan

* Fix Call to a member function getLanguage() on null

* Using the subject directly without the token, more test cases

* CS fixes

* Fix default order dir in controllers

* Set orderBy to session If does not exist

* Revert back CS fixer tableheader.html.php

* First work on Composer integration

* Add Composer dependency to Mautic

* Use KernelInterface to get project directory

* Explicitly set version of mautic/core-lib to v4

* Fix CS

* WIP Marketplace UI installation

* WIP UI installer now working

* Fix removal of plugins through UI + memory issues

* Fix CS

* Changes shown at live demo MautiCon

* Fix CS

* Fix PHPSTAN

* Parse + cache allowlist from GitHub

* Refactor allowlist into its own service

* Fix DI config

* Fix failing tests

* Fix AjaxController

* Add composer.json and composer.lock to full package, but not in update package

* Add some basic error handling to cache clear in AjaxController

* Catch errors, add dry-run functionality

* Add tests

* Forgot to push dummy allowlist

* Add additional tests

* Fix PHPSTAN

* Refactor Composer service into ComposerHelper in core, add Composer update step to Mautic update

* Remove ext-imap as hard Composer requirement

* Bump composer/composer to latest version for testing

* Bump composer/composer to 2.2 for speed/memory improvements

* Lock composer/composer version to prevent issues while updating Mautic

* Skip pre-update checks on manual update

* Remove Composer Update step from Mautic updater

* Introduce composer_updates feature flag

* Fix CS

* Disable UI + CLI update if Composer update is enabled

* Cleanup

* Further cleanup

* Do not show the issue tracker button if there is no URL for issues

* Apply suggestions from code review

Co-authored-by: John Linhart <jan@linhart.email>

* Revert "Apply suggestions from code review"

This reverts commit a4c6a1b74ea419946ce64e7b905f1905b6bd60b3.

* Add lots of error handling to AjaxController

* Update URLs to docs in most places

* Additional error handling

* Remove double cache clear as it crashes the application

* Localization

* Fix tests

* Add more tests

* Fixing phpstan issues

* Add more tests

* Fixing bug discovered by the tests 🎉

* Add new plugin events (Acquia)

* Added new sortable columns to landing pages table, created at, modified date, createdby

* Set default order to decreasing modified date

* At creation of landing set also modified date

* Added index action test to PageControllerTest

* changed format date

* refactor(pagelist): use long date on tooltip

* fix(tableorder): at default order icon is asc and not desc, i change the default behavior

Changed default icon to asc and added another option "orderDir" for default icon, cant be used
option "dir" because it will be fixed the icon at one order. I also set orderbydir session at init
in PageController, because setListFilters method inside CommonController has ASC as default
behavior. If don't do it after first click on modified date icon the order will be again DESC, i
need that it will be converted to ASC.

* refactor(pageslist): changed init of dir param

* test(pagecontrollertest): added tests for page list, check if columns exist and order is correct

* refactor(pagecontroller): remove if condition and use default order to session

* Introduce options in fm_elfinder config

* Remove defaultDir parameter

* Fix default ordering for SMS

* Guess session base If not exists from deprecated parameter from old abstract class

* Fix default ordering for Assets

* Fix default ordering for Forms

* Add return type

* Fix ordering for Pages

* Keep same direction If switch column ordering

* Revert "Regenerate production assets"

This reverts commit 92f4db5.

* Add missing argument to remove command

* Revert app.js

* Real revert app.js

* Fix event dispatching in ReloadHelper

* Revert "Introduce options in fm_elfinder config"

This reverts commit f4b6461.

* Revert "create test"

This reverts commit 67f97df.

* Add unit test

* Improve boolean import/API support mautic#7513

* Fix PHPStan

* Fix PHPStan

* Fix PHPStan and CS

* Added the ordered columns creation date and modified date

* Moved ID column to the end

* Added created by column

* Changed method for date

* Removed visible-md

* Added test for index action

* CreatedBy is visible only on lg

* Replace toFull with toFullConcat

* refactor(list.html.php): added escape and show full date only on hover

* test(emailcontrollerfunctionaltest): modified a test

now test if email contains saved fields

* feat(emailcontroller): changed default order to date modified

* refactor(emaillist): added default order to datemodified

* feat(email): set added date and modified date in Email construct

* feat(emaillist): changed default order to desc

* Remove non-working installation button from table

* Testing for more bool values

* Porting failing test from API Library

Mautic\Tests\Api\CampaignsTest::testCampaignContactEditEvent

* Fixing the  error "Call to a member function getTimestamp() on null"

* Improving error messages with concrete IDs

* Fixing param/return types for LeadEventLog entity

Because the original bug happened because they were not correct

* CS fixes

* Added space at the end of the file

* add extra checks in the misc job

* Fix scaffolded files that are out of sync

* reverted renamed tests, as it breaks the reporting

* Fix unit tests

* Fix email ordering

* Same date formatting also for campaigns

* Fix change order for default way

* Add unit tests for landing page

* Move getDefaultOrderDirection to CommonController

* Update app/bundles/CoreBundle/Controller/CommonController.php

Co-authored-by: John Linhart <jan@linhart.email>

* Add return type for getDefaultOrderDirection

* Revert back strict return type

* More unit tests

* Refactor unit tests to trait

* Add asset controller test

* Stop unnecessary query (mautic#10876)

* Ensure unnecessary update queries won't happen

UPDATE leads SET last_active = ... WHERE id IS NULL

* Improving a test by replacing mocks with real objects

* Reusable getStandardColumns method (mautic#10898)

* Move getStandardColumns method into the helper so it can be reused in other places.

* Fix the test.
Don't mock the ReportHelper. There is no need to mock it.

* Increase code coverage.

* Type fixes

* CS fix

* Fixing types

Co-authored-by: Anton Vlasenko <vlasenko.anton@gmail.com>

* Add UI update deprecation notice (mautic#10907)

* Merge pull request from GHSA-mj6m-246h-9w56

* only allow access to specific PHP files in their specific location

* same change is needed in .htaccess file scaffolded in mautic/core-lib

* improved wording in comments

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* loosened regex to allow index_dev.php requests

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Bump to 4.2.0 stable

* Revert - remove dependency on pre-installed mautic (local.php file) when running tests (mautic#10909)

Co-authored-by: Zdeno Kuzmany <zdeno@kuzmany.biz>

* add missing whitespace (mautic#10923)

* restrict workflows with impact to mautic/mautic (mautic#10894)

* restrict workflows with impact to mautic/mautic

* no codecov wanted either

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Dynamic content events (mautic#10886)

* add events to segment filters dictionary generation, alter choices event to be more dynamic, make filter type public, alter choices form to allow translation keys without prefix as fallback. update reference to CO bundle

* code style fixes

* add events for DynC. for Cust.O.

* minor changes, maybe will be reverted

* split factory for sergments filter in two methods, so we can use it elsewhere

* cs fixes

* cs cleanup

* cs cleanup

* remove php 7 stuff

* Update app/bundles/LeadBundle/Event/SegmentDictionaryGenerationEvent.php

Co-Authored-By: galvani <galvani78@gmail.com>

* Update app/bundles/LeadBundle/Segment/ContactSegmentFilterCrate.php

* catch and ignore PDO exceptions in cache:clear process in CacheBundle, Move ContactFiltersEvent to DynamicContent bundle and fix references

* fix existing tests to mock new service arguments

* Update app/bundles/LeadBundle/Segment/ContactSegmentFilterFactory.php

Co-Authored-By: galvani <galvani78@gmail.com>

* Update app/bundles/DynamicContentBundle/Helper/DynamicContentHelper.php

Co-Authored-By: galvani <galvani78@gmail.com>

* fix cs errors

* Fixes after a wild cherry-pick of an antient missing commits

* One more round of after cherry-pick conflict cleanup

* Stan and CS fixes

* Covering the new method with tests

Co-authored-by: Jan Kozak <galvani78@gmail.com>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Allow composer scripts to use php-cs-fixer configuration (mautic#10624)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Added provision to check is editted segment is new. (mautic#10003)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Added support for MySQL full-text search queries (mautic#9335)

* Added support for MySQL full-text search queries

* Composer conflicts resolved

* Conflict resolved

* Moving the new package to the right composer.json

* Fixing typehints

Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Mohammad Abu Musa <m.abumusa@gmail.com>

* fix segments list order (mautic#10938)

* fix(segments): fixed session var name from segment to lead.list

* test(listcontrollertest): added a new test for list page

* Feature new click filters (mautic#9852)

* Adds SMS and Email clicked date based segment filters

* Add support for clicking any link in any sms period

* Removed unused code

* Add manual SMS dnc filters

* Process SMS dnc manual unsubscribe filter

* Added missing dependency

* Fixed ChannelClickQueryBuilder for "did not click" filters

* Add new filter tests

* Type fixes

* Fixing PHP notice

PHP Notice - Uninitialized string offset: 0" at FieldFilterTransformer.php line 94

Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Joey Keller <jos0405@gmail.com>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Remove doc blocks TPROD-131 (mautic#10970)

* Adding new CS Fixer rule to remove doc blocks

* Removing docblocks

See https://mautic.atlassian.net/browse/TPROD-131

* Running the CS fixer again to remove the double new lines

* Runing CS Fixer for the 3rd time

* More CS fixes

* Fixing PHPSTAN issues in anonymous classes as those depend on line number which has changed after removing doc blocks

* Segment query optimizatioin  (mautic#10904)

* Optimized DoNotContactFilterQueryBuilder

* Optimized addNewContactsRestrictions query

* DoNotContactFilterQueryBuilder test

* ContactSegmentQueryBuilder test

* Fixed failing tests when merged into development branch

* Removed call-time unnecessary parameters

* CS fixes

* Fixing test

The string must have an underscore in it

* Fixing DoNotContactParts for all options

Co-authored-by: fedys <miroslav.fedeles@gmail.com>

* Import validation (mautic#10884)

* Validate imports to require mapping required fields

* Refactor required field validation for imports to event system

* Skip the CheckPassword validation group when associating a User entity as Owner

* Utilize the ArrayHelper class to reduce boilerplate.

* Ensure tags is an array

* Check all required company fields are mapped if any company fields are mapped during a contact import.

* Fixes after difficult conflict resolution

* Syntax sugar

* Adding functional tests for contct import

* Removing the deprecation notice as it does not make sense

The $flashBag property is private so no controller that inherits from this one can use it. Also, making it protected is a BC break as it breaks one of our plugin which use the same property already.

* Adding COMMAND_NAME const to avoid using strings in the tests

* Adding a validation error message if the file is not provided

* Adding logging to get some trace about why the import was reseted, light refactoring

* Access to an undefined property ImportController::$model

* Adding test with fixes discovered by it

* CS Fixes

* PHPSTAN fixes

* CS Fixes

* We cannot overwrite the getModel method as it's used from paretns with different model names

Co-authored-by: Don Gilbert <don.gilbert@mautic.com>

* docs: add Damzoneuh as a contributor for code (mautic#10983)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* Segment delegate decorator event (mautic#10890)

* make sub-querybuilders pass paramater types along and allow to bypass decorator to get crate value

* cs fixes?

* tests for dynamic content

* update reference to CO plugin

* update reference co bundle, fix cs

* fix tests, cover event dispatch with test

* remove use statements from config

* replace int value with constant

* add argument removed on cleanup

* add helper method

* Fixes after wild cherry-pick conflict resolutions of antient commits

* New PHP syntax suggar

* CS fix

* Improving tests

* CS fix

* CS fix

* CS fix

Co-authored-by: Jan Kozak <galvani78@gmail.com>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fixing BC change after moving some segment filters to behaviors (mautic#11003)

* Merge 4.2 branch back to 4.x (mautic#11015)

* add missing whitespace (mautic#10922)

* Fix segment membership filter build query (mautic#10809)

* Fix segment membership filter build query

* Fix addLogic based on and/or

* Add unit tests

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix report date filter (mautic#10800)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix email translations lost and overwritten by parent (mautic#10620)

* Fix email translations lost and overwritten by parent

* Add unit tests

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix for Amazon API transport return-path when sending emails immediately (mautic#10474)

* Fix for Amazon API transport return-path when sending immediately

* Added test for getBatchRecipientCount in AmazonApiTransport

* fix phpstan

* cs fix

* fix_cs

* fix the test

* Revert method signatures in AmazonApiTransport

* fix phpstan

* Add missing amazon message batch test

Co-authored-by: Mohammad Abu Musa <m.abumusa@gmail.com>
Co-authored-by: Zdeno Kuzmany <zdeno@kuzmany.biz>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix timezone on timeline (mautic#10375)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix API Permission Issue (mautic#10679)

* Fix Api Permissions Issue

* Updated Api permission issue functional test

* Removed unused namespace

* Fix functional test case

* Fixed Functional Test

* Fix failed tests

Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix integration special fields order (mautic#10649)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix set import template If use legacy builder (mautic#10897)

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* restrict workflows with impact to mautic/mautic (4.2) (mautic#10924)

* restrict workflows with impact to mautic/mautic

* no codecov wanted either

* Validate admin password length during install

* Added test

* Fix primary email company tokens (mautic#10733)

* Fix primary email company tokens

* Fix unit tests

* Add break If we find primary company value

Co-authored-by: mmarton <marton@webdream.hu>

Co-authored-by: mmarton <marton@webdream.hu>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Public preview email disabled by default (mautic#10845)

* Public preview email disabled by default

* Add unit tests

* Add resposne content to failed unit tests

* Add flush

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Update to use default release notes, remove file (mautic#10934)

* Display just published fields in form field mapping (mautic#10734)

* Display just published fields in form field mapping

* Add unit tests

* Unit tests clean up

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* move changelog to the toplevel instead of a task (mautic#10948)

* fix segments list order (mautic#10968)

* fix(segments): fixed session var name from segment to lead.list

* test(listcontrollertest): added a new test for list page

* Migration fixes (mautic#10931)

* Fixing skip migration check...

... as it should not check for the foreign keys but only if the table exists. The foreign keys must exist when the table exists either by running this migration or installing Mautic from entities

* Fixing migration check...

... as it was checking for wrong index name without the prefix and then the rename query was run on an index that do not exist.

* Actually, the checks were fine but used double table prefix

* CS fix

* Fix prevent save alias of contact field already used in segments (mautic#10224)

* Fix prevent save alias of contact field already used in segments

* fix unit test

* CS fixer

* Fix PHPStan

* Remove SegmentFiltersSubscriber.php from configuration

* Resolve conflicts after segments refactoring

* Fix unit tests

Co-authored-by: Zdeno Kuzmany <zdeno@kuzmany.biz>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Fix public preview email for expired emails (mautic#10971)

* Fix public preview email for expired emails

* Add unit test

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Small grammar fix (mautic#10977)

* Tags on edit should display same message as other entities, for e.g. xyz has been updated! (mautic#10984)

* MAUT-7170: Tags on edit should display same message as other entities, for e.g. xyz has been updated!: M4

* MAUT-7170: Tags on edit should display same message as other entities, for e.g. xyz has been updated!: M4

* Remove clone option from tag manager

Co-authored-by: Saurabh Gupta <saurabh.gupta@acquia.com>

* Export to CSV and Excel creates contact duplicates (mautic#10849)

* Fix duplicate contacts when exporting

* Fix code style

* Fix code style

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* Missing include/exclude operator for text field in segment filters (mautic#10985)

* WIP: Fix: No include/exclude operator for text field in segment filters.

* Use method available in the interface

Co-authored-by: Tejas Navghane <ts.navghane@gmail.com>

* Fixes updating the contact's primary company when all companies are removed or one of many companies are removed (mautic#11000)

* Fixes updating the contact's primary company when all companies are removed or one of many companies are removed

* Added some additional comments

* Cleaned up the tests a bit and added a check for the primary company in the details dropdown

* Prevent phpunit warning due to using a private method with a test prefix

* CS, STAN fixes

* Test fix

Co-authored-by: Alan Hartless <alan@devkardia.com>

* Special characters of the text getting corrupted while posting results to another form (mautic#10872)

* Special characters of the text getting corrupted while posting results to another form

* Fixing PHPStan issue

* Fix for single code decoding

* Added file copyrights details

* fix CS faling check and adding type declation for variables

* fixing CS-Fixer

* fixing CS-Fixer

* Fix failed test

Co-authored-by: John Linhart <admin@escope.cz>

* Segment filter 'Asset Downloads' not showing all assets (mautic#11002)

* MAUT-3795: Segment filter 'Asset Downloads' not showing all assets

* MAUT-3795: Keep existing filter data for asset downloads after ajax search

* MAUT-3795: Fixing submit issue for asset downloads filter

* STAN fixes

* There is no request service in AssetModel

Co-authored-by: Liju P M <liju.pm@acquia.com>

* Bump to 4.2.1

* Fix issue with changelog (mautic#11012)

* Move release notes to separate file (mautic#11014)

* Fixes needed after 4.2 to 4.x merge (CS, STAN, UNIT)

* CS fix

Co-authored-by: mollux <mattias.michaux@dropsolid.com>
Co-authored-by: Zdeno Kuzmany <zdeno@kuzmany.biz>
Co-authored-by: Patryk Gruszka <patryk.gruszka@comarch.pl>
Co-authored-by: Mohammad Abu Musa <m.abumusa@gmail.com>
Co-authored-by: Rahul Dhande <68939488+rahuld-dev@users.noreply.github.com>
Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: mmarton <marton@webdream.hu>
Co-authored-by: Alfredo Arena <50916237+alfredoct96@users.noreply.github.com>
Co-authored-by: Damzoneuh <44919863+Damzoneuh@users.noreply.github.com>
Co-authored-by: Tejas Navghane <ts.navghane@gmail.com>
Co-authored-by: Saurabh Gupta <saurabh.gupta@acquia.com>
Co-authored-by: Volha Pivavarchyk <volha@aivie.ch>
Co-authored-by: Alan Hartless <alan@devkardia.com>
Co-authored-by: Liju P M <liju.pm@acquia.com>

* CS fix

* CS fix

Co-authored-by: Alfredo Arena <alfredo.arena@ctmobi.it>
Co-authored-by: Mohammad Abu Musa <m.abumusa@gmail.com>
Co-authored-by: Zdeno Kuzmany <zdeno@kuzmany.biz>
Co-authored-by: Anton Vlasenko <vlasenko.anton@gmail.com>
Co-authored-by: Joey Keller <jos0405@gmail.com>
Co-authored-by: Dennis Ameling <dennis@dennisameling.com>
Co-authored-by: Dennis Ameling (he/him) <dennis.ameling@leap.ac>
Co-authored-by: Tejas Navghane <ts.navghane@gmail.com>
Co-authored-by: Mattias Michaux <mattias.michaux@dropsolid.com>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Jan Kozak <galvani78@gmail.com>
Co-authored-by: Miroslav Fedeleš <miroslav.fedeles@gmail.com>
Co-authored-by: Alfredo Arena <50916237+alfredoct96@users.noreply.github.com>
Co-authored-by: Alan Hartless (he/him) <alan@devkardia.com>
Co-authored-by: Don Gilbert <don.gilbert@mautic.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Patryk Gruszka <patryk.gruszka@comarch.pl>
Co-authored-by: Rahul Dhande <68939488+rahuld-dev@users.noreply.github.com>
Co-authored-by: mmarton <marton@webdream.hu>
Co-authored-by: Damzoneuh <44919863+Damzoneuh@users.noreply.github.com>
Co-authored-by: Saurabh Gupta <saurabh.gupta@acquia.com>
Co-authored-by: Volha Pivavarchyk <volha@aivie.ch>
Co-authored-by: Liju P M <liju.pm@acquia.com>
  • Loading branch information
1 parent 0f4644b commit 30adfd9
Show file tree
Hide file tree
Showing 3,201 changed files with 19,786 additions and 31,531 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,15 @@
"contributions": [
"code"
]
},
{
"login": "Damzoneuh",
"name": "Damzoneuh",
"avatar_url": "https://avatars.githubusercontent.com/u/44919863?v=4",
"profile": "https://github.com/Damzoneuh",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .ddev/docker-compose.redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: "3.6"
services:
redis:
container_name: ddev-${DDEV_SITENAME}-redis
image: redis:4
image: redis:5
ports:
- 6379
labels:
Expand Down
5 changes: 5 additions & 0 deletions .github/ci-files/.my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[mysqldump]
# the shivammathur/setup-php@v2 github action image uses mysqldump 8 in it's image,
# which enables column statistics by default.
# we don't need / want that, so we disable it here.
column-statistics=0
7 changes: 0 additions & 7 deletions .github/release-notes.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
changelog:
exclude:
labels:
- chore
authors:
- github-actions
categories:
- title: 🛠 Breaking Changes
labels:
- bc-break
- title: 🔒 Security
labels:
- security
- title: ✨ Features and enhancements
labels:
- feature
- enhancement
- title: 🐛 Bugs
labels:
- bug
- regression
1 change: 1 addition & 0 deletions .github/workflows/build-grapesjs-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ defaults:
jobs:
build-js:
runs-on: ubuntu-latest
if: github.repository == 'mautic/mautic'

steps:
- uses: actions/checkout@v2
Expand Down
31 changes: 3 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
release:
name: Create draft release
runs-on: ubuntu-latest
if: github.repository == 'mautic/mautic'

steps:
- uses: actions/checkout@v2
# Our build script needs access to all previous tags, so we add fetch-depth: 0
Expand Down Expand Up @@ -58,33 +60,6 @@ jobs:
echo "IS_PRERELEASE=${PRERELEASE}" >> $GITHUB_ENV
- name: "Try generating the release notes"
run: |
# Version as indicated in the metadata, e.g., 3.2.5-rc
METADATA_VERSION=$(jq -r '.version' app/release_metadata.json)
# We only need the first part of the version, e.g. 3.2.5, for the milestone recognition. Split on the dash (-) character.
METADATA_ARRAY=(${METADATA_VERSION//-/ })
POTENTIAL_MILESTONE=${METADATA_ARRAY[0]}
echo "Will try to create changelog based on milestone ${POTENTIAL_MILESTONE} if it exists..."
# In case the Jar below fails, fall back to a default text
echo "MAUTIC_CHANGELOG=\"**Based on Mautic's version number (${POTENTIAL_MILESTONE}), we tried finding a milestone with the same name. We couldn't find it though. Make sure it exists (and re-run GitHub Actions) or add a changelog manually!**\"" >> $GITHUB_ENV
# Download changelog generator
wget -q https://github.com/spring-io/github-changelog-generator/releases/download/v0.0.5/github-changelog-generator.jar
# Copy of release-notes.yml to root folder needed, since the Jar can't read from hidden folders anymore (bug): https://github.com/Decathlon/release-notes-generator-action/pull/21
cp ./.github/release-notes.yml ./release-notes.yml
java -jar ./github-changelog-generator.jar --spring.config.location="./release-notes.yml" ${POTENTIAL_MILESTONE} mautic-changelog.txt || true
if [[ -f mautic-changelog.txt ]]; then
echo 'MAUTIC_CHANGELOG<<EOF' >> $GITHUB_ENV
cat mautic-changelog.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
fi
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down Expand Up @@ -282,4 +257,4 @@ jobs:
"${{ secrets.MAUTIC_INSTANCE_PASSWORD }}" \
"${{ env.MAUTIC_VERSION }}" \
4 \
"${{ github.workspace }}/${{ env.MAUTIC_VERSION }}.zip"
"${{ github.workspace }}/${{ env.MAUTIC_VERSION }}.zip"
2 changes: 1 addition & 1 deletion .github/workflows/split-monorepo-in-multi-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:

jobs:
sync:
if: github.repository_owner == 'mautic'
if: github.repository == 'mautic/mautic'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
50 changes: 30 additions & 20 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ jobs:
coverage: pcov
ini-values: pcov.directory=., pcov.exclude="~tests|themes|vendor~"

- name: add MySQL config file
run: |
mysqldump --version
mysqldump --print-defaults
cp .github/ci-files/.my.cnf ~/.my.cnf
mysqldump --print-defaults
- name: Set SYMFONY_ENV to test
run: echo "SYMFONY_ENV=test" >> $GITHUB_ENV

Expand All @@ -63,17 +70,6 @@ jobs:
composer validate
composer install --prefer-dist --no-progress --no-suggest
- name: Temp install Mautic first due to failing tests
env:
mysql_port: ${{ job.services.mysql.ports[3306] }}
mariadb_port: ${{ job.services.mariadb.ports[3306] }}
run: |
export DB_PORT_STRING="${{ matrix.db-types }}_port"
export DB_PORT=${!DB_PORT_STRING}
cp ./.github/ci-files/local.php ./app/config/local.php
php bin/console mautic:install --force http://localhost
- name: Run tests - database = ${{ matrix.db-types }}
run: |
export DB_PORT_STRING="${{ matrix.db-types }}_port"
Expand All @@ -88,15 +84,8 @@ jobs:
mysql_port: ${{ job.services.mysql.ports[3306] }}
mariadb_port: ${{ job.services.mariadb.ports[3306] }}

- name: Run Pipedrive tests separately due to bug
run: |
export DB_PORT_STRING="${{ matrix.db-types }}_port"
export DB_PORT=${!DB_PORT_STRING}
composer test -- plugins/MauticCrmBundle/Tests/Pipedrive
- name: Upload coverage report
if: ${{ matrix.php-versions == '7.4' && matrix.db-types == 'mysql' }}
if: ${{ matrix.php-versions == '7.4' && matrix.db-types == 'mysql' && github.repository == 'mautic/mautic' }}
uses: codecov/codecov-action@v2
with:
files: ./coverage.xml
Expand Down Expand Up @@ -124,7 +113,7 @@ jobs:
strategy:
fail-fast: false
matrix:
commands: ['PHPSTAN', 'CS Fixer', 'Rector']
commands: ['PHPSTAN', 'CS Fixer', 'Rector', 'scaffolded files mismatch', 'PHPStan baseline changes']

name: ${{ matrix.commands }}

Expand Down Expand Up @@ -163,6 +152,27 @@ jobs:
if [[ $cs_fix_files ]]; then
bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --dry-run --using-cache=no --show-progress=dots --diff $cs_fix_files
fi
elif [[ "${{ matrix.commands }}" == "scaffolded files mismatch" ]]; then
wget -q -O /tmp/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && chmod 755 /tmp/jq
/tmp/jq -r '.extra["mautic-scaffold"]["file-mapping"] | to_entries[] | "diff -q \(.key | sub("\\[(project|web)-root\\]";".")) app/\(.value)"' app/composer.json > diff_commands.sh
bash diff_commands.sh | tee /tmp/diff_command_output.txt
rm diff_commands.sh
if [[ $(wc -l </tmp/diff_command_output.txt) -ge 1 ]]; then
echo "some scaffolded files were not updated"
echo "Please apply the same changes in the files mentioned above"
exit 1
fi
elif [[ "${{ matrix.commands }}" == "PHPStan baseline changes" ]]; then
if [[ "${{ steps.changed-files.outputs.modified_files }}" == *"phpstan-baseline.neon"* ]]; then
stat=$(git diff --shortstat "origin/${{ github.base_ref }}" ${{ github.sha }} -- phpstan-baseline.neon)
echo $stat
regex="[0-9]+[[:space:]]insertion"
if [[ $stat =~ $regex ]]; then
echo "There are modifications (added or changed lines) to the phpstan-baseline.neon"
echo "Please fix the PHPStan errors instead of altering the baseline file"
exit 1
fi
fi
else
echo "Invalid command"
exit 1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
!.gitkeep
!.ddev
!.php-cs-fixer.php
!.github/ci-files/.my.cnf
.ddev/mautic-preference
/.ddev/docker-compose.host-docker-internal.yaml
!.gitpod.Dockerfile
Expand Down
12 changes: 6 additions & 6 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@
Require all denied
</FilesMatch>

# Except those whitelisted bellow.
<FilesMatch "^(index|index_dev|filemanager|upgrade)\.php$">
# Except those allowed below.
<If "%{REQUEST_URI} =~ m#^/(index|index_dev|upgrade/upgrade)\.php#">
Require all granted
</FilesMatch>
</If>
</IfModule>

# Fallback for Apache < 2.4
Expand All @@ -129,10 +129,10 @@
Deny from all
</FilesMatch>

# Except those whitelisted bellow.
<FilesMatch "^(index|index_dev|filemanager|upgrade)\.php$">
# Except those allowed below.
<If "%{REQUEST_URI} =~ m#^/(index|index_dev|upgrade/upgrade)\.php#">
Order allow,deny
Allow from all
</FilesMatch>
</If>
</IfModule>

3 changes: 3 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
* (which is required for Symfony 5).
*/
'no_alternative_syntax' => false,
'header_comment' => [
'header' => '',
],
])
->setFinder($finder);
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![codecov](https://codecov.io/gh/mautic/mautic/branch/features/graph/badge.svg)](https://codecov.io/gh/mautic/mautic)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-73-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-74-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

About Mautic
Expand Down Expand Up @@ -169,6 +169,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/nick-vanpraet"><img src="https://avatars.githubusercontent.com/u/7923739?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nick-vanpraet</b></sub></a><br /><a href="https://github.com/mautic/mautic/commits?author=nick-vanpraet" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/volha-pivavarchyk"><img src="https://avatars.githubusercontent.com/u/96085911?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Volha Pivavarchyk</b></sub></a><br /><a href="#userTesting-volha-pivavarchyk" title="User Testing">📓</a></td>
<td align="center"><a href="https://github.com/J-Light"><img src="https://avatars.githubusercontent.com/u/2544660?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nish Joseph</b></sub></a><br /><a href="https://github.com/mautic/mautic/commits?author=J-Light" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Damzoneuh"><img src="https://avatars.githubusercontent.com/u/44919863?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Damzoneuh</b></sub></a><br /><a href="https://github.com/mautic/mautic/commits?author=Damzoneuh" title="Code">💻</a></td>
</tr>
</table>

Expand Down
22 changes: 22 additions & 0 deletions app/assets/scaffold/files/example.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
!.htaccess
!.gitkeep
!.ddev
!.php-cs-fixer.php
!.github/ci-files/.my.cnf
.ddev/mautic-preference
/.ddev/docker-compose.host-docker-internal.yaml
!.gitpod.Dockerfile
!.gitpod.yml
!.ddev/commands/web/dd
.php_cs.cache
/.env
/composer.phar
Expand Down Expand Up @@ -79,13 +85,29 @@
!/media/images/.htaccess

/plugins/*
!/plugins/GrapesJsBuilderBundle
!/plugins/MauticCitrixBundle
!/plugins/MauticClearbitBundle
!/plugins/MauticCloudStorageBundle
!/plugins/MauticCrmBundle
!/plugins/MauticDynamicsBundle
!/plugins/MauticEmailMarketingBundle
!/plugins/MauticFocusBundle
!/plugins/MauticFullContactBundle
!/plugins/MauticGmailBundle
!/plugins/MauticOutlookBundle
!/plugins/MauticSocialBundle
!/plugins/MauticZapierBundle
!/plugins/MauticTagManagerBundle
!/plugins/index.html
!/plugins/.gitkeep

/themes/*
!/themes/aurora
!/themes/blank
!/themes/cards
!/themes/coffee
!/themes/confirmme
!/themes/fresh-center
!/themes/fresh-fixed
!/themes/fresh-left
Expand Down
12 changes: 6 additions & 6 deletions app/assets/scaffold/files/htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@
Require all denied
</FilesMatch>

# Except those whitelisted bellow.
<FilesMatch "^(index|index_dev|filemanager|upgrade)\.php$">
# Except those allowed below.
<If "%{REQUEST_URI} =~ m#^/(index|index_dev|upgrade/upgrade)\.php#">
Require all granted
</FilesMatch>
</If>
</IfModule>

# Fallback for Apache < 2.4
Expand All @@ -129,10 +129,10 @@
Deny from all
</FilesMatch>

# Except those whitelisted bellow.
<FilesMatch "^(index|index_dev|filemanager|upgrade)\.php$">
# Except those allowed below.
<If "%{REQUEST_URI} =~ m#^/(index|index_dev|upgrade/upgrade)\.php#">
Order allow,deny
Allow from all
</FilesMatch>
</If>
</IfModule>

Loading

0 comments on commit 30adfd9

Please sign in to comment.