Open bugfood opened 8 months ago
There are a couple things I couldn't do quite as well as I would like.
I don't know the best way to document the possible values of a property. I don't think that newvalue
accepts a desc
attribute, but I could be wrong. I asked about this in the puppet community slack:
https://puppetcommunity.slack.com/archives/C0W298S9G/p1703790588151839
This new feature has an interaction with the revision
property. If both revision
and repository_status
are applied, then the exact behavior depends on the order in which the properties are applied:
revision
happens first, then the repo is cleaned according to the .gitignore
of the target revision.repository_status
happens first, then the repo is cleaned according to the .gitignore
of the original revision.
In either case, revision
does a git checkout --force
by default, so some local changes may be clobbered anyway.
Experimentally, revision
is currently applied first, due to being listed first in the file, but I don't think there's any guarantee of this behavior. I asked about this in the puppet community slack:
https://puppetcommunity.slack.com/archives/C0W298S9G/p1703791951239809I don't think either of these issues should gate merging the PR, but I'm definitely willing to try any suggestions.
Thank you, Corey
The remaining acceptance test failures seem to be unrelated to this PR.
-Corey
I updated the PR to support cleaning submodules as well.
Changes in new update:
git reset --hard HEAD
to remove local changes to tracked files-Corey
Changes in new update:
-Corey
Summary
Add support to vcsrepo's git provider to enforce the status of the git repo. The supported statuses are "default_clean" (to clean the repo, while ignoring files in
.gitignore
and "ignore" (to do nothing).Additional Context
This change is written to support other cleaning methods in the future, if desired.
The first commits fix up the existing documentation and unit tests a bit, then the last commit adds the new feature.
Checklist
puppet apply
)