Skip to content

Commit

Permalink
Merge pull request #17 from assimbly/develop
Browse files Browse the repository at this point in the history
Develop to master
  • Loading branch information
joaocatalao authored Dec 13, 2022
2 parents 287aabd + 59cc52f commit febfbc7
Show file tree
Hide file tree
Showing 19 changed files with 156 additions and 46 deletions.
36 changes: 36 additions & 0 deletions .github/issue-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
mode: auto

silent: false

commentMessage: 'Branch ${branchName} created for issue: ${issue.number}-${issue.title}'

defaultBranch: 'develop'

branchName: 'issue-${issue.number}/${issue.title,}'

gitSafeReplacementChar: '-'

branches:
- label: [ feature ]
prefix: feature/

- label: [ bug ]
prefix: bugfix/

- label: [ documentation ]
prefix: documentation/

- label: '*'
prefix: issues/

- label: no-branch
skip: true

autoCloseIssue: true
openPR: true

copyIssueDescriptionToPR: true
copyIssueLabelsToPR: true
copyIssueAssigneeToPR: true
copyIssueProjectsToPR: false
copyIssueMilestoneToPR: false
3 changes: 3 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
feature: ['feature/*', 'feat/*']
fix: ['fix/*', 'bug-fix/*']
chore: ['chore/*', 'maintenance/*', 'wip/*']
37 changes: 21 additions & 16 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
collapse-after: 5
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
collapse-after: 5
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
collapse-after: 5
labels:
- 'chore'
- 'maintenance'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
- 'wip'
exclude-labels:
- 'skip-changelog'
change-template: '- $TITLE (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
#version-resolver:
# major:
# labels:
# - 'major'
# minor:
# labels:
# - 'minor'
# patch:
# labels:
# - 'patch'
# default: patch
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
$CHANGES
14 changes: 14 additions & 0 deletions .github/workflows/issue-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Create Issue Branch

on:
issues:
types: [ created, assigned ]

jobs:
create_issue_branch_job:
runs-on: ubuntu-latest
steps:
- name: Create Issue Branch
uses: robvanderleek/create-issue-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Publish package to GitHub Packages
on:
release:
types: [created]
types: [ released ]

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -15,7 +16,6 @@ jobs:
java-version: '11'
distribution: 'adopt'
- name: Publish package
run: |
sh ./bin/mac/deploymodules.sh
run: sh ./bin/mac/deploymodules.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PR Labeler
on:
pull_request:
types: [opened, reopened, synchronize, assigned]
branches:
- develop # matches develop branch
- '*/*' # matches every branch containing a single '/'
- '!main' # excludes main branch (production)

permissions:
contents: read

jobs:
pr-labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Add labels to PR
uses: TimonVS/pr-labeler-action@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 6 additions & 5 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- main
- develop

pull_request:
types: [opened, reopened, synchronize]
branches:
- main

permissions:
contents: read
Expand All @@ -15,11 +17,10 @@ jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write

pull-requests: write
runs-on: ubuntu-latest

steps:
- uses: release-drafter/release-drafter@v5
- name: Draft a Release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion activemqBase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>base</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>activemq-base</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bin/win/updateversion.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ echo:
echo:
@echo example:
@echo updateversion 1.0.0
exit /B 1
exit /B 1u
2 changes: 1 addition & 1 deletion camelBase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>base</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>camel-base</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion camelComponents/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>base</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>camel-components</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion commonBase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>base</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>common-base</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion databaseDrivers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>base</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>database-drivers</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>base</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>extra</artifactId>
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<name>org.assimbly.camelconnector</name>
<url>http://maven.apache.org</url>

<version>3.8.0</version>
<version>3.8.1</version>

<modules>
<module>activemqBase</module>
Expand Down Expand Up @@ -39,8 +39,8 @@
<aopalliance.version>1.0</aopalliance.version>
<axiom.version>1.4.0</axiom.version>
<assimbly.version>3.8.0</assimbly.version>
<activemq-classic.version>5.17.2</activemq-classic.version>
<activemq-artemis.version>2.27.0</activemq-artemis.version>
<activemq-classic.version>5.17.3</activemq-classic.version>
<activemq-artemis.version>2.27.1</activemq-artemis.version>
<activemq-artemis-native.version>2.0.0</activemq-artemis-native.version>
<bouncycastle.version>1.70</bouncycastle.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
Expand Down Expand Up @@ -77,7 +77,7 @@
<json-path.version>2.7.0</json-path.version>
<junit.version>5.9.1</junit.version>
<jwt.version>0.11.5</jwt.version>
<httpclient.version>4.5.13</httpclient.version>
<httpclient.version>4.5.14</httpclient.version>
<kamelet.version>0.9.3</kamelet.version>
<logback-classic.version>1.4.5</logback-classic.version>
<mysql-connector-java.version>8.0.31</mysql-connector-java.version>
Expand All @@ -93,7 +93,7 @@
<slf4j.version>1.7.36</slf4j.version>
<sonic.version>10.0.18</sonic.version>
<spring.version>5.3.24</spring.version>
<spring-data.version>2.7.5</spring-data.version>
<spring-data.version>2.7.6</spring-data.version>
<sqlite-jdbc.version>3.40.0.0</sqlite-jdbc.version>
<tika.version>1.28.5</tika.version>
<xmlunit.version>1.6</xmlunit.version>
Expand Down
2 changes: 1 addition & 1 deletion springBase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>base</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>spring-base</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion testBase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>base</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
10 changes: 5 additions & 5 deletions utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>base</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>utils</artifactId>
Expand All @@ -27,22 +27,22 @@

<dependency>
<groupId>org.assimbly</groupId>
<artifactId>camelBase</artifactId>
<artifactId>camel-base</artifactId>
<version>${assimbly.version}</version>
</dependency>
<dependency>
<groupId>org.assimbly</groupId>
<artifactId>commonBase</artifactId>
<artifactId>common-base</artifactId>
<version>${assimbly.version}</version>
</dependency>
<dependency>
<groupId>org.assimbly</groupId>
<artifactId>springBase</artifactId>
<artifactId>spring-base</artifactId>
<version>${assimbly.version}</version>
</dependency>
<dependency>
<groupId>org.assimbly</groupId>
<artifactId>testBase</artifactId>
<artifactId>test-base</artifactId>
<version>${assimbly.version}</version>
<scope>test</scope>
</dependency>
Expand Down
34 changes: 31 additions & 3 deletions utils/src/main/java/org/assimbly/util/rest/ResponseUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,38 @@ public static ResponseEntity<String> createFailureResponse(long connectorId, Str
}

return response;
}
}


public static ResponseEntity<String> createFailureResponseWithHeaders(long connectorId, String mediaType, String path, String message, String headerMessage, String headerParam) throws Exception{
public static ResponseEntity<String> createFailureResponse(long connectorId, String mediaType, String path, String message, boolean plainResponse) throws Exception{

log.error("REST request with path " + path + " for gateway with id " + connectorId + " failed.");

if(plainResponse) {
response = ResponseEntity.ok()
.body(message);
}else {
switch (mediaType.toLowerCase()) {
case "application/json":
response = ResponseEntity.badRequest()
.body(BodyUtil.createFailureJSONResponse(connectorId, path, message));
break;
case "application/xml":
response = ResponseEntity.badRequest()
.body(BodyUtil.createFailureXMLResponse(connectorId, path, message));

break;
default:
response = ResponseEntity.badRequest()
.body(BodyUtil.createFailureTEXTResponse(message));
break;
}
}

return response;
}


public static ResponseEntity<String> createFailureResponseWithHeaders(long connectorId, String mediaType, String path, String message, String headerMessage, String headerParam) throws Exception{

log.error("REST request with path " + path + " for gateway with id " + connectorId + " failed.");

Expand Down

0 comments on commit febfbc7

Please sign in to comment.