Skip to content

Commit

Permalink
Move jira test parameter to services.yaml
Browse files Browse the repository at this point in the history
Can not be resolved from the env. As we need to know what the value is
during compile time
  • Loading branch information
MKodde committed Jan 5, 2023
1 parent c77f580 commit a4adf2c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 61 deletions.
15 changes: 4 additions & 11 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,15 @@ mail_from=support@surfconext.nl
mail_receiver=support@surfconext.nl
mail_no_reply=no-reply@surfconext.nl

# When 'jira_enable_test_mode' is enabled (in services.yaml), 'jira_test_mode_storage_path'
# must be configured with a filename in a directory that is writable for the user run ning the application.
jira_test_mode_storage_path: "../var/issues.json"

# Jira settings
JIRA_HOST='https://jira.example.com'
JIRA_USER=sp-dashboard
JIRA_PASS=secret

# By enabling 'jira_enable_test_mode', no real Jira backend is required to still simulate the Jira integration
#jira_enable_test_mode=true

# When 'jira_enable_test_mode' is enabled, 'jira_test_mode_storage_path' must be configured with a filename in a directory that is writable for the user run ning the application.

# By enabling 'jira_enable_test_mode', no real Jira backend is required to still simulate the Jira integration
jira_enable_test_mode=true

# When 'jira_enable_test_mode' is enabled, 'jira_test_mode_storage_path' must be configured with a filename in a directory that is writable for the user run ning the application.
jira_test_mode_storage_path=../var/issues.json

# Jira default issue settings
jira_issue_priority=Medium
jira_issue_type=spd-delete-production-entity
Expand Down
8 changes: 4 additions & 4 deletions assets/scss/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ $fa-font-path: "../fonts";
@import "fonts/roboto";

@import "vars";
@import "utilities/*";
@import "./utilities/*";

@import "base/*";
@import "components/*";
@import "pages/*";
@import "./base/*";
@import "./components/*";
@import "./pages/*";
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"description": "Dashboard application for SURFconext Service Providers",
"license": "Apache-2.0",
"type": "project",
"autoload": {
"psr-4": {
"Surfnet\\": "src/Surfnet"
},
"classmap": [
"src/Surfnet/ServiceProviderDashboard/Kernel.php"
]
},
"require": {
"php": "8.1.*",
"ext-ctype": "*",
Expand Down Expand Up @@ -142,9 +150,6 @@
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": null
}
}
2 changes: 2 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
parameters:
locale: en
router.request_context.base_url: ''
# By enabling 'jira_enable_test_mode', no real Jira backend is required to still simulate the Jira integration
jira_enable_test_mode: true

services:
# default configuration for services in *this* file
Expand Down
43 changes: 0 additions & 43 deletions src/Surfnet/ServiceProviderDashboard/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,9 @@
namespace Surfnet\ServiceProviderDashboard;

use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder;

class Kernel extends BaseKernel
{
use MicroKernelTrait;

private const CONFIG_EXTS = '.{php,xml,yaml,yml}';

public function registerBundles(): iterable
{
$contents = require $this->getProjectDir().'/config/bundles.php';
foreach ($contents as $class => $envs) {
if ($envs[$this->environment] ?? $envs['all'] ?? false) {
yield new $class();
}
}
}

public function getProjectDir(): string
{
return \dirname(__DIR__ . "/../../../../");
}

protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
$container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));
$container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || $this->debug);
$container->setParameter('container.dumper.inline_factories', true);
$confDir = $this->getProjectDir().'/config';

$loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
}

protected function configureRoutes(RouteCollectionBuilder $routes): void
{
$confDir = $this->getProjectDir().'/config';

$routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');
}
}

0 comments on commit a4adf2c

Please sign in to comment.