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

[WIP] Visualize Actions, Achievements and Validators #229 #230

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ RUN apt -y update && \
apt install -y \
libicu-dev \
libxml2-dev \
zlib1g-dev && \
zlib1g-dev \
graphviz && \
docker-php-ext-install \
pdo_mysql \
intl \
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"snc/redis-bundle": "~2.0.6",
"symfony/symfony": "~4.0",
"symfony/monolog-bundle": "~3.1|~4.0",
"symfony/swiftmailer-bundle": "^3.1|~4.0"
"symfony/swiftmailer-bundle": "^3.1|~4.0",
"graphp/graphviz": "^0.2.1"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "~3.0|~4.0",
Expand Down
167 changes: 152 additions & 15 deletions composer.lock

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

4 changes: 4 additions & 0 deletions config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ ApiBundle:
resource: "@Api/Resources/config/routing.yml"
prefix: /api

IntegrationBundle:
resource: "@Integration/Resources/config/routing.yml"
prefix: /integration

WebhookBundle:
resource: "@Webhook/Resources/config/routing.yml"
prefix: /webhook
Expand Down
6 changes: 5 additions & 1 deletion integration/example/bitbucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ integration:
pullrequest-opened:
label: Pull request opened
description: ...
imageUrl: 'https://avatars.dicebear.com/v2/identicon/3968.svg'
pullrequest-reviewed:
label: Pull request reviewed
description: ...
imageUrl: 'https://avatars.dicebear.com/v2/identicon/3968.svg'
pullrequest-merged:
label: Pull request merged
description: ...
imageUrl: 'https://avatars.dicebear.com/v2/identicon/3968.svg'

achievements:
pull-request-streak-badge:
label: Code-aholic
description: Perform three times an action on any pull request. Can be awarded multiple times.
points: 50
actions: [pullrequest-opened, pullrequest-reviewed, pullrequest-merged]
imageUrl: 'https://avatars.dicebear.com/v2/identicon/3968.svg'

validators:
pull-request-streak-validator:
Expand Down Expand Up @@ -52,4 +56,4 @@ integration:
arguments:
- username
-
sveneisenschmidt: alex.doe
sveneisenschmidt: alex.doe
11 changes: 8 additions & 3 deletions integration/example/jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,39 @@ integration:
issue-created:
label: Create an issue
description: ...
imageUrl: 'https://avatars.dicebear.com/v2/identicon/3968.svg'
issue-updated:
label: Update an issue
description: ...
imageUrl: 'https://avatars.dicebear.com/v2/identicon/3968.svg'
issue-closed:
label: Close an issue
description: ...
imageUrl: 'https://avatars.dicebear.com/v2/identicon/3968.svg'

achievements:
issue-action-streak-badge:
label: Issue-maniac!
description: Work with issues en mass.
points: 50
actions: [issue-created, issue-updated, issue-closed]
imageUrl: 'https://avatars.dicebear.com/v2/identicon/3968.svg'

validators:
issue-action-streak-validator:
type: expression
arguments:
- "actions.count()%10 == 0" # expression
- ['issue-action-streak-badge'] # supported achievements
- "actions.count()/10" # expression
- [issue-action-streak-badge] # supported achievements
- true # multiple: true

webhooks:
incoming_processors:
jira:
type: chain
arguments:
- [ jira-payload, jira-actions, jira-users ]
- [jira-payload, jira-actions, jira-users]
# The JiraProcessor brings an optional way to interpret payloads further
# to map actions e.g. a updated task can be also an closed task, in this particular case
# the processor should set the action jira.issue_closed instead of another action if
Expand All @@ -59,4 +64,4 @@ integration:
arguments:
- username
-
sveneisenschmidt: alex.doe
sveneisenschmidt: alex.doe
1 change: 1 addition & 0 deletions src/App/Api/EventListener/KernelExceptionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function __construct(ResponseSerializer $serializer)

public function onKernelException(GetResponseForExceptionEvent $event)
{
return;
$exception = $event->getException();
$response = $this->serializer->createResponse([
'exception' => get_class($exception),
Expand Down
Loading