grimoirelab-sirmordred
grimoirelab-sirmordred copied to clipboard
Default file for aliases
Recently, SirMordred needs a new configuration file, the alias file. Since in most deployments it would be always the same, would it be possible to have it as a default file, so that if none is specified in the .cfg file, it is used? If you want, I can produce a pull request with this...
@jgbarah thank you for opening the issue.
Mordred has already something similar. As you can see at: https://github.com/chaoss/grimoirelab-sirmordred/blob/master/sirmordred/config.py#L157, the aliases_file param is optional and by default is set to aliases.json which is included in the Sirmordred repo
Does it answer your issue?
Ohh. Yes, I think so, if that means that if set no parameter, that would be applied. But I'm afraid that's not the case... Yesterday I saw it failed if aliases_file is not in the config file. If you have reasons to believe it should work that way, I will check again, just in case I'm wrong.
The behaviour is as Valerio says. By default, Mordred will fail if the aliases file is not found in the same place where Mordred is running.
OK, let me reframe what I intended, because maybe it was not understood. What I was commenting is that if the SirMordred package is shipped with a default aliases.json file, and by default, if no aliases_file option is found in the configuration file, that default file is used.
That way, the naive user can have the default aliases built without needing to specify anything at all.
Currently, if there is aliases_file option, SirMorded fails except if the user provides an aliases.json file in the same directory. But if the user knows about that file, likely knows about the option too. So, it doesn't help a lot to have a simpler config file.
What do you think about this approach? (I could write a pull request to implement it, if you find it reasonable in principle).
Sorry for my late reply.
Yes, let's do that. Include both files in the package. Can you provide a PR, @jgbarah ?
I'll do asap. Thanks!
can we close this issue @jgbarah @sduenas ?
I'd like to keep this here so I don't forget to write the pull request ,-)
Is this done @jgbarah , do u need help with this?