Closed sushain97 closed 6 years ago
Just to clarify:
apertium-apy
) causes sync for level-1 meta-repos (e.g. apertium-tools
) but not for level-0 meta-repo apertium-all
I don't think we should make it particularly intelligent (yet). We should just make it possible for a sync of a particular key in REPOS
to not happen if the event in question's repo matches some criterion.
You do bring up a good related point though. Right now, the git update commands are recursive which could cause severe problems in repos with submodules and apertium-all
.
One idea I have to fix this and other related problems are limiting the frequency of syncs, effectively debouncing them. If someone makes a build config change over 40 submodules and pushes them, we'll get a lot of unnecessary syncing since there will be 40 different events fired. We could avoid this problem by syncing at most one time every 5 seconds. Thoughts?
What if we have two instances of the server started in the script on two different ports? Level-1 events go to port A, level-2 events go to port B; the server on port A updates level-0, the server on port B updates level-1.
What other problems does the frequency limit solve? If it solves more problems than those just related to this, it is probably a better idea.
What if we have two instances of the server started in the script on two different ports? Level-1 events go to port A, level-2 events go to port B; the server on port A updates level-0, the server on port B updates level-1.
I'm already confused... need more time to parse this.
What other problems does the frequency limit solve? If it solves more problems than those just related to this, it is probably a better idea.
I mentioned two problems it solves: 1) the reason this ticket exists, 2) "someone makes a build config change over 40 submodules and pushes them, we'll get a lot of unnecessary syncing since there will be 40 different events fired"
OK, I misunderstood that, we'll go with the frequency limit. My proposal doesn't solve the other problem.
Just to clarify my two-server proposal:
sync.py
instantiates two servers on two different ports: port A and port Bapertium-eng
) are configured to point to port Aapertium-languages
) when it receives an eventapertium-all
) when it receives an eventThis solves the recursion problem but not the 'too many updates' problem.
The solution you describe still seems overly complicated to me. Ignore lists are a pretty common motif in software and I think it would be the simpler solution (in terms of code and understanding). It also doesn't easily scale. What if we have level-3 repos? The configuration and setup will be annoying and there are more points of failure.
If it would seem less like a hack, we can give each repo a function that takes an event and says True
if that event should make us update and False
otherwise?
The latter idea seems reasonable. With #11 maybe it isn't even needed, we can just deal with the extra event.
I agree. I'll test #11 and then merge. We can always take another look at this if necessary.
OK, I just realized something. Consider the following set of events:
apertium-eng
gets updatedapertium-languages
apertium-all
This can be fixed IF we sync the repos in a particular order. If we made REPOS
look like:
REPOS = [
{
'apertium-incubator': {'apertium-incubator'},
'apertium-languages': {'apertium-languages'},
'apertium-nursery': {'apertium-nursery'},
'apertium-staging': {'apertium-staging'},
'apertium-tools': {'apertium-tools'},
'apertium-trunk': {'apertium-trunk'},
},
{
'apertium-all': {'apertium-core', 'apertium-all'},
},
]
then we could sync the groups of repos in order and the sequence would become:
apertium-eng
gets updatedapertium-languages
, push to apertium-all
Thoughts? It would be a ~3 line code change and easily generalizes.
Nice! I think that's a pretty good way to do it. We need to remember to document this (non-trivial) discussion though.
Also, this sort of structure could be used to imply ignores. apertium-incubator
would not sync in response to any changes to repos in its group, i.e. incubator, languages, nursery, etc. Two birds with one stone? This is somewhat like the levels you suggested but without the multiple servers.
This is a bit tricky since
apertium-all
needs to act on metarepo events. Maybe we need aignore
key in theREPOS
config?