[Freeipa-devel] [PATCH] 240-252 AMD modules and Web UI build

Petr Vobornik pvoborni at redhat.com
Fri Jan 18 14:16:04 UTC 2013


On 01/18/2013 03:11 AM, Endi Sukma Dewata wrote:
> On 1/17/2013 8:01 PM, Petr Vobornik wrote:
>> On 01/17/2013 04:24 AM, Endi Sukma Dewata wrote:
>>> Nice work! They seem to be working fine so it's ACKed.
>>
>> I found a little error - there is a jsl problem in dojo.profile:86 -
>> comma at the end of a list. Updated patch 243 attached.
>
> ACK.

Pushed to master.

We can polish the dev tools later.

>
>>> 2. Is there a way to disable uglify in case we need to debug with
>>> Firebug?
>>
>> Currently no. I found myself that I have needed it only when I was
>> trying to figure out what is the output of the builder or some build
>> debugging (what modules are actually used).
>>
>> What's your use case with Firebug? If I want to debug, I would use plain
>> source codes and send it to the test server [1] or I would use the local
>> file modes [2]. The output of the builder is quite ugly to debug.
>>
>> If it's really useful we might add some option to make-ui.sh, should be
>> easy.
>>
>> [1]
>> http://www.freeipa.org/page/V3/WebUI_build#Copy_source_codes_of_FreeIPA_layer_on_test_server
>>
>>
>> [2]
>> http://www.freeipa.org/page/V3/WebUI_build#Set_environment_to_debug_source_codes_of_FreeIPA_layer_using_offline_version
>>
>
> I guess what I'm looking for is a way to troubleshoot using Firebug at a
> customer's environment who's using the compiled code on a live server.

Chrome has a 'pretty print' feature which makes the compiled code 
somehow readable - much better than single line. Example:

    }, r.reset = function() {
       delete r.selected_values, r.external_radio && 
r.external_radio.prop("checked", !1), r.external_text && 
r.external_text.val("")
    }, r.save = function(e) {
    if (r.selected_values && r.selected_values.length) {
       var t = r.selected_values[0];
    r.external_radio && t === r.external_radio.val() ? e[r.name] = 
r.external_text.val() : e[r.name] = t
    }

Using just a built, not compiled version might be even more readable, 
but in that case we can use sources codes as well.


> I suppose we can ask the customer to install the source code, then run
> sync.sh to install the sources. But is there a way to clean up the
> machine and switch back to the compiled code after we're done
> troubleshooting? The sync.sh --compiled or --clean doesn't seem to do it.

You have to build the UI first.

--clean only deletes files in certain directory
--compiled switches from sources to compiled versions, can be also used 
with --dojo

So the correct command to replace sources with just app.js is:

$ util/make-ui.sh && util/sync.sh --host root at test.example.com --freeipa 
--compiled --clean

or shorter: $ util/make-ui.sh && util/sync.sh -fcC -h root at test.example.com

We might polish the arguments if you think they are not easy to 
understand. I assumed that it's better to create more general synch util 
and then let developers make their own aliases for most often used 
commands+args - mostly to avoid writing hostname. I'm not against 
exending the synch util though.


>
>>> 3. Is it possible to set breakpoints in AMD modules in Firebug, for
>>> example line 44 in widget.js?
>>
>> Yes.
>
> OK, after doing sync.sh --freeipa I was able to see the sources in
> Firebug and set breakpoints. We might want to include this in a
> troubleshooting guide (if it's not already there).

This guide: http://www.freeipa.org/page/TroubleshootingGuide ? We might 
polish #2 and then I can write something down.

>
>>> 4. Calling change-profile.sh allsource modifies the install/ui/js/dojo.
>>> Should they be included in .gitignore? Or is there a way to select the
>>> profile without modifying any files included in git (e.g. using
>>> parameter)? The concern is that the changes could accidentally get
>>> checked in and affect the official build.
>>
>> change-profile.sh has option --git-ignore which marks those symbolic
>> links with  'git update-index --assume-unchanged ' which should prevent
>> this issue. Option --git-undo removes this mark.
>>
>> It might be little uncomfortable, but I didn't find better method.
>> Possible option is to remove those links from git repository and add
>> them to .gitignore, but by using it the 'offline version' wouldn't be
>> functional out of the box (checkout).
>
> Are the links used by the offline version only, or would it also affect
> live server deployed from the RPM that includes modified links?
>

Symbolic links are just for offline version. Deployed RPM has all code 
directly in subdirs of js directory. Basically the sym links are there 
just to solve the switching problem - we don't want to copy files around 
in dev tree. For testing on a machine, mapping from 'build' or 'src' 
directory solves the sync util. For deployment it's done by makefiles.
-- 
Petr Vobornik




More information about the Freeipa-devel mailing list