Fix fails in HEAD

Created on 1 September 2024, about 2 months ago
Updated 20 September 2024, about 1 month ago

Problem/Motivation

Changes in Drupal core have caused failures in HEAD - looks like a return type change on a test method.
See https://git.drupalcode.org/project/aggregator/-/jobs/2617052

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @larowlan
  • First commit to issue fork.
  • Pipeline finished with Failed
    about 2 months ago
    Total: 220s
    #271562
  • Status changed to Needs review about 2 months ago
  • 🇮🇳India ankitv18

    Please review MR!21

  • Status changed to RTBC about 2 months ago
  • 🇵🇭Philippines roberttabigue

    Hi @larowlan,

    I reviewed the phpstan next major and phpstan next minor in your latest MR and confirmed that both are now fixed: https://git.drupalcode.org/issue/aggregator-3471498/-/jobs/2624198.

    Running with gitlab-runner 17.3.1 (66269445)
      on gitlab-runner-9dccd6855-vtfgl s8ex1X2yJ, system ID: r_Fs6duF1rd5sK
    Resolving secrets
    Preparing the "kubernetes" executor
    00:00
    "CPURequest" overwritten with "2"
    Using Kubernetes namespace: gitlab-runner
    Using Kubernetes executor with image drupalci/php-8.1-apache:production ...
    Using attach strategy to execute scripts...
    Preparing environment
    00:31
    Using FF_USE_POD_ACTIVE_DEADLINE_SECONDS, the Pod activeDeadlineSeconds will be set to the job timeout: 1h0m0s...
    Waiting for pod gitlab-runner/runner-s8ex1x2yj-project-159040-concurrent-1-g3i5h5kh to be running, status is Pending
    Running on runner-s8ex1x2yj-project-159040-concurrent-1-g3i5h5kh via gitlab-runner-9dccd6855-vtfgl...
    Getting source from Git repository
    00:01
    Fetching changes with git depth set to 20...
    Initialized empty Git repository in /builds/issue/aggregator-3471498/.git/
    Created fresh repository.
    Checking out f9a6e1b1 as detached HEAD (ref is 3471498-fix-fails-in)...
    Skipping Git submodules setup
    Downloading artifacts
    00:06
    Downloading artifacts for composer (next minor) (2624193)...
    Downloading artifacts from coordinator... ok        host=drupal-gitlab-job-artifacts.s3.us-west-2.amazonaws.com id=2624193 responseStatus=200 OK token=glcbt-64
    Executing "step_script" stage of the job script
    00:11
    $ [[ $_CURL_TEMPLATES_REF == "" ]] && export _CURL_TEMPLATES_REF=$_GITLAB_TEMPLATES_REF # collapsed multi-line command
    $ if [ -f $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/phpstan.neon ]; then # collapsed multi-line command
    Using the existing phpstan.neon configuration from the project.
    $ touch $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/phpstan-baseline.neon
    $ php vendor/bin/phpstan --version
    PHPStan - PHP Static Analysis Tool 1.12.0
    $ php --version
    PHP 8.1.29 (cli) (built: Jun  6 2024 17:38:49) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.29, Copyright (c) Zend Technologies
        with Zend OPcache v8.1.29, Copyright (c), by Zend Technologies
    $ echo "Executing php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION"
    Executing php vendor/bin/phpstan analyze web/modules/custom/aggregator-3471498 --configuration=web/modules/custom/aggregator-3471498/phpstan.neon
    $ php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION --error-format=junit > junit.xml || true
       0/145 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
     145/145 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
    $ php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION --no-progress --error-format=gitlab > phpstan-quality-report.json || true
    $ php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION --no-progress || EXIT_CODE=$?
     [OK] No errors                                                                 
    $ php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION --no-progress --generate-baseline --allow-empty-baseline || true # collapsed multi-line command
     [OK] Baseline generated with 0 errors.                                         
    This baseline file is an artifact you can download and use in the project.
    $ sed -i "s#$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/##" junit.xml phpstan-baseline.neon phpstan-quality-report.json || true
    $ exit $EXIT_CODE
    Uploading artifacts for successful job
    00:02
    Uploading artifacts...
    junit.xml: found 1 matching artifact files and directories 
    phpstan-baseline.neon: found 1 matching artifact files and directories 
    phpstan-quality-report.json: found 1 matching artifact files and directories 
    Uploading artifacts as "archive" to coordinator... 201 Created  id=2624198 responseStatus=201 Created token=glcbt-64
    Uploading artifacts...
    junit.xml: found 1 matching artifact files and directories 
    Uploading artifacts as "junit" to coordinator... 201 Created  id=2624198 responseStatus=201 Created token=glcbt-64
    Uploading artifacts...
    phpstan-quality-report.json: found 1 matching artifact files and directories 
    Uploading artifacts as "codequality" to coordinator... 201 Created  id=2624198 responseStatus=201 Created token=glcbt-64
    Cleaning up project directory and file based variables
    00:01
    Job succeeded

    I'm marking this now as 'RTBC'.

    Thank you.

  • Status changed to Needs work about 1 month ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Looks like the MR is failing?

  • First commit to issue fork.
  • 🇺🇸United States dcam

    The fails in Drupal\Tests\aggregator\Functional\Jsonapi\ItemTest were due to 📌 Speed up JSON:API ResourceTestBase Fixed . In that issue the method names were changed.

    FeedTest will be harder to fix, I think.

  • 🇺🇸United States dcam

    @larowlan the issue that I referenced in #8 also combined several JSON API test methods into one for performance reasons. This caused a problem for us because entities created by earlier tests remain in the database. Aggregator enforces uniqueness in feed titles and URLs. Due to this change, suddenly there was an existing feed in the DB with a title and URL that it wanted to create, causing failures.

    I think the solution has to be deleting the existing feed before the other methods run. I queried for the feed entity rather than hard-coding the ID, just in case that changes someday due to further upstream edits.

Production build 0.71.5 2024