Skip to content

Commit

Permalink
Merge branch 'main' into quick-start-ubuntu-lts
Browse files Browse the repository at this point in the history
  • Loading branch information
justdave authored May 14, 2024
2 parents b6727f5 + 9da2acd commit 5595cfa
Show file tree
Hide file tree
Showing 48 changed files with 2,477 additions and 85 deletions.
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
This PR fixes/adds a feature...

#### Additional info
* [bmo#](https://bugzilla.mozilla.org/show_bug.cgi?id=)
* [bug#](https://bugzilla.mozilla.org/show_bug.cgi?id=)

NOTE: Bug number is required. If you haven't filed a bug on https://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla yet, don't submit the Pull Request. Please edit the above link to put the bug number both immediately after the # character and after the = character at the end. You can delete this paragraph once you've added your bug number.

#### Test Plan
<!-- How did you verify the fix/feature in steps -->
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# - name: Build the Docker images
# run: docker compose -f docker-compose.test.yml build
# - name: Run webservice tests
# run: docker-compose -f docker-compose.test.yml run bugzilla6.test test_webservices
# run: docker compose -f docker-compose.test.yml run bugzilla6.test test_webservices

test_bugzilla6_mysql:
runs-on: ubuntu-latest
Expand All @@ -35,7 +35,18 @@ jobs:
- name: Build the Docker images
run: docker compose -f docker-compose.test.yml build
- name: Run bmo specific tests
run: docker-compose -f docker-compose.test.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t
run: docker compose -f docker-compose.test.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t

test_bugzilla6_mariadb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install docker-compose
run: sudo apt update && sudo apt install -y docker-compose
- name: Build the Docker images
run: docker compose -f docker-compose.test-mariadb.yml build
- name: Run bmo specific tests
run: docker compose -f docker-compose.test-mariadb.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t

test_bugzilla6_pg:
runs-on: ubuntu-latest
Expand All @@ -46,5 +57,16 @@ jobs:
- name: Build the Docker images
run: docker compose -f docker-compose.test-pg.yml build
- name: Run bmo specific tests
run: docker-compose -f docker-compose.test-pg.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t
run: docker compose -f docker-compose.test-pg.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t

test_bugzilla6_sqlite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install docker-compose
run: sudo apt update && sudo apt install -y docker-compose
- name: Build the Docker images
run: docker compose -f docker-compose.test-sqlite.yml build
- name: Run bmo specific tests
run: docker compose -f docker-compose.test-sqlite.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
/localconfig.*
/index.html
/error_reports
/.DS_Store
/template_cache
/Makefile
/MYMETA.*
/pm_to_blib
/blib
/Bugzilla-*.*/
/local
.DS_Store
.vscode/perl-lang
version.json
__lbheartbeat__
Expand Down
19 changes: 17 additions & 2 deletions Bugzilla/Constants.pm
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,30 @@ use constant DB_MODULE => {
module => 'DBD::mysql',

# Disallow development versions
blacklist => ['_'],
blocklist => ['_'],

# For UTF-8 support. 4.001 makes sure that blobs aren't
# marked as UTF-8.
version => '4.001',
version => '4.032',
},
name => 'MySQL'
},

# MariaDB used to be a drop-in replacement for MySQL but now it
# isn't so we have a separate driver
'mariadb' => {
db => 'Bugzilla::DB::MariaDB',
db_version => '10.0.5',
dbd => {
package => 'DBD-MariaDB',
module => 'DBD::MariaDB',

# Disallow development versions
blocklist => ['_'],
},
name => 'MariaDB'
},

# Also see Bugzilla::DB::Pg::bz_check_server_version, which has special
# code to require DBD::Pg 2.17.2 for PostgreSQL 9 and above.
'pg' => {
Expand Down
47 changes: 36 additions & 11 deletions Bugzilla/DB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -276,30 +276,55 @@ sub bz_check_server_version {
my ($self, $db, $output) = @_;

my $sql_vers = $self->bz_server_version;

if (((lc($db->{name}) eq 'mysql') || (lc($db->{name}) eq "mariadb"))
&& ($sql_vers =~ s/^5\.5\.5-// || $sql_vers =~ /-MariaDB/)) {
# Version 5.5.5 of MySQL never existed. MariaDB = 10 always puts '5.5.5-'
# at the front of its version string to get around a limitation in the
# replication protocol it shares with MySQL. So if the version starts with
# '5.5.5-' then we can assume this is MariaDB and the real version number
# will immediately follow that. This was removed in MariaDB-11.0. The
# version should always contain "MariaDB" if it is indeed MariaDB.
if (lc($db->{name}) eq 'mysql') {
if ($output) {
Bugzilla::Install::Requirements::_checking_for({
package => $db->{name},
wanted => $db->{version},
ok => 0,
});
}
die install_string('db_maria_on_mysql', {vers => $sql_vers});
}
}
my $sql_dontwant = exists $db->{db_blocklist} ? $db->{db_blocklist} : [];
my $sql_want = $db->{db_version};
my $version_ok = vers_cmp($sql_vers, $sql_want) > -1 ? 1 : 0;

my $blocklisted;
if ($version_ok) {
$blocklisted = grep($sql_vers =~ /$_/, @$sql_dontwant);
$version_ok = 0 if $blocklisted;
}
my $sql_server = $db->{name};
if ($output) {
Bugzilla::Install::Requirements::_checking_for({
package => $sql_server,
wanted => $sql_want,
found => $sql_vers,
ok => $version_ok
ok => $version_ok,
blocklisted => $blocklisted
});
}

# Check what version of the database server is installed and let
# the user know if the version is too old to be used with Bugzilla.
if ($blocklisted) {
die install_string('db_blocklisted', {server=>$sql_server, vers=>$sql_vers});
}
if (!$version_ok) {
die <<EOT;
Your $sql_server v$sql_vers is too old. Bugzilla requires version
$sql_want or later of $sql_server. Please download and install a
newer version.
EOT
die install_string('db_too_old', {
server => $sql_server,
vers => $sql_vers,
want => $sql_want,
});
}

# This is used by subclasses.
Expand All @@ -312,7 +337,7 @@ sub bz_create_database {
my $dbh;

# See if we can connect to the actual Bugzilla database.
my $conn_success = eval { $dbh = connect_main() };
my $conn_success = eval { $dbh = connect_main(); $dbh->ping(); };
my $db_name = Bugzilla->localconfig->db_name;

if (!$conn_success) {
Expand Down
Loading

0 comments on commit 5595cfa

Please sign in to comment.