Skip to content
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

Fix salt-lint violations => implement semantic-release inc. CI #129

Closed
myii opened this issue Oct 10, 2019 · 5 comments · Fixed by #130
Closed

Fix salt-lint violations => implement semantic-release inc. CI #129

myii opened this issue Oct 10, 2019 · 5 comments · Fixed by #130
Labels

Comments

@myii
Copy link
Member

myii commented Oct 10, 2019

Having an initial look at what would be required to get semantic-release running for this formula. The whole package involves introducing multiple linters to check the code during the Travis run. The current codebase (at 96b653d) has a large number of salt-lint violations:

Even if semantic-release takes a while to be introduced to this formula, these violations really need to be resolved.

@myii
Copy link
Member Author

myii commented Oct 10, 2019

@hatifnatt @xenadmin Actually, this formula is in pretty ripe for conversion. Setting version_repo: '4.4' for installation, we've got a nice set of passes already:

That's based on the formula-specific parts of top.sls as suggested in the README, i.e.:

      state_top:
        base:
          '*':
            - zabbix.agent.repo
            - zabbix.agent.conf
            - zabbix.server.repo
            - zabbix.server.conf
            - zabbix.frontend.repo
            - zabbix.frontend.conf
  • We only select up to a maximum of 6 jobs, varying across OSes and Salt versions, so probably end up with:
    • default-fedora-30-develop-py3
    • default-debian-9-2019-2-py3
    • default-ubuntu-1804-2019-2-py3
    • default-ubuntu-1604-2018-3-py2
    • default-fedora-29-2018-3-py2
    • default-centos-6-2017-7-py2

If you're OK with the tabs being changed to spaces, we could have this rolled out pretty soon.

@myii myii changed the title Fix salt-lint violations Fix salt-lint violations => implement semantic-release inc. CI Oct 10, 2019
@hatifnatt
Copy link
Collaborator

I don't have numbers how widely various OS-es and specific versions are used on servers, personally I'm using mostly Debian and sometimes Ubuntu so I can vote for Debian 10.
I'm totally Ok about switching to spaces in yaml, sls ans jinja files which are not templates. But I'm strongly against converting tabs to spaces in template files, tabs there for reason :)
Same with a long lines, I see no reason to put effort in removing long lines from templates, long lines in current formula templates are used for easier comparison in a diff tools like Meld, etc.

@myii
Copy link
Member Author

myii commented Oct 11, 2019

I don't have numbers how widely various OS-es and specific versions are used on servers, personally I'm using mostly Debian and sometimes Ubuntu so I can vote for Debian 10.

We're still in the process of getting Debian 10 rolled out in our CI setup. There are so many combinations to cater for that we can only make a best effort. To give you an idea of the current situation, have a look at this wiki page:

... But I'm strongly against converting tabs to spaces in template files, tabs there for reason :)

And that's why I asked, due to your familiarity with this formula. In other formulas where the linters are tripped, we can add them to the ignore list.

Same with a long lines, I see no reason to put effort in removing long lines from templates, long lines in current formula templates are used for easier comparison in a diff tools like Meld, etc.

That's where I disagree with you. Long lines are nearly always poor for comprehension and maintainability. It's hard for new contributors to get their heads around what is going on. The diffs in GitHub are poor. It indicates that the underlying data structures can be improved. Even simply making better use of Jinja variables can resolve a lot of these problems.

In this case, we can also add zabbix/files/default/etc/zabbix/zabbix_proxy.conf.jinja to the ignores list, so it won't be a problem.


With that all said, shall we start with what we've got? We can always improve things over time. It actually happens, since we ensure that common updates are propagated to all of the semantic-release formulas.

@hatifnatt
Copy link
Collaborator

I'm only talking about long lines in this formula templates, they can be shortened for sure, but I don't think it's worth it. So I can suggest simply add all templates to ignore list, at least until they will be improved in terms of line length.
Personally, I do not mind to start.

myii added a commit to myii/zabbix-formula that referenced this issue Oct 12, 2019
myii added a commit to myii/zabbix-formula that referenced this issue Oct 12, 2019
myii added a commit to myii/zabbix-formula that referenced this issue Oct 12, 2019
saltstack-formulas-travis pushed a commit that referenced this issue Oct 12, 2019
# [0.21.0](v0.20.5...v0.21.0) (2019-10-12)

### Bug Fixes

* **init.sls:** fix `salt-lint` errors ([](ff28364))
* **pillar.example:** fix `yamllint` violations ([](b51907d))
* **repo:** ensure `debconf-utils` is installed for Debian-based OSes ([](4980350))

### Continuous Integration

* **inspec:** add pillar to use for testing the `default` suite ([](581a748))

### Documentation

* **readme:** move to `docs/` directory and apply common structure ([](f0f1563))

### Features

* **semantic-release:** implement for this formula ([](40e78a2)), closes [#129](#129)

### Tests

* **inspec:** add tests for packages, config files & services ([](4facac6))
@saltstack-formulas-travis

🎉 This issue has been resolved in version 0.21.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 a pull request may close this issue.

3 participants