Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using some Git magic on the Symfony mono-repository

Using some Git magic on the Symfony mono-repository

Using some Git magic on the Symfony mono-repository

Fabien Potencier

June 08, 2024
Tweet

More Decks by Fabien Potencier

Other Decks in Programming

Transcript

  1. Source of truth, "write-only" "read-only" available on Packagist ... Read-time

    sync commits, branches, tags, ... Monorepo https://github.com/symfony/symfony https://github.com/symfony/* repo repo repo repo repo
  2. 13 years ago... Symfony v2.0 First Symfony version using a

    Git monorepo 21 components 8 bundles 3 bridges On 1 branch 32 packages 8k commits
  3. In 2024... Still using a Git monorepo 54 components 5

    bundles 5 bridges 7 contracts 99 component bridges mailer: 14 - notifier: 76 - messenger: 5 - translation: 4 17 UX packages On 4 branches - 5.4 - 6.4 - 7.0 - 7.1 - 7.2 187 packages 5 branches 70k commits
  4. Git

  5. cp -r src/Symfony/Component/Scheduler /scheduler-repo cd /scheduler-repo git commit -a "New

    commit" git push # after some time cp -r src/Symfony/Component/Scheduler /scheduler-repo cd /scheduler-repo git commit -a "Another commit" git push
  6. git show cdf37b3224 commit cdf37b32244e9607934b76236f9e0d9456355137 Author: Fabien Potencier <[email protected]> Date:

    Thu Aug 3 12:44:58 2023 +0200 [Scheduler] Mark component as non experimental diff --git a/src/Symfony/Component/Scheduler/Attribute/AsSchedule.php b/src/Symfony/Component/Scheduler/Attribute/AsSchedule.php index ea060a98b3..45854c1cd5 100644 --- a/src/Symfony/Component/Scheduler/Attribute/AsSchedule.php +++ b/src/Symfony/Component/Scheduler/Attribute/AsSchedule.php @@ -15,8 +15,6 @@ namespace Symfony\Component\Scheduler\Attribute; * Service tag to autoconfigure schedules. * * @author Fabien Potencier <[email protected]> - * - * @experimental */ #[\Attribute(\Attribute::TARGET_CLASS)] class AsSchedule diff --git a/src/Symfony/Component/Scheduler/CHANGELOG.md b/src/Symfony/Component/Scheduler/CHANGELOG.md index 241b97104a..25ed003e70 100644 --- a/src/Symfony/Component/Scheduler/CHANGELOG.md +++ b/src/Symfony/Component/Scheduler/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG 6.4 --- + * Make component non experimental * Add `--date` to `schedule:debug` * Allow setting timezone of next run date in CronExpressionTrigger * Add `AbstractTriggerDecorator`
  7. git show --raw cdf37b3224 commit cdf37b32244e9607934b76236f9e0d9456355137 Author: Fabien Potencier <[email protected]>

    Date: Thu Aug 3 12:44:58 2023 +0200 [Scheduler] Mark component as non experimental :100644 100644 ea060a98b3 45854c1cd5 M src/Symfony/Component/Scheduler/Attribute/AsSchedule.php :100644 100644 241b97104a 25ed003e70 M src/Symfony/Component/Scheduler/CHANGELOG.md :100644 100644 25ba9bf7c7 c60036542f M src/Symfony/Component/Scheduler/Command/DebugCommand.php :100644 100644 aba7f499d7 05928d78d3 M src/Symfony/Component/Scheduler/Generator/Checkpoint.php :100644 100644 71bc2f49f9 47e9f53fc0 M src/Symfony/Component/Scheduler/Generator/CheckpointInterface.php :100644 100644 84b088d7db 20c9c4925c M src/Symfony/Component/Scheduler/Generator/MessageContext.php :100644 100644 a5ac35dcdb a2f59beede M src/Symfony/Component/Scheduler/Generator/MessageGenerator.php :100644 100644 64835e19d6 4e52d55410 M src/Symfony/Component/Scheduler/Generator/MessageGeneratorInterface.php :100644 100644 4f05a76f06 ccf0e92cf9 M src/Symfony/Component/Scheduler/Generator/TriggerHeap.php :100644 100644 bba3708ef0 68d43dd062 M src/Symfony/Component/Scheduler/Messenger/ScheduledStamp.php :100644 100644 f8e7d973c4 df57ef7c2f M src/Symfony/Component/Scheduler/Messenger/SchedulerTransport.php :100644 100644 ab79ded2e6 f624a2b83a M src/Symfony/Component/Scheduler/Messenger/SchedulerTransportFactory.php :100644 100644 01de586172 0fe969cf4a M src/Symfony/Component/Scheduler/README.md :100644 100644 d99ec2eb16 2bd3463d3d M src/Symfony/Component/Scheduler/RecurringMessage.php :100644 100644 cac22ba47e 500f93ea9e M src/Symfony/Component/Scheduler/Schedule.php :100644 100644 91f83838d0 11efe23541 M src/Symfony/Component/Scheduler/ScheduleProviderInterface.php :100644 100644 8c9e8fac7b b3da60abbf M src/Symfony/Component/Scheduler/Scheduler.php :100644 100644 20dbaa84e4 60883a78aa M src/Symfony/Component/Scheduler/Trigger/CallbackTrigger.php :100644 100644 20fcc960be 8202becfb6 M src/Symfony/Component/Scheduler/Trigger/CronExpressionTrigger.php :100644 100644 f76275ab01 57bed27a22 M src/Symfony/Component/Scheduler/Trigger/ExcludeTimeTrigger.php :100644 100644 c02315bed1 34ee9c2a8b M src/Symfony/Component/Scheduler/Trigger/PeriodicalTrigger.php :100644 100644 bb20515552 d43396760f M src/Symfony/Component/Scheduler/Trigger/TriggerInterface.php
  8. git show --raw cdf37b3224 :100644 100644 ea060a98b3 45854c1cd5 M src/Symfony/Component/Scheduler/Attribute/AsSchedule.php

    Source Mode Dest Mode Source Ref Dest Ref Status Path git cat-file -t ea060a98b3 blob
  9. git cat-file -p ea060a98b3 <?php /* * This file is

    part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Scheduler\Attribute; /** * Service tag to autoconfigure schedules. * * @author Fabien Potencier <[email protected]> * * @experimental */ #[\Attribute(\Attribute::TARGET_CLASS)] class AsSchedule { public function __construct( public string $name = 'default', ) { } }
  10. git cat-file -p 45854c1cd5 <?php /* * This file is

    part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Scheduler\Attribute; /** * Service tag to autoconfigure schedules. * * @author Fabien Potencier <[email protected]> */ #[\Attribute(\Attribute::TARGET_CLASS)] class AsSchedule { public function __construct( public string $name = 'default', ) { } }
  11. git diff ea060a98b3 45854c1cd5 diff --git a/ea060a98b3 b/45854c1cd5 index ea060a98b3..45854c1cd5

    100644 --- a/ea060a98b3 +++ b/45854c1cd5 @@ -15,8 +15,6 @@ namespace Symfony\Component\Scheduler\Attribute; * Service tag to autoconfigure schedules. * * @author Fabien Potencier <[email protected]> - * - * @experimental */ #[\Attribute(\Attribute::TARGET_CLASS)] class AsSchedule
  12. git cat-file -p cdf37b3224 tree c2976fff062b3be948c58cc8d238a49b967c2ed1 parent 20cefc8ac2c24c10ad41cae2c912f073970223bd author Fabien

    Potencier <[email protected]> 1691059498 +0200 committer Fabien Potencier <[email protected]> 1691059805 +0200 [Scheduler] Mark component as non experimental
  13. git cat-file -p c2976fff062b3be948c58cc8d238a49b967c2ed1 100644 blob 383bbfdbb6493c9717eedfbd57020d8cbf23182e .appveyor.yml 100644 blob

    d769b46a4b6ff08689be3a983349df06b4b75fd3 .editorconfig 100644 blob d30fb22a3bdbb947f5206dc78c4a4a446e9a855c .gitattributes 040000 tree da86555478965ccb7270d11717900ca427bb8232 .github 100644 blob 0c37517192abab8d3f679c7608d9e08be5fd64dc .gitignore 100644 blob 7245326249db2a2a122585c605983e74cb3a7ca0 .php-cs-fixer.dist.php 100644 blob 07005e3077334605846505b4640243db17fe02cd CHANGELOG-6.0.md 100644 blob e60e17769bcc634582c52ef1e1016dc7bd641bfe CHANGELOG-6.1.md 100644 blob 1e66ed8becaa82d38740f11534a30bd3e767df61 CHANGELOG-6.2.md 100644 blob b98c8dfc740c5029c5d4f31b1f1a65cbe4fb4634 CHANGELOG-6.3.md 100644 blob c0b3daf15d4638a64da44e200c7561af75838dee CODE_OF_CONDUCT.md 100644 blob 7902d9aff3a77d9f566dbbf173a7095132dac8fd CONTRIBUTING.md 100644 blob 4b2f33954ad2166268b2d8cce1b4f92528b99421 CONTRIBUTORS.md 100644 blob 0138f8f0713513e6452a5b7a428b9cf555bb1377 LICENSE 100644 blob bd66089ef554e917d18cf6a1b13670c109ce6a71 README.md 100644 blob 718b729e55a2cc77d25dccdaddc09889ae9faa51 UPGRADE-6.0.md 100644 blob 333731b4e1f8344d5c23c0062dd31eb26c2df138 UPGRADE-6.1.md 100644 blob b263ecdeebb3aaf18470004124f0b9050b6c9976 UPGRADE-6.2.md 100644 blob 0ad0f71de74e81378aa2e9519d8736777ab6261f UPGRADE-6.3.md 100644 blob 425c2aecebc0560c2d7e14aad946d530607d6e80 UPGRADE-6.4.md 100644 blob 751ef30711d330a9fe0945a1a93ff4031b0fd58b UPGRADE-7.0.md 100644 blob 09909a3b703e1beebad6928ea1905c160d532b9f composer.json 100755 blob 29f9600d6b94e40eb3df1cefb7ac89ed1eb7a5b9 link 100755 blob 94baca39735ba657c0f48ba5b8545ac4d78dce46 phpunit 100644 blob 5f5207576f4f66b5310298eeaef95f0bfe96f797 phpunit.xml.dist 100644 blob f8f57101f4ed808617f178239c7e4472c221435b psalm.xml 040000 tree 09027f088f60510682a57daa62f751bba22bdfd2 src
  14. git cat-file -p cdf37b3224 tree c2976fff062b3be948c58cc8d238a49b967c2ed1 parent 20cefc8ac2c24c10ad41cae2c912f073970223bd author Fabien

    Potencier <[email protected]> 1691059498 +0200 committer Fabien Potencier <[email protected]> 1691059805 +0200 [Scheduler] Mark component as non experimental
  15. git diff 20cefc8ac2c24c10ad41cae2c912f073970223bd c2976fff062b3be948c58cc8d238a49b967c2ed1 diff --git a/src/Symfony/Component/Scheduler/Attribute/AsSchedule.php b/src/Symfony/Component/Scheduler/Attribute/AsSchedule.php index ea060a98b3..45854c1cd5

    100644 --- a/src/Symfony/Component/Scheduler/Attribute/AsSchedule.php +++ b/src/Symfony/Component/Scheduler/Attribute/AsSchedule.php @@ -15,8 +15,6 @@ namespace Symfony\Component\Scheduler\Attribute; * Service tag to autoconfigure schedules. * * @author Fabien Potencier <[email protected]> - * - * @experimental */ #[\Attribute(\Attribute::TARGET_CLASS)] class AsSchedule diff --git a/src/Symfony/Component/Scheduler/CHANGELOG.md b/src/Symfony/Component/Scheduler/CHANGELOG.md index 241b97104a..25ed003e70 100644 --- a/src/Symfony/Component/Scheduler/CHANGELOG.md +++ b/src/Symfony/Component/Scheduler/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG 6.4 --- + * Make component non experimental * Add `--date` to `schedule:debug` * Allow setting timezone of next run date in CronExpressionTrigger * Add `AbstractTriggerDecorator`
  16. git cat-file -p 09027f088f60510682a57daa62f751bba22bdfd2 040000 tree 13a5904f11804e65793e8defadfdc87e26c1c9df Symfony git cat-file

    -p 13a5904f11804e65793e8defadfdc87e26c1c9df 040000 tree ec8241e93f28b94945867163e79a1cd88ca9f922 Bridge 040000 tree 4c596fcda926a9de7a051bed81f36b0d6df7d7df Bundle 040000 tree da43a8ed2f41b60fd4424ab69a8724139aeab76a Component 040000 tree ff488fe7a97fdd957cc040fb0e38044e2ee8dcc7 Contracts git cat-file -p da43a8ed2f41b60fd4424ab69a8724139aeab76a ... 040000 tree b8781684cd0eb9b5a5cf1e56280ed4d27f5c4a0b Routing 040000 tree cf638da1abfdcd6395606b154868b47c14868516 Runtime 040000 tree 778604643f4e2c8d86157ef92a622d49dc3ebdf6 Scheduler 040000 tree 7b29edd6e10c39b051cacafb90cc80c1795f240c Security 040000 tree d4dcdf003bb8f888a7ceea3cbc8a718194412baf Semaphore ... src/Symfony/Component/Scheduler
  17. git show --no-patch --format="%H%n%T%n%P%n%an%n%ae%n%at%n%cn%n%ce%n%ct%n%B" cdf37b3224 cdf37b32244e9607934b76236f9e0d9456355137 c2976fff062b3be948c58cc8d238a49b967c2ed1 20cefc8ac2c24c10ad41cae2c912f073970223bd Fabien Potencier

    [email protected] 1691059498 Fabien Potencier [email protected] 1691059805 [Scheduler] Mark component as non experimental <- commit hash <- tree hash <- parent hash(es) <- author name <- author email <- author date <- committer name <- committer email <- committer date <- subject and body
  18. git show --no-patch --format="%H%n%T%n%P%n%an%n%ae%n%at%n%cn%n%ce%n%ct%n%B" cdf37b3224 cdf37b32244e9607934b76236f9e0d9456355137 c2976fff062b3be948c58cc8d238a49b967c2ed1 20cefc8ac2c24c10ad41cae2c912f073970223bd Fabien Potencier

    [email protected] 1691059498 Fabien Potencier [email protected] 1691059805 [Scheduler] Mark component as non experimental <- commit hash <- tree hash <- parent hash(es) <- author name <- author email <- author date <- committer name <- committer email <- committer date <- subject and body to be replaced by the subtree hashes
  19. git log --oneline --graph --no-merges 15686e8068b6c96759cdebfaa321df47ee2ffc9e * 3aeb5042ab [Scheduler] fix

    documentation link * c48b9e423a [Scheduler] Fix messenger receiver with no alias * dd9c1ac381 [FrameworkBundle][RemoteEvent][Routing][Scheduler] Add PHPDoc to attributes properties * 2a6f099606 Merge branch '5.4' into 6.3 | * 671bfc5be6 do not mock the ContainerInterface | * 347e7df017 fix test | * df568bfc55 fix syntax error | * f9ad398e92 [Scheduler] Separate id and description in message providers | * a2641b1ce6 Don't lose checkpoint state when lock is acquired from another | * df4c65e4bc fix test * 9a70df26d5 [Scheduler] Use MockClock * 441559e587 [Scheduler] Save checkpoint in a finally block | * 7595448265 Fix markdown in README files | | * 83da77c835 [Scheduler] Add failureEvent | |/ | * ba3811641f [Scheduler] postRun event test is missing | * 69f26c0174 [Scheduler] Fix dev requirements | * 012e0e7a7f [Scheduler] add PRE_RUN and POST_RUN events | * b74ac24b5c Add test for 0 and '0' in PeriodicalTrigger Fix '0' case error and remove duplicate code | * 598762ebab [Scheduler] Fix tests | * dda284a6fd [Messenger][Scheduler] Add AsCronTask & AsPeriodicTask attributes | | * c4f8ab6f46 [Scheduler] Make debug:scheduler output more useful | | * 15274e5ad2 [Scheduler] Trigger unique messages at runtime | | * c056a6ce27 [Scheduler] Fix CHANGELOG | | * 0376d432ea [Scheduler] Allow modifying the schedule at runtime and recalculate heap | | | * 315bb3a29a Minor CS fixes * | | 75e66729d5 Match next run timezone with from timezone * | | 17263e33e1 [Scheduler] Speed up tests | | | * d8a87705db [Scheduler] Fix changelog | | | * 4a33638065 Fix stateful scheduler
  20. * 15686e8068 Merge branch '7.0' into 7.1 |\ | *

    626c146455 Merge branch '6.4' into 7.0 | |\ | | * 3aeb5042ab [Scheduler] fix documentation link * | | c1f99cbb34 Merge branch '7.0' into 7.1 |\| | | * | 3092d0c6e0 Merge branch '6.4' into 7.0 | |\| | | * c48b9e423a [Scheduler] Fix messenger receiver with no alias * | | 8d351c8677 minor #51996 [FrameworkBundle][RemoteEvent][Routing][Scheduler] Add PHPDoc to attributes properties (alexandre-daubois) |\ \ \ | * | | dd9c1ac381 [FrameworkBundle][RemoteEvent][Routing][Scheduler] Add PHPDoc to attributes properties * | | | 33596b4e1e Merge branch '7.0' into 7.1 |\ \ \ \ | | |/ / | |/| | | * | | d412779c0d Merge branch '6.4' into 7.0 | |\ \ \ | | | |/ | | |/| | | * | acca012182 Merge branch '6.3' into 6.4 | | |\ \ | | | * | 2a6f099606 Merge branch '5.4' into 6.3 * | | | | 671bfc5be6 do not mock the ContainerInterface |/ / / / * | | / d6c9034f0d Merge branch '6.4' into 7.0 git log --oneline --graph 15686e8068b6c96759cdebfaa321df47ee2ffc9e
  21. git cat-file -p v7.0.0 object d78c5f403d7ee794993660b1d5155536edd36fc1 type commit tag v7.0.0

    tagger Fabien Potencier <[email protected]> 1701255370 +0100 Create tag 7.0.0 -----BEGIN PGP SIGNATURE----- iHUEABEIAB0WIQTdTsWJFf+Iioo92JjriqaaVmwHlQUCZWcYygAKCRDriqaaVmwH leukAP0Zw5doa8UdBFaTC/4wZBjui0gkZj0BNtdXWW+nXRZuVgD/QjS40LXzaoPc Sqils7hClejqtw57wxvdlOtDtpD7KWo= =Ke/i -----END PGP SIGNATURE----- git cat-file -p v7.0.0 tag
  22. git cat-file -p d78c5f403d7ee794993660b1d5155536edd36fc1 tree 62d865982693165c261d367d4183dbdc15d34839 parent 6411a47c25e1d57f1bab551563910d9b232c7388 parent d79dfc511ef278d9ebb18e055788cdd6321d40e8

    author Fabien Potencier <[email protected]> 1701255357 +0100 committer GitHub <[email protected]> 1701255357 +0100 gpgsig -----BEGIN PGP SIGNATURE----- wsBcBAABCAAQBQJlZxi9CRBK7hj4Ov3rIwAATr0IAHtp2xdgfoDwhXbd4mVBnIZ5 vojxtu6pd61SfP2nSuR/V67qid8Z777JilaH+bfx4hADJ09zGLBvQiuYY+A7IPwg lJ0fPTo52870B/xxkh0FhZ1FnvfdGUT8Q4FUZzahdO7yLrZw2NAu6FJqjz+CDUME SHzoqIUPfFjgk5GBRYx/ZxVLvcJ+c4MtcUloQ31qM42ckr1Z4VwF9/BpLDE5Ghtw qkfWRNkxxJy1eZJQ0QONv3w8BIq6+fKFaQaPQL1YC574R5DqaKL28/DfQg/K9VNH opAJIHwNY+Ua0/b6MS0uhpaC2ZTyyaXJjliYjSElNzwytF+4hkqjJd8LnfDtlGI= =fO0d -----END PGP SIGNATURE----- Merge pull request #52791 from fabpot/release-7.0.0 released v7.0.0⏎
  23. The next version will be MUCH faster ~50 seconds splitsh-lite

    --prefix=src/Symfony/Component/Scheduler --origin=origin/7.1 --git '<1.8.2' ~0.5 second x100