Project

General

Profile

Actions

Bug #23416

open

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

Added by Nicolas CHARLES 8 months ago. Updated 14 days ago.

Status:
New
Priority:
N/A
Assignee:
-
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No

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

Actions #1

Updated by Vincent MEMBRÉ 8 months ago

  • Target version changed from 7.3.6 to 7.3.7
Actions #2

Updated by François ARMAND 8 months 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/*

Actions #3

Updated by François ARMAND 8 months 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É 8 months ago

  • Target version changed from 7.3.7 to 7.3.8
Actions #5

Updated by Vincent MEMBRÉ 6 months ago

  • Target version changed from 7.3.8 to 7.3.9
Actions #6

Updated by Vincent MEMBRÉ 6 months ago

  • Target version changed from 7.3.9 to 7.3.10
Actions #7

Updated by Vincent MEMBRÉ 5 months ago

  • Target version changed from 7.3.10 to 7.3.11
Actions #8

Updated by Vincent MEMBRÉ 3 months ago

  • Target version changed from 7.3.11 to 7.3.12
Actions #9

Updated by Vincent MEMBRÉ 2 months ago

  • Target version changed from 7.3.12 to 7.3.13
Actions #10

Updated by Vincent MEMBRÉ about 2 months ago

  • Target version changed from 7.3.13 to 7.3.14
Actions #11

Updated by Vincent MEMBRÉ 14 days ago

  • Target version changed from 7.3.14 to 7.3.15
Actions

Also available in: Atom PDF