Skip to content

[php/ng] support the use of a list of php versions #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 7, 2019

Conversation

arthurzenika
Copy link
Contributor

Related to #138

@aboe76 aboe76 requested review from alxwr and javierbertoli March 26, 2019 19:20
@arthurzenika
Copy link
Contributor Author

the approach here is to "post-process the map dictionnary" when the php version is a list

@@ -10,5 +10,5 @@
- source: salt://php/ng/files/php.ini
- template: jinja
- context:
config: {{ serialize(settings) }}
config: {{ serialize(odict(settings)) }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this is needed

{% endif %}
{% endfor %}
{% do conf_settings.global.update({'pid': '/var/run/php' + version + '-fpm.pid' }) %}
{% do conf_settings.global.update({'error_log': '/var/log/php' + version + '-fpm.log' }) %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not very satisfied with this part, I would want the loop above to be more generic but for some reason I couldn't get it to change the subdictionnary

extend:
php_fpm_service:
service:
- watch:
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now I'm not sure how this handles when 7.3 as a float is used. Is setting the version without quotes supported by the existing version of the formula ?

@alxwr alxwr self-assigned this Apr 9, 2019
@sschne
Copy link

sschne commented Apr 12, 2019

I currently see the issue, that you cannot remove the default www.conf with multi version use.
In single version use, you could add a php:ng:fpm:pools:www.conf:enabled: False and it would remove the default pool for you.
Since we use a dict for pools, with the file name as key, you cannot use that trick to remove the default pool for both versions and end up with orphaned www.conf files. How to resolve that?

@arthurzenika
Copy link
Contributor Author

@pather87 can you explain your use case so I can test it out ?

@sschne
Copy link

sschne commented Apr 30, 2019

To remove the default www.conf pool, you can add:

php:
  ng:
    fpm:
      pools:
        'www.conf':
          enabled: False

With the multiphp extension, this is not possible anymore, since to remove both pools of each version:

php:
  ng:
    version:
    - "7.2"
    - "7.3"
    fpm:
      pools:
        'www.conf':
          phpversion: "7.2"
          enabled: False
        'www.conf':
          phpversion: "7.3"
          enabled: False

This is obviously a duplicate key error. Maybe should add a switch in pillars to remove the default pool of both PHP versions. I will provide a patch.

@n-rodriguez
Copy link
Contributor

n-rodriguez commented Jul 1, 2019

I've just tested it (in production) : great work 👍

@arthurzenika
Copy link
Contributor Author

@n-rodriguez great news, let's try to get this merged. @philpep should take a look at this merge request today to give us an extra opinion.

@philpep philpep self-requested a review July 10, 2019 10:06
@myii
Copy link
Contributor

myii commented Jul 10, 2019

@arthurlogilab Since starting this PR, this formula has been updated to use semantic-release. In order to benefit from that upon merge, the commit messages need to be updated accordingly. Please refer back to the supplied documentation.

A few converted examples from this PR:

  • feat(php/ng): support the use of a list of php versions
  • refactor(php/ng): don't iterate on string, make sure list is not string
  • style(pillar.example): add line break

Note, if you rebase this PR against the latest upstream, you'll get the Travis checks running in this PR. That will also run commitlint, to ensure that the commit messages are appropriately formatted.

@arthurzenika
Copy link
Contributor Author

@myii great news, I'm eager to work with this tool. Does that mean I should do some git commit --amend then git push --force on my fork so that the existing commits get replaced ?

@myii
Copy link
Contributor

myii commented Jul 10, 2019

@myii great news, I'm eager to work with this tool. Does that mean I should do some git commit --amend then git push --force on my fork so that the existing commits get replaced ?

@arthurlogilab Effectively, yes. When there are a number of commits needing their messages modified, I prefer to use git rebase <starting_point> -i. Then git push -f as you've mentioned.

@arthurzenika
Copy link
Contributor Author

@myii done, lets see what travis says.

@myii
Copy link
Contributor

myii commented Jul 10, 2019

You cracked it the first time, great job @arthurlogilab!

@myii
Copy link
Contributor

myii commented Aug 2, 2019

@n-rodriguez Doesn't this need to be merged before #183?
@arthurlogilab Are you waiting for a specific reviewer before this can be merged?

@arthurzenika
Copy link
Contributor Author

@myii not waiting for a specific reviewer, no. Thanks !

@myii myii merged commit ef25eb9 into saltstack-formulas:master Aug 7, 2019
@myii
Copy link
Contributor

myii commented Aug 7, 2019

Merged, thanks @arthurlogilab and to all others for their comments and reviews.

@myii myii mentioned this pull request Aug 7, 2019
@saltstack-formulas-travis

🎉 This PR is included in version 0.39.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants