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

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
Testing Scripts and Infrastructure
RESOLVED FIXED
11 months ago
11 months ago

People

(Reporter: dkl, Assigned: dkl)

Tracking

Production

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

11 months ago
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
(Assignee)

Comment 1

11 months ago
Created attachment 8811982 [details] [diff] [review]
1318502_1.patch

* 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-
(Assignee)

Comment 3

11 months ago
Created attachment 8817080 [details] [diff] [review]
1318502_2.patch
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+
(Assignee)

Comment 5

11 months ago
To https://github.com/mozilla-bteam/bmo.git
   d68cd60..4cd1371  master -> master
Status: ASSIGNED → RESOLVED
Last Resolved: 11 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.