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

Only split the monorepo if the whole build is successful #2

Merged
merged 2 commits into from Aug 18, 2018

Conversation

ausi
Copy link
Member

@ausi ausi commented Aug 18, 2018

The logic when the split runs on Travis CI is currently not very reasonable I think. If the tests fail in PHP 7.1 but are fine in PHP 7.2, the split still gets executed. Additionally the tests in PHP 7.2 run twice which is a waste of time and resources.

For such use cases travis has build stages that makes it possible to run jobs only if a group of other jobs succeeded.

I also changed the requirement for contao/monorepo-tools to a specific commit hash to avoid incompatibilities in future updates to the lib.

@leofeyer leofeyer assigned leofeyer and ausi and unassigned leofeyer Aug 18, 2018
@leofeyer leofeyer merged commit 3399a52 into contao:4.4 Aug 18, 2018
@leofeyer
Copy link
Member

Thank you @ausi

leofeyer pushed a commit that referenced this pull request Feb 19, 2019
Description
-----------

Here's an early draft of @terminal42's approach to new entry points.

- [x] ~~instead of having multiple entry points (`app.php`, `app_dev.php`), we want to have only one entry point (`index.php` as in Symfony 4).~~ Not possible, we still need a separate entry point to have a different URL to bypass the cache.
- [x] to know the user without needing to boot the kernel, a JWT cookie can be used

the JWT can tell
 - [x] ~whether to bypass the cache (if JWT token says the user is logged into the backend)~ If the user is allowed to use the front controller that bypasses the cache
 - [x] to enable or disable debug mode from the backend
 - [x] ~to enable or disable preview mode (without the iframe)~ Preview is determined by the user token, and we shouldn't change that for BC

this allows us to
 - [ ] remove dependency on `terminal42/header-replay-bundle` to bypass cache if a user is logged in
 - [ ] remove dependency on session/user/ip etc. to bypass (lexik) maintenance mode
 - [x] allow to use the debug mode without needing to activate it in the Contao Manager
 - probably a lot more 🎉 

regarding the JWT
 - [x] because we cannot use the kernel secret (the kernel/container is not bootet yet), the secret must be automatically generated and stored in a temporary file (e.g. `/var/cache/jwt-secret`)
 - [x] the JWT can only be signed using this secret, we can't encrypt it because we cannot rely on OpenSSL to generate a valid certificate on-the-fly

Commits
-------

a206ca8 Initial draft of new entry points
479ae5c Require firebase/php-jwt (same lib the Contao Manager uses)
b7b6dee Draft of JWT as kernel config
26546f3 Use separate entry points to bypass the cache
0a339d1 Introducing JwtManager
d4729e6 Renamed preview.php to admin.php
8913fa2 Set and delete cookie on login/logout
5ea414f Do not redirect on the login page
afa1661 Fixed bugs in JWT manager
bed865a Re-add changes that were lost during rebase
73afe2c Renamed the entry point
5453876 Add the entry point to the preview link in the backend
d16ca38 Add debug mode switch to preview bar
2c2cab7 Fix JWT handling in preview entry point
af49429 Do not enable debug mode when logging in as admin
94d3960 Add debug toggle menu for backend admins
04f2f06 Correctly redirect back after backend login
ac82f6f Strip the tags header from preview responses
276592c Redirect to backend login after backend logout
ab5974e Fixed unit tests for login and logout handlers
cf5dd1d Added unit tests (#2)
e4260f5 Fix the coding style
95a116f Merge branch 'master' into feature/entry-point
f5bd0b0 Fix a potential null pointer exception
leofeyer pushed a commit that referenced this pull request Nov 1, 2019
…es command (see #866)

Description
-----------

Together with @Toflar we had a hard time debugging why the `contao:resize-images` command stopped at some point and did not want to continue. The error message was quite unclear especially that the requested file existed:

```
6/77b26349-9084f1ba.jpg......... failed
Unable to open image /var/www/vhosts/domain.tld/httpdocs/releases/233/assets/images/../../var/pim-images/77b26349.jpg
```

So we decided to introduce an option that allows to output more verbose error message simply by executing command in verbose mode `contao:resize-images -v`:

```
f/8ac5c4ec-213df40b.jpg.............. failed

 [ERROR] ImagickException: cache resources exhausted
         `/var/www/vhosts/domain.tld/httpdocs/releases/233/assets/images/../../var/pim-images/8ac5c4ec.jpg' @
         error/cache.c/OpenPixelCache/3864 in
         /var/www/vhosts/domain.tld/httpdocs/releases/233/vendor/imagine/imagine/src/Imagick/Imagine.php:69
         Stack trace:
         #0 /var/www/vhosts/domain.tld/httpdocs/releases/233/vendor/imagine/imagine/src/Imagick/Imagine.php(69):
         Imagick->__construct('/var/www/vhosts...')
         #1 /var/www/vhosts/domain.tld/httpdocs/releases/233/vendor/contao/image/src/Resizer.php(93):
         Imagine\Imagick\Imagine->open('/var/www/vhosts...')
         #2 /var/www/vhosts/domain.tld/httpdocs/releases/233/vendor/contao/image/src/DeferredResizer.php(185):
         Contao\Image\Resizer->executeResize(Object(Contao\Image\Image), Object(Contao\Image\ResizeCoordinates),
         '/var/www/vhosts...', Object(Contao\Image\ResizeOptions))
         #3 /var/www/vhosts/domain.tld/httpdocs/releases/233/vendor/contao/image/src/DeferredResizer.php(108):
         Contao\Image\DeferredResizer->executeDeferredResize('f/8ac5c4ec-213d...', Array,
         Object(Imagine\Imagick\Imagine))
         #4
         /var/www/vhosts/domain.tld/httpdocs/releases/233/vendor/contao/core-bundle/src/Command/ResizeImagesComma
         nd.php(189): Contao\Image\DeferredResizer->resizeDeferredImage(Object(Contao\Image\DeferredImage), false)
         #5
         /var/www/vhosts/domain.tld/httpdocs/releases/233/vendor/contao/core-bundle/src/Command/ResizeImagesComma
         nd.php(166): Contao\CoreBundle\Command\ResizeImagesCommand->resizeImage('f/8ac5c4ec-213d...',
         Object(Symfony\Component\Console\Style\SymfonyStyle))
         #6 /var/www/vhosts/domain.tld/httpdocs/releases/233/vendor/symfony/console/Command/Command.php(255):
```

Commits
-------

e9c6de9 Allow to output more verbose error messages in contao:resize-images command
leofeyer pushed a commit that referenced this pull request Aug 4, 2020
Description
-----------

With @Toflar we have discovered by accident that if a URL is double-encoded (for some reason, doesn't matter) the Contao's `RouteProvider` will eventually throw an error trying to query a database.

```
URL original: drachenlochmuseum-v%25c3%25a4ttis.html
URL decoded: drachenlochmuseum-v%c3%a4ttis.html
URL decoded 2nd time: drachenlochmuseum-vättis.html
```

The decoded URL is used in the database query and that fails because the database driver would like to replace wildcards `%c` with parameters that were not provided.

Stack trace:

```
Exception: Too few arguments to build the query string
#27 vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php(304): replaceWildcards
#26 vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php(249): execute
#25 vendor/contao/core-bundle/src/Resources/contao/library/Contao/Model.php(1102): find
#24 vendor/contao/core-bundle/src/Resources/contao/library/Contao/Model.php(973): findBy
#23 vendor/contao/core-bundle/src/Framework/Adapter.php(38): __call
#22 vendor/contao/core-bundle/src/Routing/RouteProvider.php(493): findPages
#21 vendor/contao/core-bundle/src/Routing/RouteProvider.php(88): getRouteCollectionForRequest
#20 vendor/contao/core-bundle/src/Routing/LegacyRouteProvider.php(43): getRouteCollectionForRequest
#19 vendor/symfony-cmf/routing/src/NestedMatcher/NestedMatcher.php(141): matchRequest
#18 vendor/contao/core-bundle/src/Routing/Matcher/LegacyMatcher.php(69): matchRequest
#17 vendor/symfony-cmf/routing/src/DynamicRouter.php(271): matchRequest
#16 vendor/symfony-cmf/routing/src/ChainRouter.php(188): doMatch
#15 vendor/symfony-cmf/routing/src/ChainRouter.php(158): matchRequest
#14 vendor/symfony/http-kernel/EventListener/RouterListener.php(115): onKernelRequest
#13 vendor/symfony/event-dispatcher/EventDispatcher.php(212): doDispatch
#12 vendor/symfony/event-dispatcher/EventDispatcher.php(44): dispatch
#11 vendor/symfony/http-kernel/HttpKernel.php(126): handleRaw
#10 vendor/symfony/http-kernel/HttpKernel.php(67): handle
#9 vendor/symfony/http-kernel/Kernel.php(198): handle
#8 vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(85): handle
#7 vendor/symfony/http-kernel/HttpCache/HttpCache.php(448): forward
#6 vendor/symfony/framework-bundle/HttpCache/HttpCache.php(57): forward
#5 vendor/symfony/http-kernel/HttpCache/HttpCache.php(420): fetch
#4 vendor/contao/manager-bundle/src/HttpKernel/ContaoCache.php(46): fetch
#3 vendor/symfony/http-kernel/HttpCache/HttpCache.php(317): lookup
#2 vendor/symfony/http-kernel/HttpCache/HttpCache.php(192): handle
#1 vendor/friendsofsymfony/http-cache/src/SymfonyCache/EventDispatchingHttpCache.php(98): handle
#0 web/app.php(58): null
```

Commits
-------

8ae2582 Fix a potential error if the URL has percentage in it
8caaf25 Fix unit tests
509f762 Correctly encode the page aliases
@toteph42 toteph42 mentioned this pull request Oct 23, 2020
leofeyer pushed a commit that referenced this pull request Mar 15, 2021
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | partly solves #2316 
| Docs PR or issue | -

I'm working on test isolation. This part makes sure tests aren't reading temporary data from each other. This effectively means that a test should never write into the `Fixtures` dir (or anywhere else inside the source directories). If temporary files need to be created this now will happen inside the test's own `tmp` dir.

While working on these files, I'm also adjusting the following for consistency:

1) Refactoring path operations to use `Path`
1) Removing private property `$filesystem`  (if we want to share the `Filesystem` instance across tests, we should imo add it to `ContaoTestCase` as a static property)
1) Use `$filesystem` instead of `$fs` everywhere

Following changes needed for #2316 (but unrelated to writing files) are also part of this PR:

1) Reset template loader every time (was missing once, now in `tearDown`).
1) Do not share `ContaoCacheWarmer` instance.

Commits
-------

4e5fa52 never write into tests/Fixture dir
baf27c4 always reset TemplateLoader
827d5f2 add missing file
c3c0e62 backport changes from #1918
2aeb2ee CS
7927286 Merge branch '4.9' into bugfix/test-order/do-not-write-in-fixture-dir
a50db5c Fix the prefer-lowest tests
71e7cfa clear var directory after running functional tests
c466d7e bugfix for bugfix/test-order/do-not-write-in-fixture-dir
3b4fdb4 Merge pull request #2 from fritzmg/fix-bugfix/test-order/do-not-write-in-fixture-dir

bugfix for bugfix/test-order/do-not-write-in-fixture-dir
9891c55 fix filepath comparisons
a25d552 Merge pull request #3 from fritzmg/fix-imagefactorytest-filepath-comparisons

Fix filepath comparisons
leofeyer pushed a commit that referenced this pull request Jun 7, 2021
Description
-----------

This PR

* ensures the new `ResponseContext` does contain clean and unencoded values in preparation for the future (one thing less to migrate)
* unifies the handling of insert tags for meta description. Sometimes it was stripped, sometimes replaced

Commits
-------

3b9922c Ensure clean response context and unify meta handling
6b28659 Move description shortening to template
ee9eedf Add StringUtil::getRawDecodedValue()
f7969ba Add StringUtil::getRawDecodedValueFromHtml()
5821b91 Test and fix getRawDecodedValueFromHtml method
84a80bd Fix tests
7980cda Improve insert tag braces encoding
bd10538 Merge pull request #2 from ausi/fix/response-context-encoding
1054d98 Use our own string util to shorten the description
a5586c0 CS
3bd6984 Improve string util test
cbd11c4 Merge pull request #3 from ausi/fix/improve-string-util-test
4dc2d38 CS
5a5578f Rename to StringUtil methods
207df74 CS
leofeyer pushed a commit that referenced this pull request Nov 15, 2021
Description
-----------

See #3215 (comment)

Commits
-------

d79da63 Replace deprecated security.encoder_factory with security.password_hasher_factory
9fe6a64 Fix UserPasswordCommand
e0d6d9a Fix AuthenticationProvider
06f9778 Fix UserPasswordCommand?
c6ca3d5 CS
0e200d0 Remove leftovers
c792349 Mock SwitchUserToken properly
0ce699e Remove deprecation of InputBag::get()
509800c Implement new Symfony 5.3 Security interfaces
b579d28 CS
2b2297f CS
e28b713 Add deprecation
06fb8a1 Remove test
365aa32 CS
c6a4781 Adjust the phpDoc deprecations
b022da0 Use password_hashers instead of encoders in security configuration
1754635 Add a LogoutSuccessListener and deprecate the LogoutSuccessHandler
42547d6 CS
9d5fcdf Update readme
73a85d1 Use FQCNs for the new listeners (#2)
c715261 Fix more deprecations
e14a887 Deprecate ContaoLoginAuthenticationListener and AuthenticationProvider
7e56daf Fix CS
e58cc49 Fix deprecations
b0c7ec7 Revert "Use FQCNs for the new listeners (#2)"

This reverts commit 73a85d1.
7ba9883 CS
f1e0d23 Fix two deprecation messages
@ausi ausi deleted the fix/split-only-successful branch December 3, 2021 13:41
zoglo referenced this pull request in zoglo/contao Dec 21, 2023
leofeyer pushed a commit that referenced this pull request Jan 4, 2024
…(see #6650)

Description
-----------

**Feature**

- Implements #3510 

**Description**

- This PR removes the hard dependency of the comment-bunndle within faq, news and calendar by using the PaletteManipulator
- All language files have been separated as well

**Following things haven't been removed**

- Comment implementation within the respecitve Modules
- Comment implementation within Models
- Comment implementation within Templates

**Related**
- #3510
- #2983 (comment)
- #3508

_____
*Disclaimer*
> The amount of files and lines changed is due to me actually moving the translations of multiple languages into the comments-bundle

Commits
-------

f1b3913 Rework conditional comment / news bundle fields
62e3eab Rework conditional comment / faq bundle fields
2166b73 Rework conditional comment / calendar bundle fields
c898da0 CS #2
107e164 Revert comment / calendar translations
346149d Revert comment / faq translations
0e3c064 Revert comment / news translations
85cdc03 Revert auto linting eol
974ab40 Revert editorconfig
bf4f0f3 Conditionally load fields via DataContainerListener
6f0f557 Improve DataContainerListener and more
32a76aa Updates to DataContainerListener
f902eae Add plugin test
e16cdec Merge remote-tracking branch 'origin/feature/comments-conditional-fie…
a581fd6 Update test name
288da1d Add CommentsConditionalFieldsListenerTest
f6f3aa7 Update tests
29b1420 Unset TL_LANG after test
512223d Update tests (100% code cov)
f72fbad Rename `CommentsConditionalFields` to `AddCommentFields`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants