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

Run some workflows only in pimcore repos #606

Draft
wants to merge 8 commits into
base: 1.6
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

jobs:
cla-workflow:
uses: pimcore/workflows-collection-public/.github/workflows/reusable-cla-check.yaml@v1.3.0
uses: pimcore/workflows-collection-public/.github/workflows/reusable-cla-check.yaml@cstest
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
secrets:
CLA_ACTION_ACCESS_TOKEN: ${{ secrets.CLA_ACTION_ACCESS_TOKEN }}

7 changes: 2 additions & 5 deletions .github/workflows/codeception.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main
uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@cstest
with:
APP_ENV: test
PIMCORE_TEST: 1
Expand All @@ -86,7 +86,4 @@ jobs:
SERVER_VERSION: ${{ matrix.matrix.server_version }}
DEPENDENCIES: ${{ matrix.matrix.dependencies }}
EXPERIMENTAL: ${{ matrix.matrix.experimental }}
PIMCORE_VERSION: ${{ matrix.matrix.pimcore_version }}
secrets:
SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER: ${{ secrets.SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER }}
COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN: ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }}
PIMCORE_VERSION: ${{ matrix.matrix.pimcore_version }}
9 changes: 2 additions & 7 deletions .github/workflows/php-cs-fixer.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
name: "PHP-CS-Fixer"

on:
workflow_dispatch:
push:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
- "*_actions"
- "feature-*"
pull_request_target:
types: [ opened,closed,synchronize ]

permissions:
contents: write

jobs:
php-style:
uses: pimcore/workflows-collection-public/.github/workflows/reusable-php-cs-fixer.yaml@main
secrets:
PHP_CS_FIXER_GITHUB_TOKEN: ${{ secrets.PHP_CS_FIXER_GITHUB_TOKEN }}
uses: pimcore/workflows-collection-public/.github/workflows/reusable-php-cs-fixer.yaml@cstest
with:
head_ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
config_file: .php-cs-fixer.dist.php
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ on:

jobs:
call-stale-workflow:
uses: pimcore/workflows-collection-public/.github/workflows/stale.yml@v1.1.0
uses: pimcore/workflows-collection-public/.github/workflows/stale.yml@cstest
7 changes: 2 additions & 5 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
uses: pimcore/workflows-collection-public/.github/workflows/reusable-static-analysis-centralized.yaml@main
uses: pimcore/workflows-collection-public/.github/workflows/reusable-static-analysis-centralized.yaml@cstest
with:
APP_ENV: test
PIMCORE_TEST: 1
Expand All @@ -89,7 +89,4 @@ jobs:
DEPENDENCIES: ${{ matrix.matrix.dependencies }}
EXPERIMENTAL: ${{ matrix.matrix.experimental }}
PIMCORE_VERSION: ${{ matrix.matrix.pimcore_version }}
COMPOSER_OPTIONS: ${{ matrix.matrix.composer_options }}
secrets:
SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER: ${{ secrets.SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER }}
COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN: ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }}
COMPOSER_OPTIONS: ${{ matrix.matrix.composer_options }}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"cbschuld/browser.php": "^1.9.6",
"phpoffice/phpspreadsheet": "^1.24 || ^2.1",
"pimcore/pimcore": "^11.3.0",
"pimcore/pimcore": "~11.3.0",
"symfony/webpack-encore-bundle": "^1.13.2"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/DataObject/DataObjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static function (Task $task) {

try {
$this->getDataForObject($object, $objectFromVersion);
} catch(\Throwable $e) {
} catch (\Throwable $e) {
$object = $objectFromDatabase;
$this->getDataForObject($object, false);
}
Expand Down Expand Up @@ -1352,7 +1352,7 @@ public function saveAction(Request $request): JsonResponse
if ($request->get('data')) {
try {
$this->applyChanges($object, $this->decodeJson($request->get('data')));
} catch(\Throwable $e) {
} catch (\Throwable $e) {
$this->applyChanges($objectFromDatabase, $this->decodeJson($request->get('data')));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function doGetGridColumnConfig(Request $request, Config $config, bool $is
$setAsFavourite = $savedGridConfig->isSetAsFavourite();
$saveFilters = $savedGridConfig->isSaveFilters();

foreach($gridConfig['columns'] as &$column) {
foreach ($gridConfig['columns'] as &$column) {
if (array_key_exists('isOperator', $column) && $column['isOperator']) {
$colAttributes = &$column['fieldConfig']['attributes'];
SecurityHelper::convertHtmlSpecialCharsArrayKeys($colAttributes, ['label', 'attribute', 'param1']);
Expand Down Expand Up @@ -1179,7 +1179,7 @@ public function getExportJobsAction(Request $request, GridHelperService $gridHel
//prepare fields
$fieldnames = [];
$fields = json_decode($allParams['fields'][0], true);
foreach($fields as $field) {
foreach ($fields as $field) {
$fieldnames[] = $field['key'];
}
$allParams['fields'] = $fieldnames;
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/ElementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ public function getRequiresDependenciesAction(Request $request): JsonResponse
'requires' => [], // Initialize 'requires' as an empty array
];

if(count($elements) > 0) {
if (count($elements) > 0) {
$result = Model\Element\Service::getFilterRequiresForFrontend($elements);
$result['total'] = count($result['requires']);

Expand Down Expand Up @@ -765,7 +765,7 @@ public function getRequiredByDependenciesAction(Request $request): JsonResponse
'requiredBy' => [], // Initialize 'requiredBy' as an empty array
];

if(count($elements) > 0) {
if (count($elements) > 0) {
$result = Model\Element\Service::getFilterRequiredByPathForFrontend($elements);
$result['total'] = count($result['requiredBy']);

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Admin/MiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function jsonTranslationsSystemAction(Request $request, TranslatorInterfa
public function scriptProxyAction(Request $request): Response
{
$storageFile = $request->get('storageFile');
if(!$storageFile) {
if (!$storageFile) {
throw new \InvalidArgumentException('The parameter storageFile is required');
}

Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,10 @@ protected function getGridFilterCondition(Request $request, string $tableName, b
];
}

if(!empty($conditionFilters)) {
if (!empty($conditionFilters)) {
$conditions = [];
$params = [];
foreach($conditionFilters as $conditionFilter) {
foreach ($conditionFilters as $conditionFilter) {
$conditions[] = $conditionFilter['condition'];
$params[$conditionFilter['field']] = $conditionFilter['value'];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/GridHelperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ public function prepareListingForGrid(array $requestParams, string $requestedLan
if (isset($requestParams['filter_by_object_type'])) {
if ($requestParams['filter_by_object_type'] === 'only_objects') {
$list->setObjectTypes([DataObject::OBJECT_TYPE_OBJECT]);
} elseif($requestParams['filter_by_object_type'] === 'only_variant_objects') {
} elseif ($requestParams['filter_by_object_type'] === 'only_variant_objects') {
$list->setObjectTypes([DataObject::OBJECT_TYPE_VARIANT]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/PreviewGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function getSitePreviewConfig(Concrete $object): array
$domains = $site->getDomains();
array_unshift($domains, $site->getMainDomain());

if(is_null($preSelectedSite) && in_array(Tool::getHostname(), $domains)) {
if (is_null($preSelectedSite) && in_array(Tool::getHostname(), $domains)) {
$preSelectedSite = $sitesOptions[$label];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/System/AdminConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function get(): array

// If the read target is settings-store and no data is found there,
// load the data from the container config
if(!$data && $loadType === $repository::LOCATION_SETTINGS_STORE) {
if (!$data && $loadType === $repository::LOCATION_SETTINGS_STORE) {
$containerConfig = \Pimcore::getContainer()->getParameter('pimcore_admin.config');
$data[self::BRANDING] = $containerConfig[self::BRANDING];
$data[self::ASSETS] = $containerConfig[self::ASSETS];
Expand Down