Skip to content

Commit a2717e4

Browse files
Merge pull request #89 from PublicisSapient/hotfix/13.3.2-fixes
Hotfix/13.3.2 fixes
2 parents 0ae2e13 + 5f330c2 commit a2717e4

File tree

8 files changed

+380
-34
lines changed

8 files changed

+380
-34
lines changed

.github/workflows/Processors_CI_CD_Workflow.yaml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ on:
2828
- dev1
2929
- qa
3030
- stage
31-
31+
3232
processor:
3333
description: 'Processor to build and deploy'
3434
required: true
@@ -58,7 +58,7 @@ env:
5858
sonarurl: ${{ secrets.SONARURL }} # SonarQube URL stored in secrets
5959

6060
jobs:
61-
61+
6262
# ✅ Building & Testing Processors
6363
build:
6464
runs-on: ubuntu-latest
@@ -71,23 +71,15 @@ jobs:
7171
if [[ "$ENV" == "qa" ]]; then
7272
echo "IMAGE_TAG=qa-${GITHUB_SHA::8}" >> $GITHUB_ENV
7373
echo "VALUES_FILE=values-qa.yaml" >> $GITHUB_ENV
74-
echo "ARGOCD_APP_NAME=knh-api-qa" >> $GITHUB_ENV
75-
echo "argocd_app_name=knh-api-qa" >> $GITHUB_OUTPUT
7674
elif [[ "$ENV" == "stage" ]]; then
7775
echo "IMAGE_TAG=master-${GITHUB_SHA::8}" >> $GITHUB_ENV
7876
echo "VALUES_FILE=values-stage.yaml" >> $GITHUB_ENV
79-
echo "ARGOCD_APP_NAME=knh-api-stage" >> $GITHUB_ENV
80-
echo "argocd_app_name=knh-api-stage" >> $GITHUB_OUTPUT
8177
elif [[ "$ENV" == "dev1" ]]; then
8278
echo "IMAGE_TAG=dev1-${GITHUB_SHA::8}" >> $GITHUB_ENV
8379
echo "VALUES_FILE=values-dev1.yaml" >> $GITHUB_ENV
84-
echo "ARGOCD_APP_NAME=knh-api-dev1" >> $GITHUB_ENV
85-
echo "argocd_app_name=knh-api-dev1" >> $GITHUB_OUTPUT
8680
else
8781
echo "IMAGE_TAG=dev-${GITHUB_SHA::8}" >> $GITHUB_ENV
8882
echo "VALUES_FILE=values-dev.yaml" >> $GITHUB_ENV
89-
echo "ARGOCD_APP_NAME=knh-api-dev" >> $GITHUB_ENV
90-
echo "argocd_app_name=knh-api-dev" >> $GITHUB_OUTPUT
9183
fi
9284
- name: Checkout Repository
9385
uses: actions/checkout@v2
@@ -134,21 +126,21 @@ jobs:
134126
</activeProfiles>
135127
</settings>
136128
EOF
137-
129+
138130
- name: Clone & Build knowhow-common dependency
139131
run: |
140132
BRANCH_TO_CLONE="${{ github.event.inputs.knowhow_common_branch }}"
141133
git clone --branch $BRANCH_TO_CLONE https://github.com/PublicisSapient/knowhow-common.git
142134
cd knowhow-common
143135
mvn clean install -Ddockerfile.skip=true
144-
136+
145137
- name: Get common version using Maven Help Plugin
146138
run: |
147139
cd knowhow-common
148140
COMMON_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
149141
echo "COMMON_VERSION=$COMMON_VERSION"
150142
echo "COMMON_VERSION=$COMMON_VERSION" >> $GITHUB_ENV
151-
143+
152144
- name: Updating the common version in processor project
153145
run: |
154146
mvn versions:use-dep-version \
@@ -180,39 +172,39 @@ jobs:
180172
run: |
181173
chmod +x SonarQG.sh
182174
./SonarQG.sh ./target/sonar/report-task.txt
183-
175+
184176
- name: Build & Push Jira Docker Image
185177
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'jira' }}
186178
run: |
187179
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
188-
docker build -t $ACR_LOGIN_SERVER/$JIRA_IMAGE_NAME:$IMAGE_TAG .
180+
docker build -t $ACR_LOGIN_SERVER/$JIRA_IMAGE_NAME:$IMAGE_TAG jira/.
189181
docker push $ACR_LOGIN_SERVER/$JIRA_IMAGE_NAME:$IMAGE_TAG
190182
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
191-
183+
192184
- name: Build & Push DevOps Docker Image
193185
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'devops' }}
194186
run: |
195187
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
196-
docker build -t $ACR_LOGIN_SERVER/$DEVOPS_IMAGE_NAME:$IMAGE_TAG .
188+
docker build -t $ACR_LOGIN_SERVER/$DEVOPS_IMAGE_NAME:$IMAGE_TAG -f devops-processor-startup/Dockerfile .
197189
docker push $ACR_LOGIN_SERVER/$DEVOPS_IMAGE_NAME:$IMAGE_TAG
198190
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
199-
191+
200192
- name: Build & Push AzureBoard Docker Image
201193
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'azureboard' }}
202194
run: |
203195
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
204-
docker build -t $ACR_LOGIN_SERVER/$AZUREBOARD_IMAGE_NAME:$IMAGE_TAG .
196+
docker build -t $ACR_LOGIN_SERVER/$AZUREBOARD_IMAGE_NAME:$IMAGE_TAG azure-boards/.
205197
docker push $ACR_LOGIN_SERVER/$AZUREBOARD_IMAGE_NAME:$IMAGE_TAG
206198
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
207-
199+
208200
- name: Build & Push Azure Pipeline repo Docker Image
209201
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'azurepipelines' }}
210202
run: |
211203
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
212-
docker build -t $ACR_LOGIN_SERVER/$AZUREPIPELINE_IMAGE_NAME:$IMAGE_TAG .
204+
docker build -t $ACR_LOGIN_SERVER/$AZUREPIPELINE_IMAGE_NAME:$IMAGE_TAG -f azure-pipeline-repo-processor-startup/Dockerfile .
213205
docker push $ACR_LOGIN_SERVER/$AZUREPIPELINE_IMAGE_NAME:$IMAGE_TAG
214206
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
215-
207+
216208
- name: Build & Push SCM Processor Docker Image
217209
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'scm-processor' }}
218210
run: |
@@ -233,7 +225,7 @@ jobs:
233225
git add $VALUES_FILE
234226
git diff --cached --quiet || git commit -m "Update image tag values to ${IMAGE_TAG}"
235227
git push origin HEAD
236-
228+
237229
- name: Checkout devops Helm charts from Bitbucket
238230
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'devops' }}
239231
run: |
@@ -272,7 +264,7 @@ jobs:
272264
git add $VALUES_FILE
273265
git diff --cached --quiet || git commit -m "Update image tag values to ${IMAGE_TAG}"
274266
git push origin HEAD
275-
267+
276268
- name: Checkout scm Helm charts from Bitbucket
277269
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'scm-processor' }}
278270
run: |
@@ -326,7 +318,7 @@ jobs:
326318
run: |
327319
argocd app sync knh-azure-board-${{ github.event.inputs.env }}
328320
argocd app wait knh-azure-board-${{ github.event.inputs.env }} --health --timeout 300
329-
321+
330322
deploy-az-pipeline:
331323
runs-on: github-actions-self-hosted-runner
332324
timeout-minutes: 30
@@ -353,9 +345,9 @@ jobs:
353345
runs-on: github-actions-self-hosted-runner
354346
timeout-minutes: 30
355347
needs: [build, argocd-setup]
356-
steps:
348+
steps:
357349
- name: Deploy DevOps Processor
358350
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'devops' }}
359351
run: |
360352
argocd app sync knh-devops-processor-${{ github.event.inputs.env }}
361-
argocd app wait knh-devops-processor-${{ github.event.inputs.env }} --health --timeout 600
353+
argocd app wait knh-devops-processor-${{ github.event.inputs.env }} --health --timeout 900

jira/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@
270270
<artifactId>htmlunit</artifactId>
271271
<version>3.9.0</version>
272272
</dependency>
273+
<dependency>
274+
<groupId>com.konghq</groupId>
275+
<artifactId>unirest-java</artifactId>
276+
<version>3.14.5</version>
277+
</dependency>
273278
<!-- https://mvnrepository.com/artifact/com.atlassian.sal/sal-api -->
274279
<dependency>
275280
<groupId>com.atlassian.sal</groupId>
@@ -442,6 +447,10 @@
442447
</exclusion>
443448
</exclusions>
444449
</dependency>
450+
<dependency>
451+
<groupId>org.springframework.batch</groupId>
452+
<artifactId>spring-batch-core</artifactId>
453+
</dependency>
445454
</dependencies>
446455
<repositories>
447456
<repository>

jira/src/main/java/com/publicissapient/kpidashboard/jira/constant/JiraConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ public final class JiraConstants {
5050
public static final String FALSE = "False";
5151
public static final String START_AT_ATTRIBUTE = "startAt";
5252
public static final String MAX_RESULTS_ATTRIBUTE = "maxResults";
53+
public static final String FIELDS_BY_KEYS_ATTRIBUTE = "fieldsByKeys";
5354
public static final int MAX_JQL_LENGTH_FOR_HTTP_GET = 3000;
5455
public static final String JQL_ATTRIBUTE = "jql";
5556
public static final String FILTER_FAVOURITE_PATH = "filter/favourite";
5657
public static final String FILTER_PATH_FORMAT = "filter/%s";
5758
public static final String SEARCH_URI_PREFIX = "search";
5859
public static final String EXPAND_ATTRIBUTE = "expand";
5960
public static final String FIELDS_ATTRIBUTE = "fields";
61+
public static final String NEXT_PAGE_TOKEN_ATTRIBUTE = "nextPageToken";
6062
public static final String DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
6163
public static final String AGGREGATED_TIME_SPENT = "aggregatetimespent";
6264
public static final String AGGREGATED_TIME_ORIGINAL = "aggregatetimeoriginalestimate";
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*******************************************************************************
2+
* Copyright 2014 CapitalOne, LLC.
3+
* Further development Copyright 2022 Sapient Corporation.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
******************************************************************************/
18+
19+
package com.publicissapient.kpidashboard.jira.exception;
20+
21+
public class JiraApiException extends Exception {
22+
public JiraApiException(String message) {
23+
super(message);
24+
}
25+
}
26+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* Copyright 2014 CapitalOne, LLC.
3+
* Further development Copyright 2022 Sapient Corporation.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
******************************************************************************/
18+
19+
package com.publicissapient.kpidashboard.jira.model;
20+
21+
import com.atlassian.jira.rest.client.api.domain.Issue;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Data;
24+
25+
@Data
26+
@AllArgsConstructor
27+
public class JiraSearchResponse {
28+
private final Iterable<Issue> issues;
29+
private boolean isLast;
30+
private String nextPageToken;
31+
}
32+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*******************************************************************************
2+
* Copyright 2014 CapitalOne, LLC.
3+
* Further development Copyright 2022 Sapient Corporation.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
******************************************************************************/
18+
19+
package com.publicissapient.kpidashboard.jira.parser;
20+
21+
import com.atlassian.jira.rest.client.api.domain.Issue;
22+
import com.publicissapient.kpidashboard.jira.model.JiraSearchResponse;
23+
import com.atlassian.jira.rest.client.internal.json.GenericJsonArrayParser;
24+
import org.codehaus.jettison.json.JSONArray;
25+
import org.codehaus.jettison.json.JSONException;
26+
import org.codehaus.jettison.json.JSONObject;
27+
28+
import java.util.Collections;
29+
30+
public class JiraSearchResponseParser {
31+
32+
public JiraSearchResponse parse(JSONObject json) throws JSONException {
33+
JSONArray issuesJsonArray = json.getJSONArray("issues");
34+
35+
Iterable<Issue> issues;
36+
if (issuesJsonArray.length() > 0) {
37+
CustomIssueJsonParser issueParser = new CustomIssueJsonParser(
38+
json.optJSONObject("names"), json.optJSONObject("schema"));
39+
GenericJsonArrayParser<Issue> issuesParser = GenericJsonArrayParser.create(issueParser);
40+
issues = issuesParser.parse(issuesJsonArray);
41+
} else {
42+
issues = Collections.emptyList();
43+
}
44+
45+
boolean isLast = json.optBoolean("isLast", true);
46+
String nextPageToken = json.optString("nextPageToken", null);
47+
48+
return new JiraSearchResponse(issues, isLast, nextPageToken);
49+
}
50+
}

0 commit comments

Comments
 (0)