saltstack-formulas / sudoers-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
41 stars 166 forks source link

WIP: fix(config): remove dictsort that breaks sudoers #67

Open javierbertoli opened 4 years ago

javierbertoli commented 4 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

YES.

Although it's quite possible that 'nothing will break', existing entries order will change and you might end up with a rendered file that does not match current one.

Related issues and/or pull requests

Describe the changes you're proposing

in bc62b6e5 dicsort was applied to the pillar entries. But in the sudoers file order matters so, using dicsort, breaks it.

From man 5 sudoers:

When multiple entries match for a user, they are applied in order. Where there are multiple matches, the last match is used (which is not necessarily the most specific match).

Removed dictsort from the {users,groups,netgroups} specifications.

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

Testing checklist

Additional context

pull-assistant[bot] commented 4 years ago
Score: 1.00

Best reviewed: commit by commit


Optimal code review plan

     fix(config): remove dictsort that breaks sudoers

Powered by Pull Assistant. Last update 7ee2569 ... 7ee2569. Read the comment docs.

myii commented 4 years ago

@javierbertoli I'll concentrate on the map.jinja PR that @daks has put through -- hopefully he can review this PR. One minor comment for the time being: s/dicsort/dictsort/ in all places including the commit message, thanks.

daks commented 4 years ago

If I understand correctly:

I understand the need to this PR but it will make the formula application not idempotent again, which is not critical (I think other formulas have this problem too) but not ideal neither.

I think one way to solve this problem would be to move from dictionaries to lists for data which needs a specific order but it's a more important change.

I'm interested in your opinion on that topic.

javierbertoli commented 4 years ago

@daks You're right, lists seems a more stable approach.

It's a breaking change, anyway, so we'd rather fix it the best way, right? :smile:

I'll give it a try.