Quantcast

Early Draft of Bugzilla Dev Setup

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Early Draft of Bugzilla Dev Setup

Dylan Hardison
This post has been rattling around in my head for a bit.
Eventually it needs to end up in docs.

http://dylanwh.tumblr.com/post/144277013247/developing-bugzilla-with-plackup-and-cpanminus
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Early Draft of Bugzilla Dev Setup

Jochen Wiedmann
On Fri, May 13, 2016 at 4:28 AM, Dylan Hardison <[hidden email]> wrote:
> This post has been rattling around in my head for a bit.
> Eventually it needs to end up in docs.
>
> http://dylanwh.tumblr.com/post/144277013247/developing-bugzilla-with-plackup-and-cpanminus
> -
> To view or change your list settings, click here:
> <http://bugzilla.org/cgi-bin/mj_wwwusr?user=jochen.wiedmann@...>


I might be able to fill the CentOS section.


--
The next time you hear: "Don't reinvent the wheel!"

http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-of-the-wheel-300x85.jpg
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Early Draft of Bugzilla Dev Setup

Gervase Markham
In reply to this post by Dylan Hardison
On 13/05/16 03:28, Dylan Hardison wrote:
> This post has been rattling around in my head for a bit.
> Eventually it needs to end up in docs.
>
> http://dylanwh.tumblr.com/post/144277013247/developing-bugzilla-with-plackup-and-cpanminus

Awesome! How can we make it even simpler? Ideas:

* Add a "--dev" flag to checksetup.pl which does the following:

** Implies "--cpanm"
** implies SQlite, and so requires checksetup to be run only once
** Defaults login name to unix username
** defaults password to login name
** Gets realname and email from Git identity, if set, otherwise
   realname from /etc/passwd
** Tells you all this

* Add a ./bugzilla script to the root dir which does
  perl -Ilocal/lib/perl5 bin/plackup -R . app.psgi
  and, if not already true, auto-edits the params to have the right
  urlbase. It might even auto-start a browser on the URL.

So then to install and run Bugzilla, you do:

$ sudo apt-get install git perl-modules build-essential cpanminus
$ git clone https://github.com/bugzilla/bugzilla
$ cd bugzilla
$ ./checksetup.pl --dev
$ ./bugzilla

Gerv

_______________________________________________
dev-apps-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-bugzilla
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Early Draft of Bugzilla Dev Setup

David Lawrence
In reply to this post by Dylan Hardison
Using Ubuntu 16.04 LTS (Docker)

> Firstly, we need some system dependencies:
>
>    Ubuntu users: sudo apt-get install git perl-modules
>    build-essential cpanminus

Ubuntu users:
  $ sudo apt-get update
  $ sudo apt-get install git perl-modules build-essential cpanminus \
    libssl-dev libexpat1-dev

>    CentOS/RPM users: TODO
>
> A checkout of bugzilla is required, and everything we do will be from
> that directory.
>
> git clone https://github.com/bugzilla/bugzilla
> cd bugzilla
>
> Next, we can run checksetup.pl with its fancy new –cpanm flag to
> install all our dependencies into local directory. Note that we
> do not need to be root for any of these commands, and nothing
> (from this point on) needs to be installed to the system.
>
> perl checksetup.pl --cpanm

! Installing the dependencies failed: Module 'Net::SMTP::SSL' is not
installed, Module 'SOAP::Lite' is not installed, Module 'XMLRPC::Lite'
is not installed, Module 'XML::Twig' is not installed
! Bailing out the installation for Bugzilla-5.1.

Added libssl-dev above to fix Net::SMTP::SSL build issue.
Added libexpat1-dev above to fix SOAP::Lite, XMLRPC::Lite, and XML::Twig
build issues.

> If all goes well, that should complete with a message saying you
> need to edit localconfig and re-run checksetup. If you’re fine just
> using SQLite, you do not need to edit localconfig. Just re-run
> checksetup.pl, as below:
>
> perl checksetup.pl
>
> The above will prompt you for an email, username, realname and
> password. After you provide those details, it will configure the
> database.
>
> Now we can run a development server, with the following perl command
> below:
>
> perl -Ilocal/lib/perl5 bin/plackup -R . app.psgi

Change to:
perl -Ilocal/lib/perl5 local/bin/plackup -R . app.psgi

> This will start an http on http://localhost:5000.
>
> Navigate to it, and login using the email/password you used above.
>
> Bugzilla will direct you to set the urlbase – which you can set
> to the same “<a href="http://localhost:5000”">http://localhost:5000” above.

The site seems to work fine. But the plack output says it kills the
server and restarts after each page load. Is this normal?

Killing the existing server (pid:688)
Successfully killed! Restarting the new server process.
HTTP::Server::PSGI: Accepting connections at http://0:5000/
10.211.55.2 - - [13/May/2016:13:40:35 +0000] "POST /process_bug.cgi
HTTP/1.1" 200 7688 "http://docker:5000/show_bug.cgi?id=1" "Mozilla/5.0
(Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0"
10.211.55.2 - - [13/May/2016:13:40:35 +0000] "GET
/data/assets/51af664f3910b417cf7544987d29336d.css HTTP/1.1" 200 80589
"http://docker:5000/process_bug.cgi" "Mozilla/5.0 (Macintosh; Intel Mac
OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0"
10.211.55.2 - - [13/May/2016:13:40:35 +0000] "GET
/data/assets/aae018547291cb399f8ae4d70aa29abc.js HTTP/1.1" 200 488706
"http://docker:5000/process_bug.cgi" "Mozilla/5.0 (Macintosh; Intel Mac
OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0"
10.211.55.2 - - [13/May/2016:13:40:35 +0000] "GET
/data/assets/bea14174a90e472c2f5105b100c45963.js HTTP/1.1" 200 48008
"http://docker:5000/process_bug.cgi" "Mozilla/5.0 (Macintosh; Intel Mac
OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0"
-- /bugzilla/data/db/bugs updated.
Killing the existing server (pid:689)
Successfully killed! Restarting the new server process.
HTTP::Server::PSGI: Accepting connections at http://0:5000/

dkl

On 5/12/16 10:28 PM, Dylan Hardison wrote:
> This post has been rattling around in my head for a bit.
> Eventually it needs to end up in docs.
>
> http://dylanwh.tumblr.com/post/144277013247/developing-bugzilla-with-plackup-and-cpanminus
> -
> To view or change your list settings, click here:
> <http://bugzilla.org/cgi-bin/mj_wwwusr?user=dkl@...>
>

--
David Lawrence
[hidden email]
bugzilla.mozilla.org
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Early Draft of Bugzilla Dev Setup

Dylan Hardison
I've included those fixes in the current post. Thanks dkl!

In particular the restarting is because of the -R ., which means it
starts when any files change in the root. Obviously that is wrong, so
I've updated the list.
To work 100% of the time I'd need to make it watch each .cgi.. and
this is turning into magic incantation land, so I've filed
https://bugzilla.mozilla.org/show_bug.cgi?id=1272673 to make this
simple.

On Fri, May 13, 2016 at 9:42 AM, David Lawrence <[hidden email]> wrote:

> Using Ubuntu 16.04 LTS (Docker)
>
>> Firstly, we need some system dependencies:
>>
>>    Ubuntu users: sudo apt-get install git perl-modules
>>    build-essential cpanminus
>
> Ubuntu users:
>   $ sudo apt-get update
>   $ sudo apt-get install git perl-modules build-essential cpanminus \
>     libssl-dev libexpat1-dev
>
>>    CentOS/RPM users: TODO
>>
>> A checkout of bugzilla is required, and everything we do will be from
>> that directory.
>>
>> git clone https://github.com/bugzilla/bugzilla
>> cd bugzilla
>>
>> Next, we can run checksetup.pl with its fancy new –cpanm flag to
>> install all our dependencies into local directory. Note that we
>> do not need to be root for any of these commands, and nothing
>> (from this point on) needs to be installed to the system.
>>
>> perl checksetup.pl --cpanm
>
> ! Installing the dependencies failed: Module 'Net::SMTP::SSL' is not
> installed, Module 'SOAP::Lite' is not installed, Module 'XMLRPC::Lite'
> is not installed, Module 'XML::Twig' is not installed
> ! Bailing out the installation for Bugzilla-5.1.
>
> Added libssl-dev above to fix Net::SMTP::SSL build issue.
> Added libexpat1-dev above to fix SOAP::Lite, XMLRPC::Lite, and XML::Twig
> build issues.
>
>> If all goes well, that should complete with a message saying you
>> need to edit localconfig and re-run checksetup. If you’re fine just
>> using SQLite, you do not need to edit localconfig. Just re-run
>> checksetup.pl, as below:
>>
>> perl checksetup.pl
>>
>> The above will prompt you for an email, username, realname and
>> password. After you provide those details, it will configure the
>> database.
>>
>> Now we can run a development server, with the following perl command
>> below:
>>
>> perl -Ilocal/lib/perl5 bin/plackup -R . app.psgi
>
> Change to:
> perl -Ilocal/lib/perl5 local/bin/plackup -R . app.psgi
>
>> This will start an http on http://localhost:5000.
>>
>> Navigate to it, and login using the email/password you used above.
>>
>> Bugzilla will direct you to set the urlbase – which you can set
>> to the same “<a href="http://localhost:5000”">http://localhost:5000” above.
>
> The site seems to work fine. But the plack output says it kills the
> server and restarts after each page load. Is this normal?
>
> Killing the existing server (pid:688)
> Successfully killed! Restarting the new server process.
> HTTP::Server::PSGI: Accepting connections at http://0:5000/
> 10.211.55.2 - - [13/May/2016:13:40:35 +0000] "POST /process_bug.cgi
> HTTP/1.1" 200 7688 "http://docker:5000/show_bug.cgi?id=1" "Mozilla/5.0
> (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0"
> 10.211.55.2 - - [13/May/2016:13:40:35 +0000] "GET
> /data/assets/51af664f3910b417cf7544987d29336d.css HTTP/1.1" 200 80589
> "http://docker:5000/process_bug.cgi" "Mozilla/5.0 (Macintosh; Intel Mac
> OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0"
> 10.211.55.2 - - [13/May/2016:13:40:35 +0000] "GET
> /data/assets/aae018547291cb399f8ae4d70aa29abc.js HTTP/1.1" 200 488706
> "http://docker:5000/process_bug.cgi" "Mozilla/5.0 (Macintosh; Intel Mac
> OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0"
> 10.211.55.2 - - [13/May/2016:13:40:35 +0000] "GET
> /data/assets/bea14174a90e472c2f5105b100c45963.js HTTP/1.1" 200 48008
> "http://docker:5000/process_bug.cgi" "Mozilla/5.0 (Macintosh; Intel Mac
> OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0"
> -- /bugzilla/data/db/bugs updated.
> Killing the existing server (pid:689)
> Successfully killed! Restarting the new server process.
> HTTP::Server::PSGI: Accepting connections at http://0:5000/
>
> dkl
>
> On 5/12/16 10:28 PM, Dylan Hardison wrote:
>> This post has been rattling around in my head for a bit.
>> Eventually it needs to end up in docs.
>>
>> http://dylanwh.tumblr.com/post/144277013247/developing-bugzilla-with-plackup-and-cpanminus
>> -
>> To view or change your list settings, click here:
>> <http://bugzilla.org/cgi-bin/mj_wwwusr?user=dkl@...>
>>
>
> --
> David Lawrence
> [hidden email]
> bugzilla.mozilla.org
> -
> To view or change your list settings, click here:
> <http://bugzilla.org/cgi-bin/mj_wwwusr?user=dylan@...>
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Early Draft of Bugzilla Dev Setup

Dylan Hardison
In reply to this post by Gervase Markham
On Fri, May 13, 2016 at 9:30 AM, Gervase Markham <[hidden email]> wrote:
> On 13/05/16 03:28, Dylan Hardison wrote:
>> This post has been rattling around in my head for a bit.
>> Eventually it needs to end up in docs.
>>
>> http://dylanwh.tumblr.com/post/144277013247/developing-bugzilla-with-plackup-and-cpanminus
>
> Awesome! How can we make it even simpler? Ideas:

In general I'm about avoiding magic incantations. Adding an
automagical --dev flag might be too much.
What we can definitely do is include a reasonable answers.txt file and
have the instructions for running checksetup include that.

perl checksetup.pl --cpanm contrib/devmode.txt

a command to run the plackup with dev settings is good though, and
I've filed a bug about that. The name will be something that implies
"this is for development, you probably want something else in
production".

Meanwhile, making more defaults work -- when should we have a
discussion about moving the perl modules under 'lib' as is common
practice? :)
If we did that "plackup -r" would find all the module changes for us. :)
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Early Draft of Bugzilla Dev Setup

Gervase Markham
On 13/05/16 15:33, Dylan Hardison wrote:
> In general I'm about avoiding magic incantations. Adding an
> automagical --dev flag might be too much.
> What we can definitely do is include a reasonable answers.txt file and
> have the instructions for running checksetup include that.
>
> perl checksetup.pl --cpanm contrib/devmode.txt

The thing about that is that it can't be dynamic, and generate stuff
from the environment.

If it were less magical, what about the --dev flag causing checksetup.pl
to _default_ the login/email/password etc. to the things I said, but
still require a confirmation (Enter key) or for the value to be edited?

Gerv
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Early Draft of Bugzilla Dev Setup

Jeff Fearn-2
In reply to this post by Dylan Hardison
On 14/05/2016 12:33 AM, Dylan Hardison wrote:

> On Fri, May 13, 2016 at 9:30 AM, Gervase Markham <[hidden email]> wrote:
>> On 13/05/16 03:28, Dylan Hardison wrote:
>>> This post has been rattling around in my head for a bit.
>>> Eventually it needs to end up in docs.
>>>
>>> http://dylanwh.tumblr.com/post/144277013247/developing-bugzilla-with-plackup-and-cpanminus
>>
>> Awesome! How can we make it even simpler? Ideas:
>
> In general I'm about avoiding magic incantations. Adding an
> automagical --dev flag might be too much.
> What we can definitely do is include a reasonable answers.txt file and
> have the instructions for running checksetup include that.
>
> perl checksetup.pl --cpanm contrib/devmode.txt
>
> a command to run the plackup with dev settings is good though, and
> I've filed a bug about that. The name will be something that implies
> "this is for development, you probably want something else in
> production".
>
> Meanwhile, making more defaults work -- when should we have a
> discussion about moving the perl modules under 'lib' as is common
> practice? :)

10 years ago :) Would extensions move to lib/Extension/?

> If we did that "plackup -r" would find all the module changes for us. :)

Cheers, Jeff.
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Early Draft of Bugzilla Dev Setup

Dylan Hardison
On Sat, May 14, 2016 at 11:29 PM, Jeff Fearn <[hidden email]> wrote:

> On 14/05/2016 12:33 AM, Dylan Hardison wrote:
>>
>> On Fri, May 13, 2016 at 9:30 AM, Gervase Markham <[hidden email]> wrote:
>>>
>>> On 13/05/16 03:28, Dylan Hardison wrote:
>>>>
>>>> This post has been rattling around in my head for a bit.
>>>> Eventually it needs to end up in docs.
>>>>
>>>>
>>>> http://dylanwh.tumblr.com/post/144277013247/developing-bugzilla-with-plackup-and-cpanminus
>>>
>>>
>>> Awesome! How can we make it even simpler? Ideas:
>>
>>
>> In general I'm about avoiding magic incantations. Adding an
>> automagical --dev flag might be too much.
>> What we can definitely do is include a reasonable answers.txt file and
>> have the instructions for running checksetup include that.
>>
>> perl checksetup.pl --cpanm contrib/devmode.txt
>>
>> a command to run the plackup with dev settings is good though, and
>> I've filed a bug about that. The name will be something that implies
>> "this is for development, you probably want something else in
>> production".
>>
>> Meanwhile, making more defaults work -- when should we have a
>> discussion about moving the perl modules under 'lib' as is common
>> practice? :)
>
>
> 10 years ago :) Would extensions move to lib/Extension/?
Maybe. If we wanted the namespaces to make sense we'd put them under
Bugzilla/Extension/*...
There are a few problems with extensions (look at Extension.pm)
there are unneeded closures being created. Each extension gets its own
hook in @INC, for instance.
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Loading...