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

refactor(formula): align to template-formula & improve ci #283

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

noelmcloughlin
Copy link
Member

@noelmcloughlin noelmcloughlin commented Sep 27, 2020

BREAKING CHANGE: Module .sls files are moved to /config/modules/ subdirectory.
template-formula alignment may introduce a breaking change. See README for states.

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

YES

  • moved modules SLS to config/modules/
  • aligned to template-formula

Related issues and/or pull requests

Includes #225 and #259
Fixes #79, #238, #258, #262, #265, #266

Describe the changes you're proposing

While using this formula I saw various issues and inconsistencies.
This PR is an attempt to improve formula quality while keeping the same functionality.

I'm sorry the PR is so big but there is no easy way to improve feature/test coverage without restructuring.
The CI/CD is passing for all platforms except:

  • CentOS 6 (works for me in Vagrant, but not Travis)
  • Archlinux (needs work)

Further work is required to address remaining open issues.
There may be better ways of processing modules but this PR relies on the existing solutions.

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

@noelmcloughlin noelmcloughlin requested a review from a team as a code owner September 27, 2020 10:56
@pull-assistant
Copy link

pull-assistant bot commented Sep 27, 2020

Score: 0.99

Best reviewed: commit by commit


Optimal code review plan

     refactor(formula): align to template-formula & improve ci

     feat(arch): add archlinux support

Powered by Pull Assistant. Last update 3759b66 ... cabc79f. Read the comment docs.

@noelmcloughlin noelmcloughlin force-pushed the refactor branch 28 times, most recently from 7b1b09d to 53a679f Compare October 1, 2020 20:33
@noelmcloughlin noelmcloughlin force-pushed the refactor branch 8 times, most recently from 168d70b to 61d3646 Compare October 3, 2020 23:40
@noelmcloughlin
Copy link
Member Author

Added support for Archlinux (CI/CD) with HTTPS/SSL and modules.

FEATURE: Archlinux support
FEATURE: Windows support
FEATURE: Enhanced CI/CD
FEATURE: modular states

BREAKING CHANGE: 'apache.sls' converted to new style 'init.ssl'
BREAKING CHANGE: "logrotate.sls" became "config/logrotate.sls"
BREAKING CHANGE: "debian_full.sls" became "config/debian_full.sls"
BREAKING CHANGE: "flags.sls" became "config/flags.sls"
BREAKING CHANGE: "manage_security" became "config/manage_security.sls"
BREAKING CHANGE: "mod_*.sls" became "config/mod_*.sls"
BREAKING CHANGE: "no_default_host.sls" became "config/no_default_host.sls"
BREAKING CHANGE: "own_default_host.sls" became "config/own_default_host.sls"
BREAKING CHANGE: "register_site.sls" became "config/register_site.sls"
BREAKING CHANGE: "server_status.sls" became "config/server_status.sls"
BREAKING CHANGE: "vhosts/" became "config/vhosts/"
BREAKING CHANGE: "mod_security/" became "config/mod_security/"

NOT-BREAKING CHANGE: 'config.sls' became 'config/init.sls'
NOT-BREAKING CHANGE: 'uninstall.sls' symlinked to 'clean.sls'
@noelmcloughlin
Copy link
Member Author

I discussed this PR with @myii and because it's too big to review I'll selfie-merge on the following basis:

  1. firstly the commit message lists all breaking/unbreaking changes
  2. The extended and improved CI/CD is passing
  3. That I'll become code owner if necessary.

Pillar data is unchanged. The primary change is state-names were refactored as part of the alignment with template-formula.

@noelmcloughlin noelmcloughlin merged commit 9043289 into saltstack-formulas:master Oct 5, 2020
@saltstack-formulas-travis

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@myii
Copy link
Member

myii commented Oct 5, 2020

@noelmcloughlin Nice work, the breaking changes listed in the changelog make things so much easier to follow -- appreciate it.

@noelmcloughlin noelmcloughlin deleted the refactor branch October 5, 2020 16:51
@myii
Copy link
Member

myii commented Oct 5, 2020

Just a little note for posterity.

I wasn't able to git pull these changes without manual operation (but I do use my formulas' repos in non-standard ways to most people). I was getting this error:

error: Updating the following directories would lose untracked files in them:
        apache/vhosts

Was able to check the problem using git clean in dry-run mode:

$   git clean -xdfn
...
Would remove apache/vhosts/.cleanup.sls.un~
Would remove apache/vhosts/.minimal.tmpl.un~
Would remove apache/vhosts/.proxy.tmpl.un~
Would remove apache/vhosts/.redirect.tmpl.un~
Would remove apache/vhosts/.standard.tmpl.un~
...

So the main point is that making modifications to the directory structure could lead to issues with certain files being present in the directories that are being moved (i.e. those covered by .gitignore).

This is more so a point of awareness, there's not much we could do about this.

myii added a commit to myii/ssf-formula that referenced this pull request Oct 6, 2020
myii added a commit to myii/ssf-formula that referenced this pull request Oct 6, 2020
myii added a commit to myii/ssf-formula that referenced this pull request Oct 6, 2020
@myii
Copy link
Member

myii commented Oct 6, 2020

Standardised this implementation with 7dc0ece.

@noelmcloughlin It looks like you're using an older version of libtofs.jinja when preparing these PRs. The new version has been pushed to pretty much all formulas that are using TOFS.

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.

Consistency: state: enabled and enabled: true.
3 participants