Skip to content

Bug 1455495 - Replace apache with Mojolicious#517

Merged
dylanwh merged 31 commits intomozilla-bteam:masterfrom
dylanwh:mojo-poc
Sep 18, 2018
Merged

Bug 1455495 - Replace apache with Mojolicious#517
dylanwh merged 31 commits intomozilla-bteam:masterfrom
dylanwh:mojo-poc

Conversation

@dylanwh
Copy link
Copy Markdown
Contributor

@dylanwh dylanwh commented Apr 4, 2018

@dylanwh dylanwh added the WIP label Apr 4, 2018
@mohawk2
Copy link
Copy Markdown

mohawk2 commented Apr 4, 2018

This looks great to me. How about some fingers-and-toes tests too?

@dylanwh
Copy link
Copy Markdown
Contributor Author

dylanwh commented Apr 5, 2018

@mohawk2 not sure I understand fingers and toes tests?

@mohawk2
Copy link
Copy Markdown

mohawk2 commented Apr 5, 2018

@dylanwh Sorry to be unclear. The analogy is the most basic of testing, to "count the fingers and toes" are the correct number. If you tell me the /new/ already has tests that ensure correct behaviour, that's good enough for me :-)

I see the CI test_sanity is currently failing? t/002goodperl.t fails test 66.

@dylanwh dylanwh changed the title initial proof of concept of mojolicious inside bmo Embed Mojolicious inside BMO Apr 20, 2018
@mohawk2
Copy link
Copy Markdown

mohawk2 commented May 19, 2018

Uh oh, still failing CI :-(

@dylanwh dylanwh changed the title Embed Mojolicious inside BMO Replace Apache with Mojolicious May 21, 2018
@dylanwh dylanwh changed the title Replace Apache with Mojolicious Bug 1455495 - Replace apache with Mojolicious Jun 29, 2018
@dylanwh dylanwh changed the base branch from master to pre-mojo July 18, 2018 20:33
@dylanwh dylanwh removed the WIP label Jul 19, 2018
@dylanwh dylanwh requested review from globau, purelogiq and smacleod July 19, 2018 16:20
@dylanwh
Copy link
Copy Markdown
Contributor Author

dylanwh commented Jul 19, 2018

Paging @mohawk2, your review of Bugzilla/Quantum/CGI.pm's _STDIN() method and related code would be valuable. :-)

Comment thread Bugzilla/Quantum.pm Outdated
);
$ses_auth->any('/index.cgi')->to('SES#main');

$r->any('/:REWRITE_itrequest' => [REWRITE_itrequest => qr{form[\.:]itrequest}])->to(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I should add a hook and move these to the BMO extension?
@globau ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree; these belong in the bmo ext. this needn't block the initial release however.

globau
globau previously requested changes Jul 25, 2018
Comment thread Bugzilla/Quantum.pm Outdated
);
$ses_auth->any('/index.cgi')->to('SES#main');

$r->any('/:REWRITE_itrequest' => [REWRITE_itrequest => qr{form[\.:]itrequest}])->to(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree; these belong in the bmo ext. this needn't block the initial release however.

Comment thread Bugzilla/Quantum/CGI.pm Outdated
SCRIPT_NAME => "$prefix$script_name",
SERVER_NAME => hostname,
SERVER_PORT => $tx->local_port,
SERVER_PROTOCOL => $req->is_secure ? 'HTTPS' : 'HTTP', # TODO: Version is missing
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO item

Comment thread Bugzilla/Quantum/CGI.pm
sub _file_to_method {
my ($name) = @_;
$name =~ s/\./_/s;
$name =~ s/\W+/_/gs;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to replace periods separately, \W will match

Comment thread Bugzilla/Quantum/Template.pm Outdated
return $self->template->process($file, $vars, $output);
}
else {
die __PACKAGE__ . '->process() called with too many arguments';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a bit odd to see the length of @_ being used to see if vars are set.

i suspect this check is useful only during the development of the mojo transition; it would be much clearer if you just did if (!defined $output) { ... } else { ... }

Comment thread Bugzilla/CGI.pm
return $self->SUPER::redirect(@_);
}

use Bugzilla::Logging;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be at the top of the file

Comment thread buglist.cgi Outdated
# && $ENV{'HTTP_USER_AGENT'} !~ /(?:WebKit|Trident|KHTML)/
# && !$agent
# && !defined($cgi->param('serverpush'))
# || $cgi->param('serverpush');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is serverpush a TODO item, or is it being dropped by this change?
if it's being dropped you should remove all related code.

->to( 'CGI#enter_bug_cgi' => { 'product' => 'Shield', 'format' => 'shield-studies' } );
$r->any( '/:REWRITE_client_bounty' => [ REWRITE_client_bounty => qr{form[\.:]client[\.:]bounty} ] )
->to( 'CGI#enter_bug_cgi' => { 'product' => 'Firefox', 'format' => 'client-bounty' } );
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is very hard to read, and repetitive.

how about defining these aliases in a hash, and building the routes dynamically from that?

Comment thread qa/t/test_shutdown.t
@@ -1,72 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's happing here?

if the shutdownhtml is no longer supported then all the related code should be removed.
if it is still supported then this test should remain.

Comment thread scripts/entrypoint.pl

sub cmd_test_selenium {
my $conf = require $ENV{BZ_QA_CONF_FILE};
$ENV{HTTP_BACKEND} = 'simple';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps it would be better to run tests under the same backend as prod?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selenium tests don't run with any level of concurrency and haven't for a long time.
For apache the number of workers as also limited. I'm confident hypnotoad and the simple httpd are close enough for this.

Comment thread vagrant_support/hypnotoad
#
#
#
### END INIT INFO
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've been using systemd for so long i forgot how horrible init.d scripts are

@dylanwh dylanwh changed the base branch from pre-mojo to master July 31, 2018 17:06
@dylanwh dylanwh dismissed globau’s stale review July 31, 2018 17:42

I believe changes have been addressed.

@edmorley
Copy link
Copy Markdown
Contributor

Hi! Bug 1355476 was duped to bug 1455495, however I don't see any reference to immutable in this PR? Is that going to be added later? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants