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 imports using tplroot #77

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fgionghi
Copy link

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

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?

No.

Describe the changes you're proposing

The problem was that salt-minion didn't cache all the files used by the formula on windows clients.
In fact when I applied the packages.chocolatey state only the chocolatey.sls file was found on the cache folder.
This triggered an error because salt couldn't find the map.jinja file.

Importing files using tplroot instead of using relative path seems to fix the problem.

@myii
Copy link
Member

myii commented Sep 21, 2021

Thanks for your contribution, @fgionghi.

Now this is interesting, because we only just moved away from tplroot recently in #74. You can see some reasons there. We've also discussed it with the Formulas team and we're planning to move to these relative imports for all formulas. For that reason, what you're mentioning here is important, since it appears to be causing an issue.

I must note that we've got Windows testing set up for this formula and it has been working well for some time now (https://github.com/saltstack-formulas/packages-formula/actions). That is specifically checking the chocolatey state:

provisioner:
state_top:
base:
'*':
- packages.chocolatey
pillars:
top.sls:
base:
'*':
- packages
pillars_from_files:
packages.sls: test/salt/pillar/windows.sls

This is the test pillar being used there:

packages:
chocolatey:
required:
pkgs: []
wanted:
Firefox:
package_args: "/l:en-GB"
jq:
version: '1.5'
# `1.6` already installed on the pre-salted image
force: true
notepadplusplus:
version: '7.8.8'
unwanted:
- GoogleChrome
- hg

In order to get to the bottom of this, it would be helpful if you can provide details about your environment, so that we can attempt to reproduce the error. Filling out the bug report template would be useful.

@fgionghi
Copy link
Author

Ok, I submitted an issue: #79.
Let me know if you need more information.
Thank you.

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

Successfully merging this pull request may close these issues.

3 participants