@justinvelluppillai opened this Issue on November 2nd 2022 Member

The generate:travis-yml command is generating yaml files with broken newlines. I tested in PHP 8.1 and 7.4 with the same results. It could be worth testing this works in PHP 7.2 as this may have been the last PHP version it was successfully run in.

Ideally we don't update the travis.yml files manually, but can use the command.

Expected Behavior

Properly formatted yaml files for --core and --plugin=<PluginName>

Current Behavior

Some newlines are missing (not all new lines)

Possible Solution

Steps to Reproduce (for Bugs)

  1. Run the command ./console generate:travis-yml --core or ./console generate:travis-yml --plugin=TagManager
  2. Compare the output travis.yml file with the existing one and you'll see it has some newlines missing, breaking the formatting

Context

Your Environment

  • Matomo Version:
  • PHP Version:
  • Server Operating System:
  • Additionally installed plugins:
  • Browser:
  • Operating System:
@peterhashair commented on November 3rd 2022 Contributor

It seems like when twig renders the template missing some of the\n line breaks, caused by php8 or a higher version. Once I run composer update update twig/twig from 1.18 to v1.44.7, generated format starts to work. Do we consider the update? Which is that PR https://github.com/matomo-org/travis-scripts/pull/81

@peterhashair commented on November 7th 2022 Contributor

PR https://github.com/matomo-org/travis-scripts/pull/81 is merged, but seems like we still need to do a composer install on the ./tests/travis/generator/ to update vendor, not sure if should we manually do it, or if there or there is a GitHub step for auto-update.

@sgiehl commented on November 7th 2022 Member

I didn't have a look in detail here, but simply merging this PR might possibly even create more trouble that we currently have. On travis we try to auto generate the travis.yml. That is always done in the first job (not for PRs I think). This jobs are running with PHP 7.2 in most cases. So if updating twig changes the result also for PHP 7.2, this might mean that those jobs will start failing now and we need to update all .travis.yml files in all plugin repos.

@peterhashair commented on November 7th 2022 Contributor

@sgiehl right maybe is out of scale for this issue, but since PHP 7.2 is deprecated. Do we want to update the test from 7.2 to 7.4? I test 7.4 worked as expected.

@sgiehl commented on November 8th 2022 Member

No. We always need to run our tests against the lowest PHP version we are supporting. Otherwise we might miss incompatibilities there...

@sgiehl commented on November 15th 2022 Member

Just a note: On PHP 7.2 the output is completely as expected.

@peterhashair commented on November 17th 2022 Contributor

close this issue now, test PHP 7.2 works

This Issue was closed on November 17th 2022
Powered by GitHub Issue Mirror