-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Alex Zerntev <[email protected]> Co-authored-by: Alex Zerntev <[email protected]>
- Loading branch information
1 parent
d45cd38
commit 5d8c456
Showing
99 changed files
with
110,005 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/ci.yaml | ||
- pom.xml | ||
- "**/src/**" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.READ_PACKAGES }} | ||
|
||
jobs: | ||
# TO DEFINE | ||
# code check job | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: '22' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
server-id: github | ||
settings-path: ${{ github.workspace }} | ||
- uses: stCarolas/setup-maven@v5 | ||
with: | ||
maven-version: 3.9.9 | ||
- run: mvn -B clean install --settings settings.xml | ||
- uses: mikepenz/action-junit-report@v4 | ||
if: success() || failure() | ||
with: | ||
annotate_only: true | ||
check_name: "das-jira-connector tests report" | ||
report_paths: das-jira-connector/target/surefire-reports/*.xml | ||
detailed_summary: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Docker CI | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/docker-ci.yaml | ||
- pom.xml | ||
- docker/** | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.READ_PACKAGES }} | ||
|
||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: docker/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: publish | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
- "v*.*.*-*" | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.WRITE_PACKAGES }} | ||
|
||
jobs: | ||
publish-jars: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: '22' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
server-id: github | ||
settings-path: ${{ github.workspace }} | ||
- name: set version from tag | ||
run: mvn -B versions:set -DnewVersion=${GITHUB_REF#refs/tags/v} | ||
- name: build and deploy | ||
run: mvn -B clean deploy --settings settings.xml | ||
publish-docker-image: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_trigger_deploy: ${{ steps.should_trigger_deploy.outputs.should_trigger_deploy }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.WRITE_PACKAGES }} | ||
logout: false | ||
- uses: s4u/[email protected] | ||
with: | ||
java-version: 22 | ||
maven-version: 3.9.9 | ||
- name: set version from tag | ||
run: mvn -B versions:set -DnewVersion=${GITHUB_REF#refs/tags/v} -DprocessAllModules | ||
- name: build docker image | ||
run: docker/build | ||
- name: publish docker image | ||
run: docker/publish | ||
- name: set should_trigger_deploy | ||
id: should_trigger_deploy | ||
shell: bash | ||
run: | | ||
pattern='^refs/tags/v[0-9]+\.[0-9]+\.([1-9][0-9]*$|[0-9]+-.*$)' | ||
echo "should_trigger_deploy=$([[ "$GITHUB_REF" =~ $pattern ]] && echo true || echo false)" >> $GITHUB_OUTPUT | ||
gh-release: | ||
needs: [publish-jars, publish-docker-image] | ||
runs-on: self-hosted | ||
steps: | ||
- uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ secrets.RAW_CI_PAT }} | ||
generate_release_notes: true | ||
draft: false | ||
prerelease: ${{ contains(github.ref_name, '-') }} | ||
tag_name: ${{ github.ref_name }} | ||
trigger-deploy: | ||
needs: publish-docker-image | ||
if: needs.publish-docker-image.outputs.should_trigger_deploy == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: tag without 'v' prefix | ||
id: extract_tag | ||
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | ||
- name: trigger mvp-deployer workflow | ||
uses: peter-evans/repository-dispatch@v3 | ||
with: | ||
token: ${{ secrets.RAW_CI_PAT }} | ||
repository: raw-labs/mvp-deployer | ||
event-type: deploy-patch-das-jira | ||
client-payload: |- | ||
{ | ||
"aws_region": "eu-west-1", | ||
"raw_version": "${{ steps.extract_tag.outputs.version }}", | ||
"target_env": "integration", | ||
"loaded_vars": "integration", | ||
"deployer_version": "latest" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.class | ||
.metals/ | ||
.git/ | ||
.vscode/ | ||
target/ | ||
.bsp/ | ||
.idea/ | ||
/das-jira-connector/dependency-reduced-pom.xml | ||
pom.xml.versionsBackup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Source code in this repository is variously licensed under the Business Source License 1.1 (BSL) and the Apache 2.0 license. | ||
A copy of each license can be found in the licenses directory. | ||
Source code in a given file is licensed under the BSL and the copyright belongs to RAW Labs S.A. unless otherwise noted at the beginning of the file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# DAS Jira | ||
|
||
## How to use | ||
|
||
First you need to build the project: | ||
```bash | ||
$ docker build -t das-jira:latest . | ||
``` | ||
|
||
This will create a docker image with the name `das-jira`. | ||
|
||
Then you can run the image with the following command: | ||
```bash | ||
$ docker run -p 50051:50051 das-jira:latest | ||
``` | ||
|
||
You can find the image id by looking at the sbt output or by running: | ||
```bash | ||
$ docker images | ||
``` | ||
|
||
## Options | ||
|
||
| Name | Description | Default | Required | | ||
|-------------------------|--------------------------------------------------------------------|---------|----------| | ||
| `base_url` | Jira base url | | Yes | | ||
| `personal_access_token` | API PAT for self hosted Jira instances | | Yes | | ||
| `token` | API token for user's Atlassian account. | | Yes | | ||
| `uesrname` | Email address of agent user who have permission to access the API. | | Yes | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.rawlabs.das.jira</groupId> | ||
<artifactId>das-jira</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>das-jira-connector</artifactId> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>${maven-surface-plugin-version}</version> | ||
<configuration> | ||
<argLine>-XX:+EnableDynamicAgentLoading</argLine> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<failOnError>true</failOnError> | ||
<failOnWarning>true</failOnWarning> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>${maven-shade-plugin-version}</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<transformers> | ||
<!-- Specify the main class from the dependency --> | ||
<transformer | ||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | ||
<mainClass>com.rawlabs.das.server.DASServerMain</mainClass> | ||
</transformer> | ||
</transformers> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<!-- RAW Labs Dependencies --> | ||
<dependency> | ||
<groupId>com.raw-labs</groupId> | ||
<artifactId>das-sdk-java</artifactId> | ||
<version>${das-java-sdk-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.raw-labs</groupId> | ||
<artifactId>das-server-scala_${scala-version}</artifactId> | ||
<version>${das-server-scala-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.rawlabs.das.jira.rest</groupId> | ||
<artifactId>jira-platform-api-client</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.rawlabs.das.jira.rest</groupId> | ||
<artifactId>jira-software-api-client</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.raw-labs</groupId> | ||
<artifactId>protocol-das_${scala-version}</artifactId> | ||
<version>${protocol-das.version}</version> | ||
</dependency> | ||
|
||
<!-- Test Dependencies --> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<version>${junit-jupiter-version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<version>${junit-jupiter-version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<version>${junit-jupiter-version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-junit-jupiter</artifactId> | ||
<version>${junit-jupiter-version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<properties> | ||
<maven.compiler.source>22</maven.compiler.source> | ||
<maven.compiler.target>22</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
|
||
<!-- Plugins Dependencies --> | ||
<maven-surface-plugin-version>3.5.0</maven-surface-plugin-version> | ||
<maven-openapi-generator-plugin-version>7.8.0</maven-openapi-generator-plugin-version> | ||
<maven-dependency-plugin-version>3.8.0</maven-dependency-plugin-version> | ||
<maven-shade-plugin-version>3.4.1</maven-shade-plugin-version> | ||
|
||
<!-- RAW Labs Dependencies --> | ||
<das-java-sdk-version>0.1.2</das-java-sdk-version> | ||
<das-server-scala-version>0.1.5</das-server-scala-version> | ||
<jira-rest-client-version>1.0-SNAPSHOT</jira-rest-client-version> | ||
<protocol-das.version>0.1.4</protocol-das.version> | ||
|
||
<!-- Scala Version --> | ||
<scala-version>2.12</scala-version> | ||
</properties> | ||
|
||
</project> |
44 changes: 44 additions & 0 deletions
44
das-jira-connector/src/main/java/com/rawlabs/das/jira/DASJira.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.rawlabs.das.jira; | ||
|
||
import com.rawlabs.das.jira.initializer.DASJiraInitializer; | ||
import com.rawlabs.das.jira.tables.*; | ||
import com.rawlabs.das.sdk.java.DASFunction; | ||
import com.rawlabs.das.sdk.java.DASSdk; | ||
import com.rawlabs.das.sdk.java.DASTable; | ||
import com.rawlabs.protocol.das.FunctionDefinition; | ||
import com.rawlabs.protocol.das.TableDefinition; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class DASJira implements DASSdk { | ||
|
||
private final Map<String, String> options; | ||
private final DASJiraTableManager tableManager; | ||
|
||
protected DASJira(Map<String, String> options) { | ||
DASJiraInitializer.initialize(options); | ||
tableManager = new DASJiraTableManager(options); | ||
this.options = options; | ||
} | ||
|
||
@Override | ||
public List<TableDefinition> getTableDefinitions() { | ||
return tableManager.getTableDefinitions(); | ||
} | ||
|
||
@Override | ||
public List<FunctionDefinition> getFunctionDefinitions() { | ||
return List.of(); | ||
} | ||
|
||
@Override | ||
public DASTable getTable(String name) { | ||
return tableManager.getTable(name); | ||
} | ||
|
||
@Override | ||
public DASFunction getFunction(String name) { | ||
return null; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
das-jira-connector/src/main/java/com/rawlabs/das/jira/DASJiraBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.rawlabs.das.jira; | ||
|
||
import com.rawlabs.das.sdk.java.DASSdk; | ||
import com.rawlabs.das.sdk.java.DASSdkBuilder; | ||
import com.rawlabs.utils.core.RawSettings; | ||
|
||
import java.util.Map; | ||
|
||
public class DASJiraBuilder implements DASSdkBuilder { | ||
|
||
@Override | ||
public String getDasType() { | ||
return "jira"; | ||
} | ||
|
||
@Override | ||
public DASSdk build(Map<String, String> options, RawSettings rawSettings) { | ||
return new DASJira(options); | ||
} | ||
} |
Oops, something went wrong.