mantisbt icon indicating copy to clipboard operation
mantisbt copied to clipboard

Gitpod Integration

Open vboctor opened this issue 5 years ago • 5 comments

This PR implements integration with Gitpod which provides development environments in the cloud.

Fixes #27988

  1. Will cleanup commit history or squash before merge
  2. May revise change to upgrade_unattended.php to skip this check via an override

Please check if getting a gitpod workspace based on this PR works for you and play with it.

You can install Gitpod Chrome Plugin to have easy access for opening gitpod workspaces.

vboctor avatar Feb 21 '21 00:02 vboctor

It looks like the Gitpod integration in this PR broke after I rebased on top of master.

vboctor avatar Feb 22 '21 03:02 vboctor

Please check if getting a gitpod workspace based on this PR works for you and play with it.

@vboctor workspace starts up, IDE is running in general, no problems during MantisBT installation, MantisBT is running. Tried using latest Firefeox. No time to play more.

atrol avatar Feb 22 '21 07:02 atrol

I don't have a lot of time to test right now, but here's a few preliminary remarks

  • Mantis DB is not present when the workspace starts up - it should be setup automatically. Looks like you're trying to do so but it's not working, see /workspace/.gitpod/prebuild-log-0
Creating database...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
exit
  • Defaulting to PHP 8 causes errors trying to run
    • composer (the same errors can also be found in /workspace/.gitpod/prebuild-log-0) - install it via PHAR instead of using the distro version from apt, or default to PHP 7.4
gitpod /workspace/mantisbt $ composer
Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:62
Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:108
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:130
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:130
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:130
  • phpunit (this will probably go away when #1742 is merged - until then maybe default to PHP 7.4 instead)
gitpod /workspace/mantisbt $ vendor/bin/phpunit 
PHP Fatal error:  Uncaught Error: Call to undefined function each() in /workspace/mantisbt/vendor/phpunit/phpunit/src/Util/Getopt.php:38
Stack trace:
#0 /workspace/mantisbt/vendor/phpunit/phpunit/src/TextUI/Command.php(240): PHPUnit_Util_Getopt::getopt()
#1 /workspace/mantisbt/vendor/phpunit/phpunit/src/TextUI/Command.php(111): PHPUnit_TextUI_Command->handleArguments()
#2 /workspace/mantisbt/vendor/phpunit/phpunit/src/TextUI/Command.php(100): PHPUnit_TextUI_Command->run()
#3 /workspace/mantisbt/vendor/phpunit/phpunit/phpunit(52): PHPUnit_TextUI_Command::main()
#4 {main}
  thrown in /workspace/mantisbt/vendor/phpunit/phpunit/src/Util/Getopt.php on line 38
  • Wondering what is port 33060 used for ? I'm getting Port 33060 didn't respond if I try to access it
  • Mantis won't display in Preview (this could be caused by CSP) - not a big deal, but maybe we can enable it ? I'm getting To protect your security, 8000-xxxxx.ws-eu03.gitpod.io will not allow Firefox to display the page if another site has embedded it. To see this page, you need to open it in a new window.
  • The initial terminal output is displaying internal commands, which is unnecessary somewhat confusing. Can this be avoided ? Considering this is just to show a welcome message, maybe get rid of the init command ?
 HISTFILE=/workspace/.gitpod/cmd-1 history -r; {
[ -r /workspace/.prebuild-log-1 ] && cat /workspace/.prebuild-log-1; [ -r /workspace/.gitpod/prebuild-log-1 ] && cat /workspace/.gitpod/prebuild-log-1; true
}
gitpod /workspace/mantisbt $  HISTFILE=/workspace/.gitpod/cmd-1 history -r; {
> [ -r /workspace/.prebuild-log-1 ] && cat /workspace/.prebuild-log-1; [ -r /workspace/.gitpod/prebuild-log-1 ] && cat /workspace/.gitpod/prebuild-log-1; true
> }
{
echo "Welcome to MantisBT development"
}; exit
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 882
gitpod /workspace/mantisbt $ {
> echo "Welcome to MantisBT development"
> }; exit
Welcome to MantisBT development
exit

dregad avatar Feb 22 '21 11:02 dregad

@dregad

Mantis DB is not present when the workspace starts up - it should be setup automatically. Looks like you're trying to do so but it's not working, see /workspace/.gitpod/prebuild-log-0

This was a race condition. I now run a command to wait until mysql is ready before sending commands to MySQL.

Defaulting to PHP 8 causes errors trying to run

Now using PHP 7.4

phpunit

Now it is working and the tests can be run via .gitpod/test.sh command. It seems we have few REST API failures that maybe unrelated to this PR.

Wondering what is port 33060 used for ? I'm getting Port 33060 didn't respond if I try to access it

Not sure, will look into it. I may have added because the IDE gave a notice when port was available.

Mantis won't display in Preview

For some reason, preview no longer displays and I'll remove it. But it is easy to click on the icon on the left bar that shows the ports, then open browser from there.

The initial terminal output is displaying internal commands,

I removed the Welcome message and don't think I have much control over it.

I will probably do a couple more tweaks, but worth playing around with it after the updates I pushed.

vboctor avatar Feb 24 '21 05:02 vboctor

Thanks @atrol for checking it out.

vboctor avatar Feb 24 '21 05:02 vboctor