Skip to content

Commit

Permalink
APPS-4767: Adjusted app workflow to improve it and to use Mini Framew…
Browse files Browse the repository at this point in the history
…ork. (#186)

* Updated ACP related stuff.

* Fixed tests

* Fixed tests

* Fixed tests
  • Loading branch information
stereomon authored Aug 19, 2022
1 parent 7a9cd55 commit 0832d3f
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
validation:
name: "CS, PHPStan, Security"
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 20 additions & 9 deletions config/packages/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ framework:
supports:
- SprykerSdk\SdkContracts\Entity\WorkflowInterface
initial_marking: start
places:
places: # states
- start
- app-skeleton
- manifest
Expand All @@ -50,8 +50,10 @@ framework:
- asyncapi
- asyncapi-validated
- asyncapi-generate
- install
- app-validate
- app-validated
- done
transitions:
CreateAppSkeleton:
from: start
Expand All @@ -78,7 +80,8 @@ framework:
to: acp-validated
metadata:
task: acp:app:validate
error: Now you need to fix manually and continue with the workflow afterwards.
error: Please fix the mentioned issues and re-run the workflow to continue.

CreateOpenApi:
from: acp-validated
to: openapi
Expand All @@ -89,12 +92,13 @@ framework:
to: openapi-validated
metadata:
task: acp:openapi:validate
error: Now you need to fix manually and continue with the workflow afterwards.
GenerateOpenApi:
error: Please fix the mentioned issues and re-run the workflow to continue.
GenerateOpenApiCode:
from: openapi-validated
to: app-validate
metadata:
task: acp:openapi:generate

CreateAsyncapi:
from: app-validate
to: asyncapi
Expand All @@ -105,16 +109,23 @@ framework:
to: asyncapi-validated
metadata:
task: acp:asyncapi:validate
error: Now you need to fix manually and continue with the workflow afterwards.
error: Please fix the mentioned issues and re-run the workflow to continue.
GenerateAsyncapiCode:
from: asyncapi-validated
to: asyncapi-generate
metadata:
task: acp:asyncapi:generate
ValidateApp:
from: [app-validate, app-validated, asyncapi-generate]

RunInstall:
from: [app-validate, asyncapi-generate]
to: app-validated
metadata:
task: acp:app:validate
error: Now you need to fix manually and continue with the workflow afterwards.
task: install

ValidateProject:
from: [app-validated, asyncapi-generate]
to: done
metadata:
task: pbc:validate
error: Please fix the mentioned issues and re-run the workflow to continue.

2 changes: 1 addition & 1 deletion src/Extension/Task/AcpAppAsyncApiCodeGenerateTask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ placeholders:
optional: true
configuration:
name: "organization"
description: "Path to AsyncAPI file"
description: "The namespace that will be used for code generation e.g. Pyz"
type: string
6 changes: 3 additions & 3 deletions src/Extension/Task/AcpAppOpenApiCodeGenerateTask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ placeholders:
optional: true
configuration:
name: "openapi-file"
description: "Namespace that should be used for the code builder. When set to Spryker code will be generated in the core modules"
description: "Path to OpenAPI file"
type: string
- name: "%organization%"
value_resolver: OPTION
optional: true
configuration:
name: "organization"
description: "Path to AsyncAPI file"
description: "The namespace that will be used for code generation e.g. Pyz"
type: string
- name: "%application-type%"
value_resolver: OPTION
optional: true
configuration:
name: "application-type"
description: "Application type"
description: "Application type e.g. JSON"
type: string
2 changes: 1 addition & 1 deletion src/Extension/Task/AppValidationTaskSet.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: "acp:app:validate"
id: "pbc:validate"
short_description: "Validates your php code using different approaches like codestyle, architecural and static analysis"
help: "Validates your php code using different approaches like codestyle, architecural and static analysis"
stage: build
Expand Down
2 changes: 1 addition & 1 deletion src/Extension/Task/CodesnifferFixerTask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ placeholders:
optional: true
configuration:
name: 'severity'
description: 'Severity level'
description: 'Severity level of the CodeSniffer'
- name: "%config%"
value_resolver: CONFIG_PATH
optional: true
Expand Down
2 changes: 1 addition & 1 deletion src/Extension/Task/CodesnifferTask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ placeholders:
optional: true
configuration:
name: 'severity'
description: 'Severity level'
description: 'Severity level of the CodeSniffer'
report_converter:
name: CheckstyleViolationReportConverter
configuration:
Expand Down
2 changes: 1 addition & 1 deletion src/Extension/Task/PhpMdTask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ placeholders:
optional: false
configuration:
name: "priority"
description: "Minimal priority of rules to fail the validation"
description: "Minimal PHPMD priority of rules to fail the validation"
minValue: 1
maxValue: 10
defaultValue: 2
Expand Down
8 changes: 8 additions & 0 deletions src/Extension/Task/RunInstallTask.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
id: "install"
short_description: "Runs Sprykers install command."
help: ~
stage: build
version: 0.1.0
command: "php ./vendor/bin/install"
type: local_cli
2 changes: 1 addition & 1 deletion src/Extension/ValueResolver/AppTypeValueResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AppTypeValueResolver extends AbstractValueResolver
* @var array
*/
protected const REPOSITORIES = [
'boilerplate' => 'https://github.com/spryker/project-boilerplate',
'boilerplate' => 'https://github.com/spryker-projects/mini-framework',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testGetValueIfEmpty(): void
{
// Arrange
$repositories = [
'boilerplate' => 'https://github.com/spryker/project-boilerplate',
'boilerplate' => 'https://github.com/spryker-projects/mini-framework',
];
$receiverValue = new ReceiverValue(
'App template to use for creation',
Expand All @@ -63,6 +63,6 @@ public function testGetValueIfEmpty(): void
$value = $valueResolver->getValue($this->context, []);

// Assert
$this->assertSame('https://github.com/spryker/project-boilerplate', $value);
$this->assertSame('https://github.com/spryker-projects/mini-framework', $value);
}
}

0 comments on commit 0832d3f

Please sign in to comment.