Bug #23416
openWhen we have a .gitignore in /var/rudder/configuration-repository/techniques, technique editor can't save the techniques
Description
When testing an approach to have a sub git repository in /var/rudder/configuration-repository/techniques , synchronized with an external gitlab, adding a .gitignore there to specifically ignore some techniques from being synchronized prevented the technique editor from saving/updating techniques matching the .gitignore - the save button seemed to work, no error were reported, yet when reloading the tehcnique editor, the technique was not created/updated
To avoind such issues (or other related issue), we shoud force the commits from the webapp (and probably do the same for directives/groups/etc as it may happen also for this folders)
As a bonus, it would allow to authorize sub-git to synchronize partially data
Updated by Vincent MEMBRÉ about 1 year ago
- Target version changed from 7.3.6 to 7.3.7
Updated by François ARMAND about 1 year ago
Just to get the use case right:
- you have a directory under /technique that is a git clone of some repository, something like:
- by default, nothing in that directory must be seens (so the whole directory content is ignored)
- some technique in the directory need to be seen, so they were manually added with 'git add --force' to overcome the ignore,
- then they are seen in the technique editor,
- but if modified by the technique editor, then modification is ignored.
So directory layout is:
- /var/rudder/configuration-repository/techniques - my-repo-clone - .gitignore (contains @*@) - techique1/1.0 (git add --force done at least once) - technique.json - techique2/1.0 (ignored; no git add --force done) - technique.json
The, in technique editor, if technique1/1.0 is modified, then you see the behavior (technique editor will says it saves the new technique but it is not actually saved).
If so: it a totally not supported use case, so it is awaited that some problems arise, and some things will need to be done manually.
The first thing we need to check is that the technique editor respects what is in git/gitignore. I believe it should not "see" technique in FS but not in git (not sure it's the case for now).
Then, using "force" by default might be a good idea. I'm not sure if it causes errors in place of silent "not what we want"; but if so, then it's likely what we want.
Finally, since at some point a manual operation will be needed, can't it be to add an "unignore" line in gitignore? Perhaps it even gives a "ok" behavior as of now with something like:
// .gitignore in @my-repo-clone
# Ignore everything * # But not these files... !.gitignore !technique.json !metadata.xml # .cf, ps1, reports etc # ...even if they are in these subdirectories !*/technique1/1.0/*
Updated by François ARMAND about 1 year ago
So missed a point: the use case is to synchronize ncf_techniques
, which complicate the mental model of what is sync externaly and what is not.
In that case, perhaps we must use git add --force
at the correct level, and the only way to know what is sync is to exec git commands in the correct directory.
Alternative ideas:
- use an other directory (ie other category, either under ncf_techniques
or not) for the remote repo. Then the mental model is "any technique in that repo is sync externaly". A new technique can be created in another directory, and when ready, git moved
/git push
manually to the sync directory.
- define a different gitignore file for the remote repos (via .git/config -> [core] excludesfile = ...
). Then in that gitignore, ignore everything BUT a list of techniques. That list will be sync in remote repos, and you can see more easely what techniques are sync. Addind a technique in remote is then just adding an un-ignore line in the file. We can even give an explicit name to the gitignore, for ex list-of-synchronized-directives
)
Updated by Vincent MEMBRÉ about 1 year ago
- Target version changed from 7.3.7 to 7.3.8
Updated by Vincent MEMBRÉ about 1 year ago
- Target version changed from 7.3.8 to 7.3.9
Updated by Vincent MEMBRÉ about 1 year ago
- Target version changed from 7.3.9 to 7.3.10
Updated by Vincent MEMBRÉ 12 months ago
- Target version changed from 7.3.10 to 7.3.11
Updated by Vincent MEMBRÉ 10 months ago
- Target version changed from 7.3.11 to 7.3.12
Updated by Vincent MEMBRÉ 9 months ago
- Target version changed from 7.3.12 to 7.3.13
Updated by Vincent MEMBRÉ 9 months ago
- Target version changed from 7.3.13 to 7.3.14
Updated by Vincent MEMBRÉ 7 months ago
- Target version changed from 7.3.14 to 7.3.15
Updated by Vincent MEMBRÉ 6 months ago
- Target version changed from 7.3.15 to 7.3.16
Updated by Vincent MEMBRÉ 5 months ago
- Target version changed from 7.3.16 to 7.3.17