Update Composer Stager to 2.0-rc2 to fix failing build tests

Created on 24 April 2024, 12 months ago
Updated 6 June 2024, 10 months ago

Problem/Motivation

...because of course they are. We figured out why in #15.

πŸ› Bug report
Status

Fixed

Version

3.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • First commit to issue fork.
  • Merge request !1064Issue #3443249 build tests failing β†’ (Merged) created by tedbow
  • Pipeline finished with Failed
    12 months ago
    #155603
  • πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

    Failed asserting that 'Composer version 2.7.4 2024-04-22 21:17:03' contains
    "for debug".

    I put a debug assert just to see if the Composer version was the problem but this is the same version I have locally and it passes.

  • Status changed to Needs work 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

    More debugging on gitlabci because I can't get it to fail locally

    1. I tested running the composer command to update the module in \Drupal\Tests\package_manager\Build\PackageUpdateTest::testPackageUpdate on the active codebase using runComposer() to see if that would update correctly and it did. Want to be sure it was not something with how the repo was set up and it was not aware of the new version of the module
    2. Now I am testing whether the module was actually update in the stage. Trying to determine if the staged update happened correctly and it just not copy back correctly. If this is the problem could it be a different version of rsync on gitlab ci?
  • πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

    So for some \Drupal\Tests\package_manager\Build\PackageUpdateTest::testPackageUpdate failing because the update is not happening on the active codebase all though we get no errors before this assertion.

    What seems to be happening is the module is updated in the stage but it is not getting copied back to the active.

    This just seemed to start failing without a related commit.

    ok things I have tried.

    1. Check to see if runComposer() directly in the test would update the package, it does
    2. Checking to see if the module actually gets updated in the stage, it does. But the active code does not reflect the update
    3. making sure there is not new version of rsync being using, There is not gitlabci is using 3.2.3
    4. Check in \Drupal\package_manager\StageBase::apply if the committer has errorOutput even though it does not through and exception
    5. Increase the timeout in \Drupal\package_manager_test_api\ApiController::createAndApplyStage sent to \Drupal\package_manager\StageBase::apply and then on to Composer Stager.
    6. Reverted back Composer-Stager 2-beta5
    7. Check if the composer version on gitlab CI different than my local. It is not but also don't think this would be the issue because I confirm the composer require is working in the stage
    8. Move
      // The post-apply event subscriber in updated_module 1.1.0 should have
          // created this file.
          // @see \Drupal\updated_module\PostApplySubscriber::postApply()
          $this->assertSame('Bravo!', file_get_contents($this->getWorkspaceDirectory() . '/project/bravo.txt'));

      up in the test to confirm the event was fired

    9. Return string(now array from \Drupal\package_manager_test_api\ApiController::finish) so even if we get a 200 response code we know it is from the expected location
  • πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

    PackageInstallTest passes. So for some reason on apply() new code gets moved over to the active site but update code does not. The both rely on composer require

  • πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

    unrelated, just need to upload a logo πŸ™ˆ

  • Pipeline finished with Failed
    11 months ago
    #179470
  • Pipeline finished with Failed
    11 months ago
    Total: 530s
    #179490
  • Pipeline finished with Failed
    11 months ago
    #179522
  • Pipeline finished with Failed
    11 months ago
    Total: 381s
    #179540
  • Pipeline finished with Failed
    11 months ago
    Total: 153s
    #179547
  • Pipeline finished with Failed
    11 months ago
    Total: 228s
    #179575
  • Pipeline finished with Failed
    11 months ago
    Total: 621s
    #179576
  • Pipeline finished with Failed
    11 months ago
    #179586
  • Pipeline finished with Failed
    11 months ago
    #179588
  • Pipeline finished with Failed
    11 months ago
    Total: 643s
    #179591
  • Pipeline finished with Failed
    11 months ago
    Total: 1135s
    #179625
  • Pipeline finished with Failed
    11 months ago
    Total: 892s
    #179646
  • Pipeline finished with Canceled
    11 months ago
    Total: 76s
    #179659
  • Pipeline finished with Failed
    11 months ago
    #179660
  • Pipeline finished with Failed
    11 months ago
    Total: 252s
    #179670
  • Pipeline finished with Failed
    11 months ago
    Total: 302s
    #179678
  • Pipeline finished with Failed
    11 months ago
    Total: 452s
    #179680
  • Pipeline finished with Failed
    11 months ago
    Total: 507s
    #179692
  • Pipeline finished with Running
    11 months ago
    #179697
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    I merged !1066 manually so that we can proceed with getting to the actual debugging, now that we're collecting rsync output on GitLab CI.

  • Pipeline finished with Failed
    11 months ago
    Total: 279s
    #179700
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Now that we are logging rsync output and collecting it in our CI artifacts, we can see why this is happening.

    This is rsync's only output during the commit stage:

    building file list ... done
    ./
    composer.json
    composer.lock
    vendor/
    vendor/composer/autoload_classmap.php
    vendor/composer/autoload_static.php
    vendor/composer/installed.json
    vendor/composer/installed.php
    vendor/phpstan/extension-installer/src/GeneratedConfig.php
    web/autoload.php
    web/modules/contrib/
    web/modules/contrib/main_module/
    web/modules/contrib/main_module/composer.json
    web/modules/contrib/main_module/main_module.info.yml
    web/modules/contrib/main_module/main_module_submodule/
    web/modules/contrib/main_module/main_module_submodule/main_module_submodule.info.yml
    web/sites/default/
    

    updated_module didn't even get moved around!

  • Pipeline finished with Success
    11 months ago
    Total: 320s
    #180311
  • Pipeline finished with Failed
    11 months ago
    Total: 47s
    #180347
  • Pipeline finished with Failed
    11 months ago
    Total: 158s
    #180350
  • Pipeline finished with Failed
    11 months ago
    Total: 155s
    #180351
  • Pipeline finished with Success
    11 months ago
    Total: 222s
    #180356
  • Pipeline finished with Success
    11 months ago
    Total: 257s
    #180377
  • Pipeline finished with Success
    11 months ago
    Total: 294s
    #180496
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Ted, Travis, and I spent some time working on this today. Indeed, rsync was not copying the files...because it doesn't think they changed. Why not? Because they are identical in size, and Symfony recently introduced a change into the Filesystem component which preserves the modification time on copy.

    Although this is a bug that would occur exceptionally rarely in the wild, it could occur, and would be extremely hard to debug at that point. Therefore, to prevent it, we decided that it's best for rsync to use checksumming (the --checksum option) to determine if a file has changed. We did some light performance testing and, for our use case of copying many small files, the impact seems to be negligible.

    So, Travis is adding that to Composer Stager and releasing rc2. We'll update to that, and thus fix the problem.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Failed
    11 months ago
    Total: 1252s
    #180644
  • Pipeline finished with Failed
    11 months ago
    Total: 1497s
    #180654
  • Pipeline finished with Skipped
    11 months ago
    #180665
  • Status changed to Fixed 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024