online icon indicating copy to clipboard operation
online copied to clipboard

Dunging out

Open mmeeks opened this issue 4 years ago • 1 comments

This is an Easy Hack. Potential mentors: @mmeeks

Detailed description and rationale

We have a lot of duplication in Makefile.am around the run: rules to take just two for example:

run: setup-wsd
	./coolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" \
			  --o:security.capabilities="$(CAPABILITIES)" \
			  --o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
			  --o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
			  --o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \
			  --o:ssl.ca_file_path="$(abs_top_srcdir)/etc/ca-chain.cert.pem" \
			  --o:admin_console.username=admin --o:admin_console.password=admin \
			  --o:logging.file[@enable]=${OUTPUT_TO_FILE} --o:logging.level=trace \
			  --o:trace_event[@enable]=true

if ENABLE_DEBUG
run-one: setup-wsd
	./coolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" \
			  --o:security.capabilities="$(CAPABILITIES)" \
			  --o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
			  --o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
			  --o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \
			  --o:ssl.ca_file_path="$(abs_top_srcdir)/etc/ca-chain.cert.pem" \
			  --o:admin_console.username=admin --o:admin_console.password=admin \
			  --o:logging.file[@enable]=true --o:logging.level=trace \
			  --singlekit
endif

All of the common parameters from these coolwsd invocations should be condensed into a single shared variable for all of these parameters to ease maintenance and simplify the script.

Thanks ! =)

mmeeks avatar Sep 11 '21 08:09 mmeeks

WRT https://github.com/CollaboraOnline/online/blob/master/Makefile.am , I have also updated description with coolwsd instead of loolwsd and formatting

pedropintosilva avatar Aug 03 '22 14:08 pedropintosilva

Hi @mmeeks, I'm interested in contributing to this issue, please assign me this. Thank you

h20220025 avatar Nov 11 '22 17:11 h20220025

Hello @h20220025 and sorry for the delayed response. Are you still interested in this?

pedropintosilva avatar Feb 17 '23 09:02 pedropintosilva

Hello @mmeeks @pedropintosilva,

I have drafted PR #6482, which aims to condense the common parameters in the Makefile.am. However, I have some concerns about testing it manually. The code looks good, but I would like to ensure that I test it for edge cases.

In addition to the tests I've already performed by running make run and make run-one, everything seems to be fine. However, I want to make sure that the changes do not cause any unintended issues or break other functionalities. Therefore, Can you suggest me way to test it??

codewithvk avatar May 31 '23 07:05 codewithvk

Hi Vivekkumar ! thanks for the nice patch; I think there is a lot more sharing with run-callgrind, run-valgring, run-gdb etc. that would be good to cleanup too. Also - I think the logging parameter you didn't share in th ecommon variable is a bug ;-) (the kind that comes from copy/paste) - we should use the substituted ${OUTPUT_TO_FILE} in each case I think =) - please do test with some paths with spaces in them to ensure we got escaping right; otherwise - golden !

mmeeks avatar Jun 03 '23 13:06 mmeeks

@mmeeks Will do it. Thanks! :)

codewithvk avatar Jun 03 '23 14:06 codewithvk