Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/cachethq/core into 106-webh…
Browse files Browse the repository at this point in the history
…ooks
  • Loading branch information
danjohnson95 committed Jan 9, 2025
2 parents e99e3a2 + b385770 commit 909fb2d
Show file tree
Hide file tree
Showing 84 changed files with 712 additions and 441 deletions.
120 changes: 118 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
DB_USERNAME: cachet
DB_PASSWORD: password

postgres:
postgres13:
runs-on: ubuntu-latest

services:
Expand Down Expand Up @@ -155,6 +155,120 @@ jobs:
DB_USERNAME: cachet
DB_PASSWORD: password

postgres14:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:14
env:
POSTGRES_DB: cachet
POSTGRES_USER: cachet
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
fail-fast: false
matrix:
php: [ 8.3, 8.2 ]
laravel: [ 11.x ]
stability: [ prefer-lowest, prefer-stable ]

name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - PostgreSQL 14

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Install frontend dependencies
run: npm ci

- name: Build assets
run: npm run build

- name: Build tests environment
run: composer build

- name: Execute tests
run: composer test
env:
DB_CONNECTION: mysql
DB_HOST: localhost
DB_DATABASE: cachet
DB_USERNAME: cachet
DB_PASSWORD: password

postgres15:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15
env:
POSTGRES_DB: cachet
POSTGRES_USER: cachet
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
fail-fast: false
matrix:
php: [ 8.3, 8.2 ]
laravel: [ 11.x ]
stability: [ prefer-lowest, prefer-stable ]

name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - PostgreSQL 15

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Install frontend dependencies
run: npm ci

- name: Build assets
run: npm run build

- name: Build tests environment
run: composer build

- name: Execute tests
run: composer test
env:
DB_CONNECTION: mysql
DB_HOST: localhost
DB_DATABASE: cachet
DB_USERNAME: cachet
DB_PASSWORD: password

sqlite:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -199,7 +313,9 @@ jobs:
needs:
- static-analysis
- mysql
- postgres
- postgres13
- postgres14
- postgres15
- sqlite
runs-on: ubuntu-latest

Expand Down
62 changes: 31 additions & 31 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "cachethq/core",
"description": "Cachet core package.",
"license": "proprietary",
"keywords": [
"cachet",
"status page",
"laravel"
],
"homepage": "https://cachethq.io",
"license": "proprietary",
"support": {
"issues": "https://github.com/cachethq/core/issues",
"source": "https://github.com/cachethq/core"
},
"authors": [
{
"name": "James Brooks",
"email": "[email protected]"
}
],
"homepage": "https://cachethq.io",
"support": {
"issues": "https://github.com/cachethq/core/issues",
"source": "https://github.com/cachethq/core"
},
"require": {
"php": "^8.2",
"doctrine/dbal": "^3.6",
Expand Down Expand Up @@ -45,6 +45,8 @@
"pestphp/pest-plugin-laravel": "^3.0",
"pestphp/pest-plugin-livewire": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Cachet\\": "src",
Expand All @@ -54,38 +56,18 @@
},
"autoload-dev": {
"psr-4": {
"Cachet\\Tests\\": "tests",
"Cachet\\Database\\Factories\\": "database/factories",
"Cachet\\Tests\\": "tests",
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
}
},
"scripts": {
"post-autoload-dump": "@prepare",
"test": "vendor/bin/pest",
"canvas": "@php vendor/bin/canvas",
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": [
"@prepare",
"@clear",
"@php vendor/bin/testbench workbench:build"
],
"dev": [
"@build",
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php vendor/bin/testbench serve\" \"php vendor/bin/testbench queue:listen --tries=1\" \"php vendor/bin/testbench pail\" \"npm run dev\" --names=server,queue,logs,vite"
],
"start": [
"@dev"
]
},
"config": {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"sort-packages": true
},
"extra": {
"branch-alias": {
Expand All @@ -98,6 +80,24 @@
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
"scripts": {
"post-autoload-dump": "@prepare",
"build": [
"@prepare",
"@clear",
"@php vendor/bin/testbench workbench:build"
],
"canvas": "@php vendor/bin/canvas",
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"dev": [
"@build",
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php vendor/bin/testbench serve\" \"php vendor/bin/testbench queue:listen --tries=1\" \"php vendor/bin/testbench pail\" \"npm run dev\" --names=server,queue,logs,vite"
],
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"start": [
"@dev"
],
"test": "vendor/bin/pest"
}
}
1 change: 1 addition & 0 deletions resources/lang/en/cachet.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'section_heading' => 'Support Cachet',
'consider_supporting' => 'Please consider supporting Cachet via *GitHub Sponsors*.',
'keep_up_to_date' => 'Keep up to date with the latest news and releases by following the *Cachet blog*.',
'work_in_progress_text' => 'Cachet is under active development. Things are still subject to change.',
],
'powered_by' => 'Powered by',
'open_source_status_page' => 'The open-source status page.',
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
'items' => [
'status_page' => 'Status Page',
'documentation' => 'Documentation',
'discord' => 'Join Discord',
'sponsor' => 'Sponsor Cachet',
],
],
];
3 changes: 3 additions & 0 deletions resources/svg/discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/views/components/component-group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@if(($incidentCount = $componentGroup->components->sum('incidents_count')) > 0)
<span class="rounded border border-zinc-800 px-2 py-1 text-xs font-semibold text-zinc-800 dark:border-zinc-600 dark:text-zinc-400">
{{ trans_choice('cachet::componet_group.incident_count', $incidentCount) }}
{{ trans_choice('cachet::component_group.incident_count', $incidentCount) }}
</span>
@endif
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@if($showSupport)
<div class="flex items-center justify-center gap-2">
{{ __('cachet::cachet.powered_by') }}
<a href="https://cachethq.io" title="{{ __('cachet::cachet.open_source_stats_page') }}" rel="noopener" class="inline-flex items-center font-semibold transition hover:opacity-80">
<a href="https://cachethq.io" title="{{ __('cachet::cachet.open_source_status_page') }}" rel="noopener" class="inline-flex items-center font-semibold transition hover:opacity-80">
<x-cachet::logo class="hidden h-5 w-auto sm:block" />
<x-cachet::logomark class="h-5 w-auto sm:hidden" />
<span class="ml-2">{{ $cachetVersion }}</span>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/incident.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
</div>
</div>
@empty
<div class="bg-white border divide-y rounded-lg ml-9 dark:divide-zinc-700 dark:border-zinc-700 dark:bg-white/5">
<div class="bg-white border divide-y rounded-lg dark:divide-zinc-700 dark:border-zinc-700 dark:bg-white/5">
<div class="flex flex-col p-4 divide-y dark:divide-zinc-700">
<div class="prose-sm md:prose prose-zinc dark:prose-invert prose-a:text-accent-content prose-a:underline prose-p:leading-normal">
{{ __('cachet::incident.no_incidents_reported') }}
Expand Down
3 changes: 3 additions & 0 deletions resources/views/filament/widgets/support.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<p class="text-sm leading-6 text-gray-500 dark:text-gray-400">
{!! $keepUpToDate !!}
</p>
<p class="text-sm leading-6 text-gray-500 dark:text-gray-400 font-semibold">
{{ __('cachet::cachet.support.work_in_progress_text') }}
</p>
</x-filament::section>
</x-filament-widgets::widget>

4 changes: 2 additions & 2 deletions src/Actions/Component/CreateComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Cachet\Actions\Component;

use Cachet\Data\Component\CreateComponentData;
use Cachet\Data\Requests\Component\CreateComponentRequestData;
use Cachet\Models\Component;

class CreateComponent
{
/**
* Handle the action.
*/
public function handle(CreateComponentData $component): Component
public function handle(CreateComponentRequestData $component): Component
{
return Component::create($component->toArray());
}
Expand Down
4 changes: 2 additions & 2 deletions src/Actions/Component/UpdateComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Cachet\Actions\Component;

use Cachet\Data\Component\UpdateComponentData;
use Cachet\Data\Requests\Component\UpdateComponentRequestData;
use Cachet\Events\Components\ComponentStatusWasChanged;
use Cachet\Models\Component;

Expand All @@ -11,7 +11,7 @@ class UpdateComponent
/**
* Handle the action.
*/
public function handle(Component $component, UpdateComponentData $data): Component
public function handle(Component $component, UpdateComponentRequestData $data): Component
{
$oldStatus = $component->status;

Expand Down
4 changes: 2 additions & 2 deletions src/Actions/ComponentGroup/CreateComponentGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Cachet\Actions\ComponentGroup;

use Cachet\Data\ComponentGroup\CreateComponentGroupData;
use Cachet\Data\Requests\ComponentGroup\CreateComponentGroupRequestData;
use Cachet\Models\Component;
use Cachet\Models\ComponentGroup;

Expand All @@ -14,7 +14,7 @@ class CreateComponentGroup
/**
* Handle the action.
*/
public function handle(CreateComponentGroupData $data): ComponentGroup
public function handle(CreateComponentGroupRequestData $data): ComponentGroup
{
return tap(ComponentGroup::create(
$data->except('components')->toArray(),
Expand Down
4 changes: 2 additions & 2 deletions src/Actions/ComponentGroup/UpdateComponentGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Cachet\Actions\ComponentGroup;

use Cachet\Data\ComponentGroup\UpdateComponentGroupData;
use Cachet\Data\Requests\ComponentGroup\UpdateComponentGroupRequestData;
use Cachet\Models\Component;
use Cachet\Models\ComponentGroup;

Expand All @@ -11,7 +11,7 @@ class UpdateComponentGroup
/**
* Handle the action.
*/
public function handle(ComponentGroup $componentGroup, UpdateComponentGroupData $data): ComponentGroup
public function handle(ComponentGroup $componentGroup, UpdateComponentGroupRequestData $data): ComponentGroup
{
$componentGroup->update($data->except('components')->toArray());

Expand Down
Loading

0 comments on commit 909fb2d

Please sign in to comment.