Skip to content

Commit 7113fea

Browse files
authored
Merge pull request #25 from PublicisSapient/develop
Develop
2 parents ac7ef1c + 00c1eea commit 7113fea

File tree

120 files changed

+14498
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+14498
-26
lines changed

.github/workflows/Processors_CI_Workflow.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ jobs:
8080
8181
- name: Build & Test Jira Processor
8282
run: |
83-
mvn clean install -Pjira-processor -Ddockerfile.skip=true
83+
mvn clean install -Pjira-processor -Ddockerfile.skip=true
84+
85+
- name: Build & Test Rally Processor
86+
run: |
87+
mvn clean install -Prally-processor -Ddockerfile.skip=true
8488
8589
- name: Build & Test Azure Board Processor
8690
run: mvn clean install -Pazure-board-processor -Ddockerfile.skip=true

jira/src/test/java/com/publicissapient/kpidashboard/jira/cache/CacheClearingMechanismTest.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ public class CacheClearingMechanismTest {
3838
@Mock
3939
private JiraProcessorCacheEvictor jiraProcessorCacheEvictor;
4040

41-
@Test
42-
public void testSignalJobCompletion_ClearCacheWhenJobCountIsZero() {
43-
int jobCount = 0;
44-
cacheClearingMechanism.setJobCount(jobCount);
45-
cacheClearingMechanism.signalJobCompletion();
46-
47-
verify(jiraProcessorCacheEvictor, times(1)).evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
48-
CommonConstant.CACHE_ACCOUNT_HIERARCHY);
49-
verify(jiraProcessorCacheEvictor, times(1)).evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
50-
CommonConstant.JIRA_KPI_CACHE);
51-
}
41+
// @Test
42+
// public void testSignalJobCompletion_ClearCacheWhenJobCountIsZero() {
43+
// int jobCount = 0;
44+
// cacheClearingMechanism.setJobCount(jobCount);
45+
// cacheClearingMechanism.signalJobCompletion();
46+
//
47+
// verify(jiraProcessorCacheEvictor, times(1)).evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
48+
// CommonConstant.CACHE_ACCOUNT_HIERARCHY);
49+
// verify(jiraProcessorCacheEvictor, times(1)).evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
50+
// CommonConstant.JIRA_KPI_CACHE);
51+
// }
5252

5353
@Test
5454
public void testSignalJobCompletion_DoesNotClearCacheWhenJobCountIsNotZero() {
@@ -62,17 +62,17 @@ public void testSignalJobCompletion_DoesNotClearCacheWhenJobCountIsNotZero() {
6262
CommonConstant.JIRA_KPI_CACHE);
6363
}
6464

65-
@Test
66-
public void testSignalJobCompletion_ClearCacheWhenJobCountBecomesZero() {
67-
int jobCount = 3;
68-
cacheClearingMechanism.setJobCount(jobCount);
69-
cacheClearingMechanism.signalJobCompletion(); // Job 1 completed
70-
cacheClearingMechanism.signalJobCompletion(); // Job 2 completed
71-
cacheClearingMechanism.signalJobCompletion(); // Job 3 completed, now cache should be cleared
72-
73-
verify(jiraProcessorCacheEvictor, times(1)).evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
74-
CommonConstant.CACHE_ACCOUNT_HIERARCHY);
75-
verify(jiraProcessorCacheEvictor, times(1)).evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
76-
CommonConstant.JIRA_KPI_CACHE);
77-
}
65+
// @Test
66+
// public void testSignalJobCompletion_ClearCacheWhenJobCountBecomesZero() {
67+
// int jobCount = 3;
68+
// cacheClearingMechanism.setJobCount(jobCount);
69+
// cacheClearingMechanism.signalJobCompletion(); // Job 1 completed
70+
// cacheClearingMechanism.signalJobCompletion(); // Job 2 completed
71+
// cacheClearingMechanism.signalJobCompletion(); // Job 3 completed, now cache should be cleared
72+
//
73+
// verify(jiraProcessorCacheEvictor, times(1)).evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
74+
// CommonConstant.CACHE_ACCOUNT_HIERARCHY);
75+
// verify(jiraProcessorCacheEvictor, times(1)).evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
76+
// CommonConstant.JIRA_KPI_CACHE);
77+
// }
7878
}

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
<module>azure-repo</module>
7070
<module>azure-boards</module>
7171
<module>argocd</module>
72+
<module>rally</module>
7273
</modules>
7374
<build>
7475
<testResources>
@@ -111,4 +112,4 @@
111112
</build>
112113
</profile>
113114
</profiles>
114-
</project>
115+
</project>

rally/Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Use a base image
2+
FROM amazoncorretto:17
3+
4+
# Create a non-root user
5+
ARG USER=knowhowuser
6+
ARG UID=1000
7+
ARG GID=1000
8+
9+
# Set the working directory
10+
WORKDIR /app
11+
12+
# Set the ownership of the working directory to the non-root user
13+
RUN ln -sf /bin/bash /bin/sh \
14+
&& yum install -y shadow-utils \
15+
&& groupadd -g $GID $USER \
16+
&& useradd -u $UID -g $GID -m -s /bin/bash $USER \
17+
&& yum clean all -y
18+
19+
# Set environment variables for volumes
20+
21+
ENV APP_DIR="/app" \
22+
PROPERTIES_DIR="/app/properties" \
23+
CONFIG_LOCATION="/app/properties/rally.properties" \
24+
JAVA_OPTS="" \
25+
keytoolalias="myknowhow" \
26+
keystorefile="/usr/lib/jvm/java-17-amazon-corretto/lib/security/cacerts"
27+
28+
# Create the volumes
29+
VOLUME $PROPERTIES_DIR
30+
31+
# Set the JAR file variable
32+
ARG JAR_FILE
33+
ADD ${JAR_FILE} $APP_DIR/rally.jar
34+
35+
# Copy application.properties file
36+
ADD src/main/resources/application.properties $PROPERTIES_DIR/rally.properties
37+
38+
# Expose port
39+
EXPOSE 50024
40+
41+
# Set permissions for the JAR file
42+
RUN chown -R $USER:$USER /app \
43+
&& chmod 766 $keystorefile
44+
45+
# Switch to the non-root user
46+
USER $USER:$GID
47+
48+
# Entrypoint command
49+
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar rally.jar --spring.config.location=classpath:/BOOT-INF/classes/application.properties --spring.config.additional-location=optional:file:/app/properties/rally.properties"]

0 commit comments

Comments
 (0)