make app.psgi runnable, fix static path regex to efficient, and make @INC contain absolute paths.

RESOLVED FIXED in Bugzilla 6.0

Status

()

enhancement
RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: dylan, Assigned: dylanAtHome)

Tracking

Bugzilla 6.0
Dependency tree / graph

Details

Attachments

(1 attachment, 5 obsolete attachments)

To use plackup for development, it is required to pass several paths using -R so that when files change, the service is restarted. Rather than burden the documentation with this, we should have a wrapper that runs it with the correct parameters for development.
Target Milestone: --- → Bugzilla 6.0
Version: 4.4 → 5.1
Severity: normal → enhancement
Component: Bugzilla-General → Installation & Upgrading
Flags: needinfo?(olga-github)
Attachment #8800489 - Attachment mime type: application/x-perl → text/plain
Summary: Add wrapper for plackup optimized for development → make app.psgi runnable
Attachment #8800489 - Attachment is obsolete: true
Assignee: dylan → dylan
Attachment #8841247 - Attachment is obsolete: true
Summary: make app.psgi runnable → make app.psgi runnable, fix static path regex to efficient, and make @INC contain absolute paths.
Comment on attachment 8841282 [details] [review]
[bugzilla] dylanwh:bug-1272673 > bugzilla:master

The pull request does three things that are pretty non-controversial:

1) it makes it so @INC contains only absolute paths, and also disables 'use lib' (copying the behavior from mod_perl.pl)
2) For the static file handling, it sorts the regex by length, which gurantees that the regex match more efficiently. This was inspired by what the wonderful list2re() function of Data::Munge does. https://metacpan.org/pod/Data::Munge#list2re-LIST
3) Finally, it users caller() to detect if it is being run on the command line, and if so it runs itself. So we don't need the user to type a weird complicated command, they just run "perl app.psgi".

This is the recommended way of making a self-runnable psgi, per the documentation:
https://metacpan.org/pod/Plack::Runner#NOTES
Attachment #8841282 - Flags: review?(jfearn)
Blocks: 1291006
Attachment #8841282 - Flags: review?(jfearn) → review+
To git@github.com:bugzilla/bugzilla.git
   dfb688869..c6363140a  master -> master
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.