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

openapi #852

Merged
merged 113 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
d585f6e
remove swagger stuff
narcoticfresh Feb 9, 2024
6ab70ca
remove swagger stuff
narcoticfresh Feb 9, 2024
6c15003
better use
narcoticfresh Feb 9, 2024
ce7fe68
try to derelease more
narcoticfresh Feb 9, 2024
4681bb5
try to derelease more
narcoticfresh Feb 9, 2024
eb41ee5
first wave of changes
narcoticfresh Feb 9, 2024
b1c5f6c
consolidate
narcoticfresh Feb 9, 2024
e436685
more cleanup, start to validate
narcoticfresh Feb 9, 2024
c738574
add validator
narcoticfresh Feb 9, 2024
46495e3
add validator
narcoticfresh Feb 9, 2024
bf510ae
progress
narcoticfresh Feb 10, 2024
ccfdb7c
progress
narcoticfresh Feb 11, 2024
ecd1e90
progress
narcoticfresh Feb 12, 2024
964e7d1
progress
narcoticfresh Feb 12, 2024
c3446b5
models
narcoticfresh Feb 12, 2024
59fbe91
main controller
narcoticfresh Feb 12, 2024
4352d10
AppControllerTest is green
narcoticfresh Feb 12, 2024
1b45a55
some other schemas
narcoticfresh Feb 12, 2024
826e8f7
fix regex?
narcoticfresh Feb 13, 2024
fad4329
Merge remote-tracking branch 'origin/develop' into feature/openapi
narcoticfresh Feb 13, 2024
07698d5
remove more stuff
narcoticfresh Feb 13, 2024
25a1c57
fix generator tests
narcoticfresh Feb 13, 2024
9095f78
more changes
narcoticfresh Feb 19, 2024
6f49513
Merge branch 'develop' into feature/openapi
narcoticfresh Feb 20, 2024
5e7cf9c
more and more changes
narcoticfresh Feb 20, 2024
3454595
restbundle tests green
narcoticfresh Feb 20, 2024
219e22b
more progress
narcoticfresh Feb 20, 2024
ab3e93a
i18n
narcoticfresh Feb 20, 2024
e6e7684
move change tracking to DocumentModel
narcoticfresh Feb 20, 2024
61563dc
constraints
narcoticfresh Feb 20, 2024
6db60b2
hashes
narcoticfresh Feb 20, 2024
ba2a0a3
update
narcoticfresh Feb 20, 2024
000cab5
Merge branch 'develop' into feature/openapi
narcoticfresh Feb 22, 2024
172a812
update after merge
narcoticfresh Feb 22, 2024
640c9df
find a place to render global schema
narcoticfresh Feb 22, 2024
7d6757e
progress
narcoticfresh Feb 22, 2024
afb12f3
simplify schema
narcoticfresh Feb 22, 2024
aa6fecf
hmm
narcoticfresh Feb 22, 2024
e01101c
change order of things
narcoticfresh Feb 23, 2024
1367297
separate concerns: schema building should be in generator bundle
narcoticfresh Feb 23, 2024
cd3f888
finish extref pattern
narcoticfresh Feb 23, 2024
ba0b4f7
move tests
narcoticfresh Feb 23, 2024
9f8a279
cs
narcoticfresh Feb 23, 2024
541508b
remove
narcoticfresh Feb 23, 2024
9393b14
change for switch
narcoticfresh Feb 24, 2024
4e00881
make it nice
narcoticfresh Feb 24, 2024
87fcfa0
progress
narcoticfresh Feb 25, 2024
e34cb71
progress
narcoticfresh Feb 26, 2024
7165927
progress
narcoticfresh Feb 26, 2024
544c9ac
progress
narcoticfresh Feb 26, 2024
4c6c60d
progress
narcoticfresh Feb 26, 2024
f8ccdab
remove schemabundle
narcoticfresh Feb 26, 2024
b4b194e
puh, lot of things
narcoticfresh Feb 26, 2024
e775e2e
progress
narcoticfresh Feb 27, 2024
ec631da
eventnames
narcoticfresh Feb 27, 2024
3fe31f3
embed id
narcoticfresh Feb 27, 2024
d5b8f9c
consolidate params
narcoticfresh Feb 28, 2024
0f7bb26
move handler
narcoticfresh Feb 28, 2024
34b00f5
move stuff around
narcoticfresh Feb 28, 2024
e1d1739
/file progress
narcoticfresh Feb 28, 2024
e60c9e5
fix json
narcoticfresh Feb 29, 2024
5ac2e35
more to switch
narcoticfresh Feb 29, 2024
2fd3719
Merge branch 'develop' into feature/openapi
narcoticfresh Feb 29, 2024
46d8911
one remaining file test
narcoticfresh Feb 29, 2024
83c65e2
no need for this, we have integration tests
narcoticfresh Feb 29, 2024
0b68500
fix assertions of validation errors
narcoticfresh Mar 1, 2024
26312a6
fix assertions of validation errors
narcoticfresh Mar 1, 2024
e341518
replace symfony package
narcoticfresh Mar 1, 2024
9da2b2d
use some generators
narcoticfresh Mar 1, 2024
a4bf7c7
update phpunit
narcoticfresh Mar 1, 2024
8cbbfa5
consolidate deps
narcoticfresh Mar 1, 2024
03e4cdb
unused imports
narcoticfresh Mar 1, 2024
4b9f80c
use split packages
narcoticfresh Mar 1, 2024
abdfc2a
more and more changes
narcoticfresh Mar 1, 2024
ec81b07
phpunit fixes
narcoticfresh Mar 1, 2024
fabea5b
phpunit fixes
narcoticfresh Mar 1, 2024
d93f1db
don't use non existing trait assert anymore
narcoticfresh Mar 5, 2024
adb08e2
remove lib
narcoticfresh Mar 5, 2024
2e53987
rename class
narcoticfresh Mar 5, 2024
93daeb0
remove trait
narcoticfresh Mar 5, 2024
71f6a60
try to remove side effects
narcoticfresh Mar 5, 2024
bde67b0
more side effects
narcoticfresh Mar 5, 2024
385b7b7
remove cebe
narcoticfresh Mar 5, 2024
ab4955b
consolidate params
narcoticfresh Mar 5, 2024
75fadf2
cleanup query service
narcoticfresh Mar 5, 2024
6a17424
id generation
narcoticfresh Mar 5, 2024
2ffc9c3
expect empty array
narcoticfresh Mar 5, 2024
e95afa9
more assertions
narcoticfresh Mar 5, 2024
4206f1f
fix delete validation
narcoticfresh Mar 5, 2024
fd1770c
change a lot of things
narcoticfresh Mar 5, 2024
e3fe63f
more
narcoticfresh Mar 5, 2024
fb5ee0c
change the model events
narcoticfresh Mar 6, 2024
dcc4a51
finalize eventstatus stuff
narcoticfresh Mar 6, 2024
e59c745
consolidate another bundle
narcoticfresh Mar 6, 2024
ba39726
consolidate another bundle
narcoticfresh Mar 6, 2024
337a4a6
fix controller
narcoticfresh Mar 6, 2024
b6d7b39
can be a bit different
narcoticfresh Mar 7, 2024
f7a3096
correct check
narcoticfresh Mar 7, 2024
6516d84
remove unused compilerpasses
narcoticfresh Mar 7, 2024
cb58349
revert some
narcoticfresh Mar 7, 2024
8e34080
fix check
narcoticfresh Mar 8, 2024
6aaf262
check more tests
narcoticfresh Mar 12, 2024
b85465b
hm
narcoticfresh Mar 12, 2024
a133826
last test
narcoticfresh Mar 12, 2024
9b2fd20
first wave of doc
narcoticfresh Mar 12, 2024
b599ad7
doc fixes
narcoticfresh Mar 12, 2024
bcb5f28
try to remove
narcoticfresh Mar 12, 2024
ee4cc94
move all tests to their own directory
narcoticfresh Mar 12, 2024
36ee4b5
cs fix
narcoticfresh Mar 12, 2024
6d1ed51
get rid of more compiler passes
narcoticfresh Mar 13, 2024
8d4b854
unknow service for extref
narcoticfresh Mar 13, 2024
9026c47
shuffle around, exclude GeneratorBundle from coverage
narcoticfresh Mar 13, 2024
cfd9322
try more excluding
narcoticfresh Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

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

# Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP
Expand All @@ -48,7 +48,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
Expand All @@ -64,12 +64,10 @@ jobs:
echo "APP_ENV=test" > .env.local
echo "APP_DEBUG=0" >> .env.local
echo "MONGODB_URI=${MONGODB_URI}" >> .env.local

composer configure
bash prepare-for-tests.sh
cat app/config/parameters.yml

composer check
env:
MONGODB_URI: mongodb://127.0.0.1:${{ job.services.mongodb.ports['27017'] }}/db

Expand All @@ -84,6 +82,10 @@ jobs:
COVERALLS_REPO_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
COVERALLS_FLAG_NAME: '${{ matrix.php-versions }}'

- name: Run syntax checker
run: |
composer check

- uses: ashley-taylor/junit-report-annotations-action@1.4
if: always()
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ versions.yml
.idea
*.cache
.env.local
src/Graviton/**/openapi.json
15 changes: 0 additions & 15 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,13 @@

use Graviton\BundleBundle\GravitonBundleBundle;
use Graviton\BundleBundle\Loader\BundleLoader;
use Graviton\CacheBundle\GravitonCacheBundle;
use Graviton\CoreBundle\GravitonCoreBundle;
use Graviton\DocumentBundle\GravitonDocumentBundle;
use Graviton\ExceptionBundle\GravitonExceptionBundle;
use Graviton\FileBundle\GravitonFileBundle;
use Graviton\GeneratorBundle\GravitonGeneratorBundle;
use Graviton\I18nBundle\GravitonI18nBundle;
use Graviton\LogBundle\GravitonLogBundle;
use Graviton\MigrationBundle\GravitonMigrationBundle;
use Graviton\RabbitMqBundle\GravitonRabbitMqBundle;
use Graviton\RestBundle\GravitonRestBundle;
use Graviton\SchemaBundle\GravitonSchemaBundle;
use Graviton\SecurityBundle\GravitonSecurityBundle;
use Graviton\SwaggerBundle\GravitonSwaggerBundle;
use League\FlysystemBundle\FlysystemBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
Expand Down Expand Up @@ -73,7 +66,6 @@ public function registerBundles(): iterable
new \JMS\SerializerBundle\JMSSerializerBundle(),
new \Graviton\RqlParserBundle\GravitonRqlParserBundle(),
new FlysystemBundle(),
new \Graviton\JsonSchemaBundle\GravitonJsonSchemaBundle(),
new \Graviton\AnalyticsBundle\GravitonAnalyticsBundle(),
new \Graviton\CommonBundle\GravitonCommonBundle(),
new \Sentry\SentryBundle\SentryBundle()
Expand All @@ -95,18 +87,11 @@ public function registerBundles(): iterable
$bundles,
[
new GravitonCoreBundle(),
new GravitonExceptionBundle(),
new GravitonDocumentBundle(),
new GravitonSchemaBundle(),
new GravitonRestBundle(),
new GravitonI18nBundle(),
new GravitonGeneratorBundle(),
new GravitonCacheBundle(),
new GravitonLogBundle(),
new GravitonSecurityBundle(),
new GravitonSwaggerBundle(),
new GravitonFileBundle(),
new GravitonRabbitMqBundle(),
new GravitonMigrationBundle()
]
);
Expand Down
13 changes: 11 additions & 2 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ imports:
framework:
trusted_proxies: '192.0.0.0/8,172.0.0.0/8,10.0.0.0/8'
trusted_headers: [ 'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix' ]
http_method_override: false
handle_all_throwables: false
secret: "%secret%"
php_errors:
log: true
Expand All @@ -24,15 +26,22 @@ framework:
form:
enabled: false
csrf_protection: false
annotations:
enabled: false
validation:
enabled: true
enable_annotations: false
enabled: false
enable_attributes: false
email_validation_mode: html5
default_locale: "%locale%"
trusted_hosts: ~
fragments: ~

######### ORIGINAL UNTEN

# disable rql parser listener
graviton_rql_parser:
activate_listener: false

graviton_common:
mongo_document_manager_service_id: doctrine_mongodb.odm.default_document_manager
cache:
Expand Down
6 changes: 4 additions & 2 deletions app/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ parameters:
kernel.debug: false
debug.container.dump: true
# we shall not produce queue messages in tests
graviton.rabbitmq.producer.extamqp.class: Graviton\RabbitMqBundle\Producer\Dummy
graviton.rest.messageproducer.extamqp.class: Graviton\RestBundle\MessageProducer\Dummy

graviton.translator.default.language: en

# headers in this list will be forwarded in the rabbitmq queue message (their names and values as map)
graviton.rabbitmq.queueevent.transient_headers:
Expand Down Expand Up @@ -43,7 +45,7 @@ parameters:
graviton.security.authentication.strategy.header.key: x-graviton-user

framework:
test: ~
test: true
profiler:
enabled: false
collect: false
Expand Down
3 changes: 3 additions & 0 deletions app/config/config_test_restricted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ imports:

# in this environment, data restrictions are enabled
parameters:

graviton.translator.default.language: en

graviton.rest.data_restriction.map:
x-graviton-client: "int:clientId"
3 changes: 3 additions & 0 deletions app/config/config_test_restricted_conditional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ imports:

# in this environment, data restrictions are enabled, but not persisted by default, neither is solr
parameters:

graviton.translator.default.language: en

graviton.rest.data_restriction.map:
x-graviton-client: "int:clientId"
x-graviton-moreField: "int:moreField"
Expand Down
11 changes: 5 additions & 6 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ parameters:
graviton.mongodb.default.server.uri: ~

graviton.document.dateFormat: 'Y-m-d\TH:i:sO'
graviton.document.dateFormatRegex: '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[\.]?\d{0,6}[+-]\d{2}[:]?\d{2}$'
graviton.document.timezone: 'UTC'

graviton.log.path: "%kernel.logs_dir%/%kernel.environment%.log"
Expand Down Expand Up @@ -41,6 +42,8 @@ parameters:
# if true, the requests to solr as restricted - if false, then not.
graviton.rest.data_restriction.solr: true

graviton.rest.openapi.path: "%kernel.project_dir%/app/config/routing.yml"

graviton.jmespath.cache_dir: "%kernel.cache_dir%/jmespath"

# security related parameters
Expand Down Expand Up @@ -74,7 +77,6 @@ parameters:

# Add full qualified type, application/pdf, image/jpeg...
graviton.file.allowed.mime_types: []
graviton.file.read_filesystem_mimetype: true

graviton.file.local.storage_directory: '%kernel.project_dir%/app/files'

Expand All @@ -93,8 +95,8 @@ parameters:
graviton.core.httpclient.debugMaxLength: 5000
graviton.core.httpclient.verifyPeer: false

graviton.translator.default.locale: en
graviton.translator.cache_name_depth: 3
graviton.translator.default.language: de
graviton.translator.languages: en,de,fr,it

# optional url to a solr instance for improved search
graviton.solr.url: null
Expand All @@ -111,9 +113,6 @@ parameters:
graviton.router.port_http: null
graviton.router.port_https: null

# service info injected by cloudfoundry
vcap.services: ~

mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
Expand Down
2 changes: 1 addition & 1 deletion app/config/parameters_buildtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:
# /core/version params
graviton.version.self_package_name: graviton/graviton
graviton.version.desired_versions:
- symfony/symfony
- symfony/framework-bundle
graviton.version.ext_list:
- mongodb

Expand Down
13 changes: 4 additions & 9 deletions app/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@ graviton_core_routing:
resource: "@GravitonCoreBundle/Resources/config/routing.yml"
prefix: /

graviton_swagger_routing:
resource: "@GravitonSwaggerBundle/Resources/config/routing.yml"
prefix: /

graviton_security_routing:
resource: "@GravitonSecurityBundle/Resources/config/routing.yml"
prefix: /

graviton_rabbitmq_routing:
resource: "@GravitonRabbitMqBundle/Resources/config/routing.yml"
graviton_rest_routing:
resource: "@GravitonRestBundle/Resources/config/routing.yml"
prefix: /

# this goes to our RouteLoader in the CoreBundle, which in turn loads RouteLoaders tagged by the "graviton.routing.loader" service tag
graviton_core_routeloader_routing:
graviton_rest_route_loader:
resource: "."
type: graviton.core.route_loader
type: graviton.rest.route_loader
2 changes: 0 additions & 2 deletions app/config/security.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

security:

enable_authenticator_manager: true

providers:
default:
id: Graviton\SecurityBundle\Authentication\UserProvider
Expand Down
2 changes: 1 addition & 1 deletion app/config/services_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
services:

# needs to activate in test env in order to test streamed responses
Graviton\TestBundle\Listener\StreamedReponseTestListener:
Graviton\Tests\StreamedReponseTestListener:
tags:
- name: kernel.event_listener
event: kernel.response
Expand Down
49 changes: 31 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
"app/Graviton.php"
]
},
"autoload-dev": {
"psr-4": {
"Graviton\\Tests\\": "tests/"
}
},
"require": {
"php": ">=8.3.0",
"ext-json": "*",
Expand All @@ -33,24 +38,27 @@

"incenteev/composer-parameter-handler": "^2.1.0",

"graviton/common-bundle": "~4",
"graviton/rql-parser-bundle": "~3",
"graviton/common-bundle": "dev-develop",
"symfony/runtime": "^6.4.0",
"symfony/twig-bundle": "^6.4.0",
"symfony/dotenv": "^6.4.0",
"symfony/expression-language": "^6.4.0",

"graviton/rql-parser-bundle": "dev-develop",
"graviton/link-header-rel-parser": "~1",
"graviton/analytics-base": "^0.4.0",
"graviton/mongodb-migrations-bundle": "~2",

"symfony/symfony": "~6.4.0",
"symfony/monolog-bundle": "~3.0",

"jms/serializer-bundle": "~5",

"doctrine/persistence": "~3",
"doctrine/inflector": "~2",

"php-jsonpatch/php-jsonpatch": "~4.0",
"justinrainbow/json-schema": "~5.2.0",
"php-jsonpointer/php-jsonpointer": "~4.0",
"swaggest/json-diff": "~3",
"league/openapi-psr7-validator": "~0",
"riverline/multipart-parser": "~2",
"thefrozenfire/swagger": "=2.0.7",

"league/flysystem-bundle": "^3.0",
"league/flysystem-async-aws-s3": "^3.0",
Expand All @@ -64,20 +72,23 @@
"solarium/solarium": "~6",
"mtdowling/jmespath.php": "^2.4",

"symfony/runtime": "^6.0",
"seld/jsonlint": "*",
"league/mime-type-detection": "^1.15"
"league/mime-type-detection": "^1.15",
"ckr/arraymerger": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "~9|~8",
"phpunit/phpunit": "~10",
"squizlabs/php_codesniffer": "~3",

"graviton/test-services-bundle": "^2.15.0",
"graviton/mongodb-fixtures-bundle": "^4.0.1",
"symfony/debug-bundle": "^6.4.0",
"symfony/phpunit-bridge": "^6.4.0",
"symfony/web-profiler-bundle": "^6.4.0",
"symfony/browser-kit": "^6.4.0",

"graviton/test-services-bundle": "dev-develop",
"graviton/mongodb-fixtures-bundle": "dev-develop",
"libgraviton/codesniffer": "~2",

"symfony/phpunit-bridge": "^6.0",
"dms/phpunit-arraysubset-asserts": "~0",
"phan/phan": "^5.3",
"masterminds/html5": "^2.8"
},
Expand All @@ -87,7 +98,8 @@
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*"
"symfony/polyfill-php81": "*",
"symfony/polyfill-php82": "*"
},
"suggest": {
"league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
Expand Down Expand Up @@ -116,8 +128,7 @@
"regenerate": [
"@configure",
"Graviton\\GeneratorBundle\\Composer\\ScriptHandler::generateDynamicBundles",
"@reset-cache",
"Graviton\\SwaggerBundle\\Composer\\ScriptHandler::generateSwaggerJson"
"@reset-cache"
],
"check": [
"./vendor/bin/phpcs -p --standard=PSR1 --ignore='src/GravitonDyn/*,src/Doctrine/*,var/cache,*.css,*.js' src/ app/ public/",
Expand Down Expand Up @@ -216,7 +227,9 @@
"graviton.solr.fuzzy_bridge": "SOLR_FUZZY_BRIDGE",
"graviton.solr.wildcard_bridge": "SOLR_WILDCARD_BRIDGE",
"graviton.solr.literal_bridge": "SOLR_LITERAL_BRIDGE",
"graviton.solr.andify_terms": "SOLR_ANDIFY_TERMS"
"graviton.solr.andify_terms": "SOLR_ANDIFY_TERMS",
"graviton.translator.default.language": "TRANSLATOR_DEFAULT_LANGUAGE",
"graviton.translator.languages": "TRANSLATOR_LANGUAGES"
}
},
{
Expand Down
Loading
Loading