๐Ÿ‡ฎ๐Ÿ‡ณIndia @akulsaxena

Account created on 26 September 2024, 28 days ago
#

Merge Requests

Recent comments

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Since the ticket is made for v1.0.3 and the issue is already fixed for that branch and cannot be replicated, no patch is required. So, closing the issue.

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hey @pfrenssen
Thanks for replying.
I'm kinda stuck with this composer build fail issue and can use some help. If any of the maintainers can have a look at it and help me out a little, it'd be great!

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

When you install the theme from the link " https://www.drupal.org/project/pets_clinic โ†’ ", the latest version v1.0.3 is installed and the theme works as intended and the issue cannot be reproduced - i.e. there exists the required space at the bottom of the save button.

But the branch in the issue "3469153" is set to 1.0.x, and when the theme is cloned from the github repository mentioned in the issue, the issue is reproduced and there exists no space at the bottom of the save button.

Before Patch:

On applying the patch on version 1.0.x, the theme works as intended and the required space at the bottom of the save button is added.

Applying Patch:

After Patch:

So changing the version of the issue to 1.0.x-dev and moving the issue to RTBC.

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hi @qichanghai and @mxh
I did some unintended mistakes earlier but I tried to resolve them and I think they are now fixed. Can you please take a look now.
Thanks

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hi @vladimiraus, @rjjakes and @devdesagar
Since all the errors have been fixed and the issue has been completed and moved to RTBC, can we move this issue to fixed now?

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hey @pfrenssen
I tried to make the pipelines all green. so i cloned this issue and solved the phpcs errors and added a cspell.json file to add new words to cspell dictionary
Those are the only changes i made in the branch
But the composer build is failing. Can you please have a look?
Thanks

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Working on fixing the remaining phpcs and cspell errors

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hi @pfrenssen
Thank you for the credit
It was my first credit. Means a lot.
I'll keep the mistakes i made in mind so that i can do even better from next time.

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Thanks @pfrenssen,

Should I move this strict type declaration issue to needs review now that the tasks mentioned in this issue are complete or let it stay in needs work?

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Solved all PHPCS and cspell errors
Added compatibility with Drupal ^12 to solve upgrade status pipeline failing when using Drupal 11
All pipelines passed with no errors or warnings

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hey @pfrenssen

So I was trying to cast the variables into int to remove the errors in phpUnit pipeline.
Please note, that these errors are not related to the changes I made in the branch. All I changed was added strict type declarations and a custom file to add ruleset as mentioned in the issue. But when i try to solve the phpUnit pipeline error, i cast the variable given into int and then run the pipeline again and then it gives me same casting error for another variable.
Like for example - Similiarly in file MonthlyRecurringDateTest.php, the method testFindMonthDaysBetweenDates expects the $day argument to be an int, but a string is being passed. when i casted it into int and ran the pipeline again, it gave me the same error for $year, and then for $month when i ran the pipeline again and then for $timestamp. So what it is doing is giving me one error at a time and then when i solve that and commit and then push and run the pipeline again, thats when it gives me another error. I dont know how many variables need casting and at how many places as I did not write the code and dont know what has been done in each file and solving this typecasting error one by one doesnt seem the right approach.
Please have a look

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hey @pfrenssen
In this issue you have provided the branch recurring_events-3480495. When i ran phpcs in it, it showed a few files missing the file doc comment and only 3 files missing the strict_type declarations. I think the rest of the files that are missing the declarations are in the parent branch recurring_events.
Also, phpcs gives a recommendation to change the permission from "access administration pages" to "administer site configuration" in line 198 in the recurring_events.routing.yml file. Should I let the permission as it is, or should I change it as to what phpcs suggests.
The errors of phpunit also exist in the parent module (recurring_events) and not in the fork given in this issue.

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Thanks for the help
I'll work on the errors and solve them soon

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hi @pfrenssen
I made the necessary changes rebased the commits to 3.0.x branch. the pipeline issue still shows up. Please have a look

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Trying to resolve the error again

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hi @pfrenssen
I made the necessary changes and Included declare(strict_types=1); at the top of every PHP file.
I also Updated the coding standards to require strict types by creating a phpcs.xml.dist file
But when i am creating an MR, the pipeline is failing at composer build

This is the error that shows up:

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.3-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-162884-concurrent-0-g2pu6aqs to be running, status is Pending
Running on runner-s8ex1x2yj-project-162884-concurrent-0-g2pu6aqs via gitlab-runner-9dccd6855-vtfgl...
Getting source from Git repository
00:01
Fetching changes...
Initialized empty Git repository in /builds/issue/recurring_events-3480495/.git/
Created fresh repository.
Checking out 8a88c2b2 as detached HEAD (ref is 3480495-adopt-strict-typing)...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:01
$ composer --version
Composer version 2.8.0 2024-10-02 16:40:29
PHP version 8.3.12 (/usr/local/bin/php)
Run the "diagnose" command to get more detailed diagnostics output.
$ # Forks are named "module_name-12345", so strip out the number part to get the correct module name. # collapsed multi-line command
$ if [ "$_SHOW_ENVIRONMENT_VARIABLES" == "1" ]; then # collapsed multi-line command
$ if [ "$_LENIENT_ALLOW_LIST" != "" ]; then # collapsed multi-line command
$ [[ $_CURL_TEMPLATES_REF == "" ]] && export _CURL_TEMPLATES_REF=$_GITLAB_TEMPLATES_REF # collapsed multi-line command
$ echo "Executing curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/expand_composer_json.php"
Executing curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/expand_composer_json.php
$ curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/expand_composer_json.php
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  8538  100  8538    0     0  69577      0 --:--:-- --:--:-- --:--:-- 69983
$ if [[ -f composer.json ]]; then # collapsed multi-line command
$ php expand_composer_json.php || EXPAND_COMPOSER_EXIT_CODE=$?
drupalConstraint = 10.3.6
core_version=10.3.6
Writing output to composer.json
$ if [[ "$EXPAND_COMPOSER_EXIT_CODE" != "" ]]; then echo "EXPAND_COMPOSER_EXIT_CODE=$EXPAND_COMPOSER_EXIT_CODE"; exit $EXPAND_COMPOSER_EXIT_CODE; fi
$ composer install $COMPOSER_EXTRA
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
- Required (in require-dev) package "composer/installers" is not present in the lock file.
- Required (in require-dev) package "drupal/core-composer-scaffold" is not present in the lock file.
- Required (in require-dev) package "cweagans/composer-patches" is not present in the lock file.
- Required (in require-dev) package "drupal/core-recommended" is not present in the lock file.
- Required (in require-dev) package "drupal/core-dev" is not present in the lock file.
- Required (in require-dev) package "php-parallel-lint/php-parallel-lint" is not present in the lock file.
This usually happens when composer files are incorrectly merged or the composer.json file is manually edited.
Read more about correctly resolving merge conflicts https://getcomposer.org/doc/articles/resolving-merge-conflicts.md
and prefer using the "require" command over editing the composer.json file directly https://getcomposer.org/doc/03-cli.md#require-r
Uploading artifacts for failed job
00:02
Uploading artifacts...
.: found 373 matching artifact files and directories 
.git: excluded 1 files                             
.git/**/*: excluded 71 files                       
Uploading artifacts as "archive" to coordinator... 201 Created  id=3074846 responseStatus=201 Created token=glcbt-64
Uploading artifacts...
build.env: found 1 matching artifact files and directories 
Uploading artifacts as "dotenv" to coordinator... 201 Created  id=3074846 responseStatus=201 Created token=glcbt-64
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1

I tried reverting the changes in composer.json and then adding back the changes and updated the lock file but the error still shows up. I also tried changing the branch in which I was merging thinking maybe i was working in the wrong branch but that didnt work as well.

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hi @pfrenssen

What does Update our coding standards to require strict types mean
We have to add a custom sniff for phpcs and a custom ruleset, or we just have to add a comment in the existing xml file

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hi, I am a novice and am trying to do my best. I tried to improve what I did. I also got back the code blocks that were deleted and fixed all the PHPCS errors and warnings. The only warnings that remain are in Content.php file that are of a few unused variables. Please check if this works?

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

I just noticed what happened in the ParametersCollectionForm.php and i am sorry for that. I didnt notice that earlier. I could try to work on the issue again with more accuracy if you permit

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

The functionalities were duplicated multiple times in the Content.php file and those duplicates are the only blocks of code i removed. there still exists one instance of each functionality whose duplicate i have removed. i have also cleared all the phpcs errors and warnings that were present in the given 28 files

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Sorry for the misunderstanding
I removed those blocks because those functionalities were duplicated when i committed for the first time and had the same code inside them multiple times, so i removed the duplicates and kept one instance of each functionality.

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Solved all PHPCS errors and warnings

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Working on it

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Working on it

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

PHPCS (Coding standards) issues solved in 17 files.
PHPCS pipeline is now passing
All other pipelines now pass except for PHPUnit which gives the following error:

Uploading artifacts as "archive" to coordinator... 201 Created  id=3042729 responseStatus=201 Created token=glcbt-64
Uploading artifacts...
junit.xml: found 1 matching artifact files and directories 
WARNING: /builds/issue/lupus_decoupled-3479682/web/sites/default/files/simpletest/phpunit-*.xml: no matching files. Ensure that the artifact path is relative to the working directory (/builds/issue/lupus_decoupled-3479682) 
Uploading artifacts as "junit" to coordinator... 201 Created  id=3042729 responseStatus=201 Created token=glcbt-64
Cleaning up project directory and file based variables
ERROR: Job failed: command terminated with exit code 2

It says the phpunit-*.xml file is not found in the web folder (project root directory) and i dont have access to the root directory.

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

akulsaxena โ†’ made their first commit to this issueโ€™s fork.

๐Ÿ‡ฎ๐Ÿ‡ณIndia akulsaxena

Hi @sumit_thakur,
I changed the encoding from UTF-16 to UTF-8 as requested in the last comment and solved the phpcs issues in Readme.md file.
On creating the MR, it shows "File suppressed by a .gitattributes entry or the file's encoding is unsupported."
What encoding do we need to use in Readme.md?

Production build 0.71.5 2024