Commit graph

44 commits

Author SHA1 Message Date
Chuck Adams
3530150f03
add some generic composer scripts to wrap pint and phpstan 2025-07-25 09:24:53 -06:00
Chuck Adams
0da3a64188
make downloads redirect to local file (#276) 2025-06-13 14:48:12 -06:00
Chuck Adams
e380b0e815
Replace spatie/laravel-data with dshafik/bag (#218)
* deps: add dshafik/bag

* refactor: create Bag equivalents of Data classes

* zap: nuke the ill-conceived PluginProps/ThemeProps

* deps: remove spatie/laravel-data

* fix: comment out ignoreErrors pattern

* tweak: we don't use a baseline
2025-03-31 19:28:42 -06:00
Chuck Adams
c7bc95191a
Improve test coverage (#217)
* fix(test): use pg_trgm if not exists

* test: add test for /core/importers

* test: add test for gp-icon and theme screenshot download

* test: inline most test assertion functions into assertExactJson

* test: add hot tags tests

* test: add plugin updates tests

* test: 100% coverage of download routes

* test: 100% coverage of plugin update controller

* test: 100% coverage of all api controllers

* fix: make PassThroughController drop unexpected requests

* refactor: rm special case for / in PassThroughController

* test: auto-fake facades

* test: test PassThroughController for 100% coverage on Controllers

* test: drop auto-fakes because facades are made of hate

* zap: rm unused build-container-images action

* test: add test for AssetCacheHit event

* deps: composer upgrade and bump
2025-03-31 12:53:25 -06:00
Chuck Adams
b6071cd303
hack: silence type errors around BelongsToMany (#207) 2025-03-18 16:57:39 -06:00
Chuck Adams
6f134a9d3d
Update to Laravel 12 (#202)
* deps: update phpstan and related packages

* deps: update roave/security-advisories

* deps: upgrade thecodingmachine/safe

* deps: update inertiajs/inertia-laravel

* chore: update to laravel 12

* qa: fix or suppress new phpstan warnings

* style: pint
2025-03-17 18:00:10 -06:00
Chuck Adams
e3bb766b61
minor tweaks ahead of upgrades (#198)
* zap: drop redundant caching middleware

* fix: make PluginFactory generate proper versions format

* refactor: use $this->get directly instead of makeApiRequest

* ci: pin action versions in dependency-review action (irony)

Admittedly if actions/checkout is ever compromised, it's game over anyway.

* ci: make OSSF scorecard action manual-only

* ci: pin all runners onto ubuntu-24.04

* test: inline the sole use of assertWpPluginAPIStructure

* meta: add github-actions to dependabot

* build: composer upgrade and bump
2025-03-17 15:02:02 -06:00
Chuck Adams
4c77cad43b
build: we are now a yarn shop (#187) 2025-03-15 13:40:34 -06:00
Chuck Adams
dec19a77ee
configure mailgun (#142)
* deps: require symfony/mailgun-mailer

* config: configure mailgun
2025-01-23 08:09:20 -07:00
Chuck Adams
facf90cb30
Drop GrumPHP, switch house style to PER-CS, and use Pint (#135)
* chore: replace php-cs-fixer with laravel pint

* style: run pint

* fix: remove grumphp entirely
2025-01-19 20:18:34 -07:00
Chuck Adams
35b967b124
Repo Admin API (#123)
* fix: switch redis driver to predis because laravel is hopeless

* chore: add spatie/laravel-permission

* build: composer update and bump

* style: death to captain obvious (zap laravel's banner comments)

* feat: initial roles and perms

* chore: assign User role on User created

* refactor: rename 'aspire_press' config key to 'aspirecloud'

* feat: require json content-type on admin api routes

* chore: implement BulkImport endpoint

* chore: give RepoAdmin users BulkImport permissions

* docs: update README
2024-12-28 15:57:51 -07:00
Chuck Adams
ef6ba4e584
gardening: dependency updates, more tests (#108)
* fix: rm last vestiges of SyncPlugin

* refactor: move Sanctum tests into their own dir

* tests: zap example tests

* test: break helpers out into the tests/Helpers dir

* build: composer bump

* refactor: rm unused TranslationData class

* build: run composer update since bump does not (WTF)

* refactor: move docker app from /var/www/html to /app

this is the de facto standard for docker apps, and it makes config much simpler if we follow it

* build: upgrade dockerfiles to composer 2.8

* build: tweak composer invocation for prod

* tests: rm placeholder that never got filled out

* tests: write tests for sync themes/plugins

* tests: put back dummy unit test because pest freaks out w/ an empty dir

* tests: rm copypasta from SyncThemeTest

* build: bump after update, silly, not before
2024-11-23 09:52:02 -07:00
Chuck Adams
be1660cce5
New plugin/theme loading system (#104)
* feat: add ClosedPlugin model

* fix: don't chop line if it doesn't end with \n

* build: rm unused robmorgan/phinx dependency

* chore: rm all App\Models\Sync classes

* feat: new unified plugin and theme loader

* docs: update README.md

* fix: fix or suppress phpstan warnings

* docs: fix dump commands in readme

* feat: add ac_origin column to all resource tables

* chore: add ac_* columns including ac_raw_metadata

we used to point to the raw metadata in the corresponding SyncPlugin/SyncTheme record, but that's gone.  thus, adding it as a column.

* chore: mark eloquent properties as readonly in phpdoc

* fix: drop bogus HasFactory from Author
2024-11-21 11:26:52 -07:00
Chuck Adams
06c8edaab7
Add Laravel Telescope (#101) 2024-11-11 16:44:41 -07:00
Chuck Adams
0c57cba2f0
add Laravel queue worker service, use events to dispatch jobs (#100) 2024-11-11 15:33:47 -05:00
Enrique Chavez
6b1e372387
Dev/assets download (#97)
* wip: Download Assets

- Added migration
- Added enum class to handle AssetTypes
- Added placeholder controllers

* wip: Factory and routes

* wip: DownloadService and Plugin implementation

- Added DownloadService to handle all the downloads types
- Added DownloadPluginController implementation
- Fix Asset model name and location

* wip: DownloadAsset Job and support core versions

- Added DownloadAsset Job
- Show assets and download zip files logic
- Add the downloas endpoints to the excludedRoutes on the cache system
- Add predis to use redis on the Queue system

* wip: Change properties to public to access them on tests

* feat: Download Assets ready for test

* fix: Fixed the issues mentioned in the PR

- Better naming and I would vote for uppercase enums; we can discuss this later.
- Exception comments removed
- $matches[1] named using variables
- Added prefix `/download` to the routes
- Removed the stream logic, and now local and upstream use redirects to the file
- Added `repository` and `timestamp` fields to the `assets` table
- Removed the SerializesModels trait from the Job class
- Tests update
2024-11-08 21:51:07 -07:00
Chuck Adams
0a3b4700dd
build improvements and fixes (#85) 2024-11-02 01:53:33 -04:00
Chuck Adams
0e100a50bc
fix: truncate strings with mb_substr instead of substr (#83)
* fix: truncate strings with mb_substr instead of substr

* build: require ext-mbstring extension
2024-11-01 18:35:27 -06:00
Enrique Chavez
8dca069dec
User Management and API Keys (#84)
* feat: Changes required on existing files to setup Jetstream

* feat: add the Inertia Home and Dashboard

* feat: Add all required files and migrations to setup Jetstream

* feat: Add the Sanctum middleware to the API endpoints

- Added Sanctum to the API endpoints to requiere an API Key
- Added a setting to control if the app should use authenticated API or not (see .env.example)
- Fix redirection on API routes to the login page when a request was unauthenticated

* feat: Users Management and Authication API Keys

- Refactor existing tests to make authenticated request is enable
- Hide the permissions setting on the UI, for now we only have a read-only API
- Add tests to test authenticated and unauthenticated calls
2024-11-01 18:30:03 -06:00
Chuck Adams
7ff3abc82b
add commands to populate plugin/theme models (#77)
* feat: add spatie/laravel-web-tinker

* feat: add Theme::createFromSyncTheme

* feat: add Theme::updateFromSyncTheme

* chore: add files() relationship to SyncPlugin and SyncTheme

* feat: new command: db:themes:populate

* feat: db:populate:plugins command

* fix: add testing db config

* test: add bruno test for query_themes action

* fix: change 'any' route to get|post in api.php

* test: fix bruno tests, rm redundant ones in root

* build: add test-bruno makefile target
2024-10-29 14:04:33 -06:00
Chuck Adams
4fd07ea9b1
New Plugins and Themes tables built from AspireSync data (#65)
* chore: rename sync tables to use sync_ prefix

* feat: migration for new plugins table

* chore: create themes table migration

* refactor: move sync models to new names and subdir

* refactor: move Plugin and Theme models to App\Models\WpOrg

* feat: use parallel tasks in php-cs-fixer

* format: keep attributes on their own lines

* fix: use sync_themes for stub search
2024-10-26 14:07:26 -06:00
Chuck Adams
432752e78c feat: add roave/security-advisories 2024-10-19 11:33:15 -06:00
Chuck Adams
01cf4370e0 build: trim unused composer deps 2024-10-19 11:32:39 -06:00
Chuck Adams
428b88243a feat: add and use thecodingmachine/safe 2024-10-19 11:05:27 -06:00
Chuck Adams
b4d3e59697 build: add spatie/laravel-data 2024-10-19 09:57:55 -06:00
Chuck Adams
c19c1c0f8b
use php-cs-fixer for formatting (#29)
* fix(build): rm key:generate in check-env target

The docker container is guaranteed to not be running at this point.  keygen happens last in the process.

* qa: switch from pint to php-cs-fixer

* ci: use make in run-checks action

* ci: run checks directly on the gh runner instance

* ci: use shivammathur/setup-php@v2

* style: run make fix

* ci: add unit tests to run-checks action
2024-10-19 09:42:52 -06:00
Sarah Savage
5e6f473d4d
Merging Laravel into main (#27)
* refactor: wipe out mezzio installation prior to installing Laravel

* refactor: install laravel

* fix: push attic'd composer.json that didn't make it into commit

* Adding several improvements (#23)

* Added improvements around Phinx and migrations
* Created Franken as our main PHP source
* Rewrote the Makefile to use the CLI and work properly

* build: regenerate lockfile

* fix(build): move migrations to require-dev so laravel doesnt choke on it

* feat: add mailhog service

* chore: tweak sample config

* fix: port make targets around db and migrations

* temp: add phinx migrations to attic

* fix: fix make list target formatting

* chore: port initial schema migration

* chore: roll in remaining migrations

* chore: publish cors config

* temp: rm the rest of .ATTIC

* Minor changes to provide correct settings for dev enviornment (#24)

* Removed the .env file from the Docker configuration so its read
locally and changes to it are immediately reflected.
* Updated the DB name in the Docker configuration

* fix: add correct DB environment vars to .env.example

* fix: api.aspirepress.local -> api.aspirecloud.local in docker-compose.yml

* feat: add generate-key target to Makefile

* feat: add stub api routes file

* Adding quality tools and fixing coding style

* Added Pint for CS fixing
* Added Larastan for code quality and set Level 6 with a baseline
* Fixed minor style issues

* Updating running checks to build the CLI container and then the Makefile with Pest

* Fixing a style issue detected

* Generating app key for tests

Note that eventually we'll have to pass a host of config vars to
effectively test the Laravel instance. That's TBD for later.

* Add Catch All handler (#25)

* fix: rm catchall route in api.php

* style: fix style to make pint happy

* Populating the .env file if it doesn't exist

* fix: give phpstan proper args in check target

* fix: phpstan qa issues

---------

Co-authored-by: Chuck Adams <cja987@gmail.com>
Co-authored-by: Matthew Zalewski <matthew@minion.co.nz>
2024-10-19 07:32:17 -06:00
Sarah Savage
08c31259fb Migrations are now a Composer package 2024-10-14 15:55:13 -04:00
Sarah Savage
950045ef0f Adding CORS configuration 2024-10-13 11:40:31 -04:00
Sarah Savage
c39747f07b Improvements and upgrades
* Making the .env and .env.dist files part of the webapp container
to ensure that they are loaded by default.
* Upgrading Composer dependencies.
* Removing vlucas/dotenv because it's not needed anymore with us
loading env values directly into the container.
2024-10-10 07:43:50 -04:00
Sarah Savage
72f66182e8 Updating naming to follow our conventions 2024-10-10 07:39:46 -04:00
Sarah Savage
1968f98972 Updating documentation 2024-10-07 04:40:37 -04:00
Sarah Savage
8509588beb Adding a catch-all handler for requests we pass thru to the WP API 2024-09-29 05:59:35 -04:00
Sarah Savage
d4f9498930 Adding entities and tests for version comparison 2024-09-28 06:01:16 -04:00
Sarah Savage
fca443bf41 Initial work on an endpoint 2024-09-28 04:51:47 -04:00
Sarah Savage
0ab596348b Finishing setup of API dev env 2024-09-27 18:07:05 -04:00
Sarah Savage
663ac6b36e Wiring up the functional test components for database access. 2024-04-29 07:52:40 -04:00
Sarah Savage
fc53a0c658 Adding migrations by default. 2024-04-29 07:38:11 -04:00
Sarah Savage
1623cdcfc3 Updating Makefile and including a new coding standard. 2024-04-26 16:13:57 -05:00
Sarah Savage
03f21c1a1a Add ramsey/repl as a dependency. 2024-04-26 15:58:14 -05:00
Sarah Savage
c899c8f8ad Requiring strict_types and adding it according to our style preferences. 2023-05-19 09:45:22 -04:00
Sarah Savage
a68deb1dd0 Adding PHPCS, configuring, and applying formatting. 2023-05-19 09:02:17 -04:00
Sarah Savage
dd4e118b48 Updating skeleton to reflect more modern dependencies/methodologies. 2023-05-06 09:07:35 -04:00
Brandon Savage
63686360bc
Initial commit. 2022-11-22 15:19:13 -05:00