Skip to content

Commit

Permalink
Merge pull request #193 from bugsnag/release/v3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yousif-bugsnag authored Jun 7, 2023
2 parents 885bcaa + 10e2e17 commit 35eb2a6
Show file tree
Hide file tree
Showing 108 changed files with 2,786 additions and 246 deletions.
29 changes: 23 additions & 6 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ steps:
plugins:
- docker-compose#v3.7.0:
run: java-common
command: './gradlew :bugsnag:assemble :bugsnag-spring:assemble'
command: './gradlew :bugsnag:assemble :bugsnag-spring:javax:assemble :bugsnag-spring:assemble'

- label: ':docker: Run JVM tests'
key: 'java-jvm-tests'
Expand All @@ -21,19 +21,36 @@ steps:
run: java-common
command: './gradlew check test'

- label: ':docker: Mazerunner tests batch 1'
- label: ':docker: Mazerunner java8 tests batch 1'
key: 'java-mazerunner-tests-1'
timeout_in_minutes: 30
plugins:
- docker-compose#v3.7.0:
run: java-mazerunner
run: java8-mazerunner
command: 'bundle exec maze-runner --exclude=features/[^a-m].*.feature'

- label: ':docker: Mazerunner tests batch 2'
- label: ':docker: Mazerunner java8 tests batch 2'
key: 'java-mazerunner-tests-2'
timeout_in_minutes: 30
plugins:
- docker-compose#v3.7.0:
pull: java-mazerunner
run: java-mazerunner
pull: java8-mazerunner
run: java8-mazerunner
command: 'bundle exec maze-runner --exclude=features/[^n-z].*.feature'

- label: ':docker: Mazerunner java17 tests batch 1'
key: 'java-mazerunner-tests-3'
timeout_in_minutes: 30
plugins:
- docker-compose#v3.7.0:
run: java17-mazerunner
command: 'bundle exec maze-runner --exclude=features/[^a-m].*.feature'

- label: ':docker: Mazerunner java17 tests batch 2'
key: 'java-mazerunner-tests-4'
timeout_in_minutes: 30
plugins:
- docker-compose#v3.7.0:
pull: java17-mazerunner
run: java17-mazerunner
command: 'bundle exec maze-runner --exclude=features/[^n-z].*.feature'
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.1
2.7.5
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.7.0 (2023-06-07)

* Support Spring 6 / Spring Boot 3
[#191](https://github.com/bugsnag/bugsnag-java/pull/191)

* Bump Jackson from 2.13.3 for critical vulnerability fixes
[#184](https://github.com/bugsnag/bugsnag-java/pull/184)

## 3.6.4 (2022-07-12)

* Support log messages that use `{}` formatting
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'

gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v6.8.0'
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.24.0'
gem 'os'
77 changes: 46 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
GIT
remote: https://github.com/bugsnag/maze-runner
revision: fe12189f83aad154f54221ee0fcd41b483d3c0d1
tag: v6.8.0
revision: 734405a801012be706f5e190e472fb02dd83b264
tag: v7.10.2
specs:
bugsnag-maze-runner (6.8.0)
appium_lib (~> 11.2.0)
bugsnag-maze-runner (7.10.2)
appium_lib (~> 12.0.0)
appium_lib_core (~> 5.4.0)
bugsnag (~> 6.24)
cucumber (~> 7.1)
cucumber-expressions (~> 6.0.0)
curb (~> 0.9.6)
json_schemer (~> 0.2.24)
optimist (~> 3.0.1)
os (~> 1.0.0)
rake (~> 12.3.3)
rubyzip (~> 2.3.2)
selenium-webdriver (~> 3.11)
selenium-webdriver (~> 4.0)
test-unit (~> 3.5.2)
webrick (~> 1.7.0)

GEM
remote: https://rubygems.org/
specs:
appium_lib (11.2.0)
appium_lib_core (~> 4.1)
appium_lib (12.0.1)
appium_lib_core (~> 5.0)
nokogiri (~> 1.8, >= 1.8.1)
tomlrb (~> 1.1)
appium_lib_core (4.7.1)
tomlrb (>= 1.1, < 3.0)
appium_lib_core (5.4.0)
faye-websocket (~> 0.11.0)
selenium-webdriver (~> 3.14, >= 3.14.1)
bugsnag (6.24.1)
selenium-webdriver (~> 4.2, < 4.6)
bugsnag (6.25.1)
concurrent-ruby (~> 1.0)
builder (3.2.4)
childprocess (3.0.0)
concurrent-ruby (1.1.9)
childprocess (4.1.0)
concurrent-ruby (1.1.10)
cucumber (7.1.0)
builder (~> 3.2, >= 3.2.4)
cucumber-core (~> 10.1, >= 10.1.0)
Expand All @@ -45,10 +47,10 @@ GEM
mime-types (~> 3.3, >= 3.3.1)
multi_test (~> 0.1, >= 0.1.2)
sys-uname (~> 1.2, >= 1.2.2)
cucumber-core (10.1.0)
cucumber-core (10.1.1)
cucumber-gherkin (~> 22.0, >= 22.0.0)
cucumber-messages (~> 17.1, >= 17.1.1)
cucumber-tag-expressions (~> 4.0, >= 4.0.2)
cucumber-tag-expressions (~> 4.1, >= 4.1.0)
cucumber-create-meta (6.0.4)
cucumber-messages (~> 17.1, >= 17.1.1)
sys-uname (~> 1.2, >= 1.2.2)
Expand All @@ -60,40 +62,53 @@ GEM
cucumber-messages (~> 17.1, >= 17.1.0)
cucumber-messages (17.1.1)
cucumber-tag-expressions (4.1.0)
cucumber-wire (6.2.0)
cucumber-wire (6.2.1)
cucumber-core (~> 10.1, >= 10.1.0)
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
cucumber-messages (~> 17.1, >= 17.1.1)
curb (0.9.11)
diff-lcs (1.5.0)
ecma-re-validator (0.4.0)
regexp_parser (~> 2.2)
eventmachine (1.2.7)
faye-websocket (0.11.1)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.5.1)
ffi (1.15.4)
ffi (1.15.5)
hana (1.3.7)
json_schemer (0.2.24)
ecma-re-validator (~> 0.3)
hana (~> 1.3)
regexp_parser (~> 2.0)
uri_template (~> 0.7)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.1115)
mini_portile2 (2.6.1)
mime-types-data (3.2022.0105)
mini_portile2 (2.8.1)
multi_test (0.1.2)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
optimist (3.0.1)
os (1.0.0)
power_assert (2.0.1)
racc (1.6.0)
os (1.0.1)
power_assert (2.0.3)
racc (1.6.2)
rake (12.3.3)
regexp_parser (2.6.1)
rexml (3.2.5)
rubyzip (2.3.2)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
selenium-webdriver (4.5.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sys-uname (1.2.2)
ffi (~> 1.1)
test-unit (3.5.3)
test-unit (3.5.7)
power_assert
tomlrb (1.3.0)
tomlrb (2.0.3)
uri_template (0.7.0)
webrick (1.7.0)
websocket (1.2.9)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -106,4 +121,4 @@ DEPENDENCIES
os

BUNDLED WITH
1.16.5
2.1.4
34 changes: 25 additions & 9 deletions bugsnag-spring/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ext {
springVersion = '4.3.18.RELEASE'
springBootVersion = '1.5.15.RELEASE'
springVersion = '6.0.0'
springBootVersion = '3.0.0'
}

apply plugin: 'java-library'
Expand All @@ -12,16 +12,32 @@ repositories {
}

dependencies {
compile project(':bugsnag')
testCompile project(path: ':bugsnag', configuration: 'testRuntime')
compileOnly project(':bugsnag-spring:javax')
api project(':bugsnag')

compileOnly "javax.servlet:javax.servlet-api:${servletApiVersion}"
compileOnly "jakarta.servlet:jakarta.servlet-api:${jakartaServletApiVersion}"
compileOnly "org.springframework:spring-webmvc:${springVersion}"
compileOnly "org.springframework.boot:spring-boot:${springBootVersion}"
compileOnly "ch.qos.logback:logback-core:${logbackVersion}"
compileOnly "org.slf4j:slf4j-api:${slf4jApiVersion}"

testCompile "junit:junit:4.13.2"
testCompile "javax.servlet:javax.servlet-api:${servletApiVersion}"
testCompile "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
testCompile "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
testImplementation project(':bugsnag').sourceSets.test.output
testImplementation project(':bugsnag-spring:javax')
testImplementation project(':bugsnag')
testImplementation "junit:junit:${junitVersion}"
testImplementation "jakarta.servlet:jakarta.servlet-api:${jakartaServletApiVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
}

evaluationDependsOnChildren()

tasks['jar'].dependsOn(project(':bugsnag-spring:javax').tasks['jar'])

jar {
from project.sourceSets.main.allSource
from project(':bugsnag-spring:javax').configurations.archives.artifacts.files.collect { file ->
zipTree(file)
}
}
35 changes: 35 additions & 0 deletions bugsnag-spring/javax/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ext {
springVersion = '5.3.20'
springBootVersion = '2.5.14'
}

apply plugin: 'java'
apply plugin: 'java-library'

apply from: '../../common.gradle'

compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}

repositories {
mavenCentral()
}

dependencies {
api project(':bugsnag')
testImplementation project(':bugsnag').sourceSets.test.output

compileOnly "javax.servlet:javax.servlet-api:${javaxServletApiVersion}"
compileOnly "org.springframework:spring-webmvc:${springVersion}"
compileOnly "org.springframework.boot:spring-boot:${springBootVersion}"
compileOnly "ch.qos.logback:logback-core:${logbackVersion}"
compileOnly "org.slf4j:slf4j-api:${slf4jApiVersion}"

testImplementation "junit:junit:${junitVersion}"
testImplementation "javax.servlet:javax.servlet-api:${javaxServletApiVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.bugsnag;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.SpringVersion;
import org.springframework.core.type.AnnotationMetadata;

public class BugsnagImportSelector implements ImportSelector {

private static final String[] SPRING_JAKARTA_CLASSES = {
"com.bugsnag.SpringBootJakartaConfiguration",
"com.bugsnag.JakartaMvcConfiguration",
"com.bugsnag.ScheduledTaskConfiguration"
};

private static final String[] SPRING_JAVAX_CLASSES = {
"com.bugsnag.SpringBootJavaxConfiguration",
"com.bugsnag.JavaxMvcConfiguration",
"com.bugsnag.ScheduledTaskConfiguration"
};

@Override
public String[] selectImports(AnnotationMetadata importingClassMetadata) {
if (isSpringJakartaCompatible() && isJava17Compatible()) {
return SPRING_JAKARTA_CLASSES;
}

return SPRING_JAVAX_CLASSES;
}

private static boolean isSpringJakartaCompatible() {
return getMajorVersion(SpringVersion.getVersion()) >= 6;
}

private static boolean isJava17Compatible() {
return getMajorVersion(System.getProperty("java.version")) >= 17;
}

private static int getMajorVersion(String version) {
if (version == null) {
return 0;
}
int firstDot = version.indexOf(".");
if (firstDot == -1) {
return 0;
}

String majorVersion = version.substring(0, firstDot);
try {
return Integer.parseInt(majorVersion);
} catch (NumberFormatException nfe) {
return 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.springframework.web.servlet.ModelAndView;

import java.util.Collections;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

Expand All @@ -20,11 +19,11 @@
* resolvers.
*/
@Order(Ordered.HIGHEST_PRECEDENCE)
class BugsnagMvcExceptionHandler implements HandlerExceptionResolver {
class BugsnagJavaxMvcExceptionHandler implements HandlerExceptionResolver {

private final Bugsnag bugsnag;

BugsnagMvcExceptionHandler(final Bugsnag bugsnag) {
BugsnagJavaxMvcExceptionHandler(final Bugsnag bugsnag) {
this.bugsnag = bugsnag;
}

Expand Down
Loading

0 comments on commit 35eb2a6

Please sign in to comment.