Open dshcherb opened 5 years ago
I'm not sure I understand your workflow here. With a 'legacy' charm, normally make sync
is run manually to bring the charmhelpers files into the charm. Then one manually checks that everything looks okay and adds/updates any new charmhelper files.
However, I can see a perspective where the make sync
ought to do a git add <charmhelpers-dir>
out of courtesy. Is that what you mean?
@ajkavanagh
Is that what you mean?
Yes.
So, it would probably be reasonably complicated. In theory, the charm may be managed under a different vcs than git, so the code would need to check that before doing anything.
I wonder if the simplest approach isn't to add it to the charm's Makefile instead? i.e make sync && git add <whatever-the-charmhelpers-dir-is-for-that-charm>
. It's not done centrally, but it would mean that the make sync code wouldn't have to be vcs-type aware. Thoughts?
@ajkavanagh
It's not done centrally
I think that's the key point. I wonder if just checking for .git
presence and then attempting git add
is reasonable.
Just encountered a situation where the current
make sync
behavior with usingcharm_helpers_sync.py
is lacking.charm_helpers_sync.py currently does not do
git add
after it downloads charm-helpers. https://github.com/juju/charm-helpers/blob/master/tools/charm_helpers_sync/charm_helpers_sync.pyA natural thing to do is
git add -u && git commit -m '...'
, however, for files in charm-helpers not previously tracked by the particular charm repo itself, this will not be enough.A recent sync left me with the following files untracked:
Which then resulted in a functional test failure due to a missing module:
The module is indeed missing: https://review.opendev.org/gitweb?p=openstack/charm-neutron-openvswitch.git;a=tree;f=hooks/charmhelpers/fetch;hb=c6256fa069fae0f210efc2be2a8401d315ae0e8a
It would be useful to do
git add
after a sync is made automatically incharm_helpers_sync.py
.