Bug #23416


When we have a .gitignore in /var/rudder/configuration-repository/techniques, technique editor can't save the techniques

Added by Nicolas CHARLES 14 days ago. Updated 7 days ago.

Web - Config management
Target version:
UX impact:
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:


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

Actions #1

Updated by Vincent MEMBRÉ 13 days ago

  • Target version changed from 7.3.6 to 7.3.7
Actions #2

Updated by François ARMAND 12 days 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...
# .cf, ps1, reports etc

# ...even if they are in these subdirectories

Actions #3

Updated by François ARMAND 12 days 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)

Actions #4

Updated by Vincent MEMBRÉ 7 days ago

  • Target version changed from 7.3.7 to 7.3.8

Also available in: Atom PDF