Closed Bug 1318502 Opened 8 years ago Closed 8 years ago

Add help utilities to scripts/ dir to aid in setting localconfig and data/params to custom values.

Categories

(bugzilla.mozilla.org :: Continous Integration, defect)

Production
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dkl, Assigned: dkl)

Details

Attachments

(1 file, 1 obsolete file)

Having small helper scripts can help with CI testing where values in localconfig and data/params can be updated even after checksetup.pl has been ran for the first time. Also this can help once we shrink down the images and want to go to a multi container configuration. When running MySQL as a separate container and linking the web server and database server using docker-compose, the web server will have a variable set that can be used to plug the IP of the MySQL container into the localconfig file. The help script will be able to do this.

dkl
Attached patch 1318502_1.patch (obsolete) — Splinter Review
* scripts/update_params.pl
- Borrowed from:
https://github.com/globau/mozreview-devenv/blob/master/ansible/roles/bmo/files/set-param.pl

* scripts/update_localconfig.pl
- Borrowed from:
https://github.com/dklawren/bugzilla-dev-manager/blob/app/Bz/Workdir.pm#L210
Attachment #8811982 - Flags: review?(dylan)
Comment on attachment 8811982 [details] [diff] [review]
1318502_1.patch

Review of attachment 8811982 [details] [diff] [review]:
-----------------------------------------------------------------

r-

some issues with the the lib paths, also update_params.pl didn't work (missing the local/lib/perl path)

::: scripts/update_localconfig.pl
@@ +10,5 @@
> +use strict;
> +use warnings;
> +
> +use FindBin qw( $RealBin );
> +use lib ("$RealBin/..", "$RealBin/../local/lib/perl5");

After bug 1321662 lands, this should not use FindBin and should assume its CWD is the bugzilla dir,
thus use lib should be "use lib qw(. lib local/lib/perl5)"

::: scripts/update_params.pl
@@ +11,5 @@
> +use warnings;
> +
> +use FindBin qw( $RealBin );
> +use lib "$RealBin/..";
> +

This won't work already in some configurations as local/lib/perl5 isn't listed.

After bug 1321662 lands, this should not use FindBin and should assume its CWD is the bugzilla dir,
thus use lib should be "use lib qw(. lib local/lib/perl5)"

@@ +27,5 @@
> +
> +if ($params->{$param_name} ne $param_value) {
> +    SetParam($param_name, $param_value);
> +    write_params();
> +    print "'$param_name' set to '$param_value'\n";

if you like, you can use 'say' here because of the 'use 5.10.1' at the top.
Attachment #8811982 - Flags: review?(dylan) → review-
Attached patch 1318502_2.patchSplinter Review
Attachment #8811982 - Attachment is obsolete: true
Attachment #8817080 - Flags: review?(dylan)
Comment on attachment 8817080 [details] [diff] [review]
1318502_2.patch

r=dylan
Attachment #8817080 - Flags: review?(dylan) → review+
To https://github.com/mozilla-bteam/bmo.git
   d68cd60..4cd1371  master -> master
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: