*** caphrim007 has quit IRC | 04:19 | |
*** caphrim007 has joined #openstack-jjb | 04:20 | |
*** caphrim007 has quit IRC | 04:24 | |
openstackgerrit | Anil Belur proposed openstack-infra/jenkins-job-builder master: Fix view parameters indent for sphinx https://review.openstack.org/561514 | 06:08 |
---|---|---|
*** hashar has joined #openstack-jjb | 06:50 | |
*** electrofelix has joined #openstack-jjb | 08:40 | |
ssbarnea | zaro__: zxiiro : it seems that only you two can push tags for python-jenkins based on https://review.openstack.org/#/admin/groups/323,members -- can you please add 0.5.0b1 to current tip so we have a prerelease? | 08:41 |
*** larainema has joined #openstack-jjb | 09:02 | |
openstackgerrit | Anil Belur proposed openstack-infra/jenkins-job-builder master: Add support for fallback Job Filters https://review.openstack.org/549091 | 09:55 |
*** caphrim007 has joined #openstack-jjb | 10:10 | |
*** caphrim007 has quit IRC | 10:16 | |
*** caphrim007 has joined #openstack-jjb | 11:07 | |
*** caphrim007 has quit IRC | 11:11 | |
*** caphrim007 has joined #openstack-jjb | 11:50 | |
*** caphrim007 has quit IRC | 11:54 | |
*** caphrim007 has joined #openstack-jjb | 13:04 | |
*** caphrim007 has quit IRC | 13:09 | |
*** mnencia_ has joined #openstack-jjb | 13:27 | |
*** mnencia has quit IRC | 13:27 | |
*** mnencia_ is now known as mnencia | 13:27 | |
ssbarnea | is anyone here that already used jinja2 in jjb? | 13:43 |
zxiiro | ssbarnea: I think Odd_Bloke was the one who submitted that feature. | 13:47 |
ssbarnea | i am trying to build a POC but it seems not to be as easy as using jinja2 in ansible. | 13:48 |
Odd_Bloke | We're using it extensively, yeah. | 13:57 |
openstackgerrit | Merged openstack-infra/jenkins-job-builder master: Fix view parameters indent for sphinx https://review.openstack.org/561514 | 14:00 |
openstackgerrit | Merged openstack/python-jenkins master: Adds support for wiping out a job's workspace https://review.openstack.org/289258 | 14:11 |
ssbarnea | Odd_Bloke: is there a public repo that I can see with them? I am interested about the reusability of the code (jinja include/import) | 14:29 |
ssbarnea | one thing that i am always facing is that jjb paths are relative to current folder, which is a PITA if you have lots of definitions in multiple folders at multiple depths | 14:30 |
ssbarnea | i would prefer to be relative to the repository root | 14:30 |
Odd_Bloke | ssbarnea: There isn't a public repo, I'm afraid. | 14:34 |
Odd_Bloke | The Jinja stuff _should_ be using the same import path rules as regular JJB stuff, IIRC. | 14:34 |
*** ssbarnea_ has joined #openstack-jjb | 14:59 | |
electrofelix | ssbarnea: jjb paths should be able to be relative to the current or the top level folder | 15:02 |
electrofelix | for includes | 15:03 |
electrofelix | but maybe it's the search order that is the problem? | 15:03 |
ssbarnea | electrofelix: not really, how do you define the top-level-folder? | 15:08 |
ssbarnea | i think this is the issue i have | 15:08 |
ssbarnea | because I keep my jenkins_jobs.ini file inside ~/.config/... | 15:08 |
ssbarnea | i guess that the trick would to create a symlink inside the repo in order to trick jjb to guess the top-level path. | 15:09 |
zxiiro | ssbarnea: you could also use the include_path parameter too https://docs.openstack.org/infra/jenkins-job-builder/execution.html#job-builder-section | 15:12 |
zxiiro | I've found though that include_path is also recursive in recursive mode. | 15:12 |
ssbarnea | zxiiro: already using this. | 15:13 |
zxiiro | ah ok | 15:13 |
ssbarnea | zxiiro: but my include path is also relative :D | 15:13 |
ssbarnea | mainly I would like to find a way to configure jjb so I can easily rebuild only specific files just by executing them (shebang trick) | 15:14 |
ssbarnea | when you have templates and jobs in various paths it seems harder to do this, i always find that in some cases it fails to find the templates. | 15:15 |
ssbarnea | i am not saying is jjb fail, maybe is me | 15:15 |
*** hashar is now known as hasharAway | 15:16 | |
zxiiro | sounds pretty complicated if you're pulling from lots of places. | 15:19 |
zxiiro | We just keep all of our jobs in a single "jjb" directory and allow recursion to pick up anything under it. | 15:20 |
zxiiro | it's also a way to ensure JJB experts to review jjb related patches that come in. | 15:20 |
zxiiro | It's one thing I don't like about the "Jenkinsfile" method that some of our projects want to use. It gives them more control but harder for our ci team to review if things going in that file makes any sense. | 15:21 |
ssbarnea | zxiiro: this was my intent. still it seems that the concept of top-level folder does not work as expected. Just printed the list of paths and it seems that top-level folder = CWD instead of being config colder. | 15:22 |
ssbarnea | so it does not matter where you put the config file. | 15:22 |
zxiiro | ssbarnea: my config goes into ~/.config/jenkins_jobs/jenkins_jobs.ini the jjb repo does not care where that file comes from so no relative paths for it. | 15:23 |
ssbarnea | i remember having a similar problem with ansible in the past, where ansible was using CWD instead of CFG folder to look for files. | 15:23 |
zxiiro | ssbarnea: and my include path is "include_path=." | 15:23 |
zxiiro | ssbarnea: that makes JJB pick up everything under the jjb directory. | 15:23 |
ssbarnea | zxiiro: yep, but "." in config files usually have different meaning (it means relative to *myself* not to user current directory). | 15:24 |
ssbarnea | and this is not what jjb thinks | 15:24 |
zxiiro | ssbarnea: in jjb "include_path=." means recursively the path under `jenkins-jobs update /path/to/jjb` | 15:26 |
zxiiro | ssbarnea: ah maybe that's why. You don't pass the path explicitly on the CLI? | 15:26 |
ssbarnea | zxiiro: in fact I think I am wrong here, "." dot is CWD. but if you would put "xxx" it should be expanded to "config_path/xxx" instead of "cwd/path", agree? | 15:26 |
zxiiro | ssbarnea: well in JJB "include_path" is processed at runtime. when it's evaluating the file or directory you passed it, and it's relative to the path from the CLI. not the config. | 15:27 |
*** caphrim007 has joined #openstack-jjb | 15:27 | |
*** caphrim007 has joined #openstack-jjb | 15:27 | |
zxiiro | and "include_path=." is recursively evaluated for every directory under that path. | 15:27 |
zxiiro | I don't have an opinion on how it should work, but that's how it does work right now. | 15:28 |
ssbarnea | zxiiro: but what if I put: include_path=xxx --- how would you expect to be converted to an abs path? | 15:28 |
zxiiro | ssbarnea: I would expect it to be relative to that file, or the literal path I put in | 15:29 |
zxiiro | ssbarnea: but in reality today it is not as far as I can tell. | 15:29 |
ssbarnea | zxiiro: glad we agree, let me double check if this is happenning or not, even if it doesn't it should be easy to fix. | 15:29 |
zxiiro | ssbarnea: yep. I think if you change the code it would be a behaviour change (for better or worse I don't know). but I know today JJB expects when you say "include_path=." it recursively adds "." as it searches down the tree to add every directory under that path. | 15:33 |
zxiiro | I thought it was odd when I first realized it myself | 15:33 |
zxiiro | I tried to add a ".jjb-test" directory to one of my projects and was surprised to see .jjb-test appear N times for every directory that existed in the path. | 15:34 |
ssbarnea | zxiiro: i have no plans to touch behaviour for dot, just the one where user does not mention the dot and where the path is not starting with slash. | 15:34 |
ssbarnea | i would only want to translate include_paths = xxx into include_path={cfgdir}/xxx | 15:35 |
ssbarnea | in fact if people want, we can even do it like tox does with {toxini} --- we can have {jjbini}. | 15:36 |
zxiiro | hmm that might be a good idea | 15:37 |
ssbarnea | electrofelix: zxiiro : my impression is that variable expansion does not work with jinja2 with import/include statements | 16:40 |
ssbarnea | jinja2.exceptions.UndefinedError: 'xxx' is undefined | 16:41 |
ssbarnea | i get this on both import and include, while it works well in the inline script. | 16:41 |
ssbarnea | in fact I found a workaround: adding "with context" after import. | 16:45 |
electrofelix | ssbarnea: at a guess that means the lazy include expansion doesn't work for the j2 tag? | 16:53 |
electrofelix | or isn't even tried? | 16:53 |
ssbarnea | electrofelix: with manual "with context" worked, so is good enough for me. | 16:54 |
ssbarnea | electrofelix: but I realised something new: i will never be able to migrate to j2 because I have >100 .inc files used by jjb and people are editing them all the time. | 16:55 |
ssbarnea | the only chance would be if I could find an intermediary way to migrate them gradually. | 16:56 |
electrofelix | ? is this a case that you have templates that are resolving which inc file to load? | 17:00 |
*** electrofelix has quit IRC | 17:18 | |
*** openstackgerrit has quit IRC | 19:05 | |
*** hasharAway has quit IRC | 20:01 | |
*** ssbarnea_ has quit IRC | 20:44 | |
*** openstackgerrit has joined #openstack-jjb | 21:43 | |
openstackgerrit | Luca Pierri proposed openstack-infra/jenkins-job-builder master: fix spelling errors https://review.openstack.org/561735 | 21:43 |
openstackgerrit | Luca Pierri proposed openstack-infra/jenkins-job-builder master: fix spelling errors https://review.openstack.org/561735 | 22:00 |
*** smyers has quit IRC | 22:26 | |
*** smyers has joined #openstack-jjb | 22:27 |
Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!