Skip to content

Commit 695151f

Browse files
authored
Merge branch 'develop' into feature-1957/decline-received-feedback-request
2 parents ddad64d + 6d22527 commit 695151f

File tree

111 files changed

+2760
-2250
lines changed

Some content is hidden

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

111 files changed

+2760
-2250
lines changed

.github/workflows/gradle-build-feature.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
19-
- name: Set up Node LTS
19+
- name: Set up Node Stable
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: '20'
22+
node-version: '22'
2323
- name: Set up JDK 21
2424
uses: actions/setup-java@v4
2525
with:

.github/workflows/gradle-build-native-feature.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19-
- name: Set up Node LTS
19+
- name: Set up Node Stable
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: '20'
22+
node-version: '22'
2323
- name: Set up GraalVM 21
2424
uses: graalvm/[email protected]
2525
with:

.github/workflows/gradle-build-production.yml

Lines changed: 23 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ on:
33
push:
44
branches:
55
- "master"
6-
76
env:
87
PROJECT_ID: ${{ secrets.RUN_PROJECT }}
98
RUN_REGION: us-central1
109
SERVICE_NAME: checkins-master
10+
TARGET_URL: https://checkins.objectcomputing.com
1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
permissions:
15-
contents: read
16-
packages: write
15+
contents: 'read'
16+
id-token: 'write'
1717
environment:
1818
name: Production
19-
url: https://checkins.objectcomputing.com/
19+
url: ${{ env.TARGET_URL }}
2020
steps:
2121
- uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2424
- name: Set up Node LTS
2525
uses: actions/setup-node@v4
2626
with:
27-
node-version: '20'
27+
node-version: '22'
2828
- name: Set up JDK 21
2929
uses: actions/setup-java@v4
3030
with:
@@ -36,42 +36,29 @@ jobs:
3636
path: ~/.gradle/caches
3737
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
3838
restore-keys: ${{ runner.os }}-gradle
39-
- name: Validate Gradle wrapper
40-
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
41-
- name: Build with Gradle
42-
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
39+
- name: Setup Gradle
40+
uses: gradle/actions/setup-gradle@v4
41+
- id: 'auth'
42+
uses: 'google-github-actions/auth@v2'
4343
with:
44-
arguments: assemble
45-
env:
46-
VITE_APP_API_URL: https://checkins.objectcomputing.com
47-
# - name: Publish package
48-
# uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
49-
# with:
50-
# arguments: publish
51-
# env:
52-
# GITHUB_TOKEN: ${{ secrets.GIT_HUB_TOKEN }}
53-
- name: Setup python
54-
run: |
55-
sudo apt-get install python2.7
56-
- name: Export gcloud related env variable
57-
run: export CLOUDSDK_PYTHON="/usr/bin/python2"
58-
- name: Setup gcloud CLI
59-
uses: google-github-actions/setup-gcloud@v0
44+
project_id: 'oci-intern-2019'
45+
workload_identity_provider: 'projects/832140020593/locations/global/workloadIdentityPools/github/providers/my-repo'
46+
- name: 'Set up Cloud SDK'
47+
uses: google-github-actions/setup-gcloud@v2
6048
with:
61-
version: "290.0.1"
62-
service_account_key: ${{ secrets.RUN_SA_KEY }}
63-
project_id: ${{ secrets.RUN_PROJECT }}
64-
- name: Auth Configure Docker
49+
version: '>= 363.0.0'
50+
- name: 'Auth Configure Docker'
6551
run: |-
6652
gcloud --quiet auth configure-docker
6753
- name: Build the Docker image
6854
run: |-
55+
./gradlew assemble
6956
cd server
7057
docker build --tag "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA" .
58+
env:
59+
VITE_APP_API_URL: ${{ env.TARGET_URL }}
7160
- name: Push the Docker image to Google Container Registry
72-
run: |-
73-
cd server
74-
docker push "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA"
61+
run: docker push "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA"
7562
- name: Deploy image to Cloud Run
7663
run: |-
7764
gcloud run deploy "$SERVICE_NAME" \
@@ -89,24 +76,15 @@ jobs:
8976
--set-env-vars "OAUTH_CLIENT_SECRET=${{ secrets.OAUTH_CLIENT_SECRET }}" \
9077
--set-env-vars "OAUTH_CALLBACK_URI"=${{ secrets.OAUTH_CALLBACK_URI }} \
9178
--set-env-vars "DIRECTORY_ID=${{ secrets.DIRECTORY_ID }}" \
92-
--set-env-vars "TYPE=${{ secrets.SA_KEY_TYPE }}" \
93-
--set-env-vars "PROJECT_ID=${{ secrets.RUN_PROJECT }}" \
94-
--set-env-vars "PRIVATE_KEY_ID=${{ secrets.SA_PRIVATE_KEY_ID }}" \
95-
--set-env-vars "PRIVATE_KEY=${{ secrets.SA_PRIVATE_KEY }}" \
96-
--set-env-vars "CLIENT_EMAIL=${{ secrets.SA_CLIENT_EMAIL }}" \
97-
--set-env-vars "CLIENT_ID=${{ secrets.SA_CLIENT_ID }}" \
98-
--set-env-vars "AUTH_URI=${{ secrets.SA_AUTH_URI }}" \
99-
--set-env-vars "TOKEN_URI=${{ secrets.SA_TOKEN_URI }}" \
100-
--set-env-vars "AUTH_PROVIDER_X509_CERT_URL=${{ secrets.SA_AUTH_PROVIDER_X509_CERT_URL }}" \
101-
--set-env-vars "CLIENT_X509_CERT_URL=${{ secrets.SA_CLIENT_X509_CERT_URL }}" \
79+
--set-env-vars "SERVICE_ACCOUNT_CREDENTIALS=${{ secrets.SERVICE_ACCOUNT_CREDENTIALS }}" \
10280
--set-env-vars "GSUITE_SUPER_ADMIN=${{ secrets.GSUITE_SUPER_ADMIN }}" \
10381
--set-env-vars "MJ_APIKEY_PUBLIC=${{ secrets.MJ_APIKEY_PUBLIC }}" \
10482
--set-env-vars "MJ_APIKEY_PRIVATE=${{ secrets.MJ_APIKEY_PRIVATE }}" \
10583
--set-env-vars "GIT_HUB_TOKEN=${{ secrets.GIT_HUB_TOKEN }}" \
106-
--set-env-vars "WEB_ADDRESS=https://checkins.objectcomputing.com" \
107-
--set-env-vars "FROM_ADDRESS=kimberlinm@objectcomputing.com" \
84+
--set-env-vars "WEB_ADDRESS=${{ env.TARGET_URL }}" \
85+
--set-env-vars "FROM_ADDRESS=no-reply@objectcomputing.com" \
10886
--set-env-vars "FROM_NAME=Check-Ins" \
10987
--set-env-vars "^@^MICRONAUT_ENVIRONMENTS=cloud,google,gcp" \
11088
--platform "managed" \
111-
--max-instances 5 \
89+
--max-instances 8 \
11290
--allow-unauthenticated

.github/workflows/gradle-build-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
packages: write
1111
steps:
1212
- uses: actions/checkout@v4
13-
- name: Set up Node LTS
13+
- name: Set up Node Stable
1414
uses: actions/setup-node@v2-beta
1515
with:
16-
node-version: '20'
16+
node-version: '22'
1717
- name: Set up JDK 21
1818
uses: actions/setup-java@v4
1919
with:

.github/workflows/gradle-deploy-develop.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
18-
- name: Set up Node LTS
18+
- name: Set up Node Stable
1919
uses: actions/setup-node@v4
2020
with:
21-
node-version: '20'
21+
node-version: '22'
2222
- name: Set up Temurin 21
2323
uses: actions/setup-java@v4
2424
with:
@@ -49,7 +49,7 @@ jobs:
4949
- name: Set up Node LTS
5050
uses: actions/setup-node@v4
5151
with:
52-
node-version: '20'
52+
node-version: '22'
5353
- name: Set up Temurin 21
5454
uses: actions/setup-java@v4
5555
with:
@@ -107,7 +107,7 @@ jobs:
107107
--set-env-vars "MJ_APIKEY_PRIVATE=${{ secrets.MJ_APIKEY_PRIVATE }}" \
108108
--set-env-vars "GIT_HUB_TOKEN=${{ secrets.GIT_HUB_TOKEN }}" \
109109
--set-env-vars "WEB_ADDRESS=${{ env.TARGET_URL }}" \
110-
--set-env-vars "FROM_ADDRESS=kimberlinm@objectcomputing.com" \
110+
--set-env-vars "FROM_ADDRESS=no-reply@objectcomputing.com" \
111111
--set-env-vars "FROM_NAME=Check-Ins - DEVELOP" \
112112
--set-env-vars "^@^MICRONAUT_ENVIRONMENTS=dev,cloud,google,gcp" \
113113
--platform "managed" \

.github/workflows/gradle-deploy-native-develop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
18-
- name: Set up Node LTS
18+
- name: Set up Node Stable
1919
uses: actions/setup-node@v4
2020
with:
21-
node-version: '20'
21+
node-version: '22'
2222
- name: Set up GraalVM 21
2323
uses: graalvm/[email protected]
2424
with:

docs/Gemfile.lock

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ GEM
251251
rb-fsevent (0.11.2)
252252
rb-inotify (0.10.1)
253253
ffi (~> 1.0)
254-
rexml (3.3.6)
255-
strscan
254+
rexml (3.3.9)
256255
rouge (3.30.0)
257256
rubyzip (2.3.2)
258257
safe_yaml (1.0.5)
@@ -266,7 +265,6 @@ GEM
266265
faraday (>= 0.17.3, < 3)
267266
simpleidn (0.2.1)
268267
unf (~> 0.1.4)
269-
strscan (3.1.0)
270268
terminal-table (1.8.0)
271269
unicode-display_width (~> 1.1, >= 1.1.1)
272270
typhoeus (1.4.1)

server/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
33
plugins {
44
id 'maven-publish'
55
id("com.gradleup.shadow") version "8.3.2"
6-
id("io.micronaut.application") version "4.4.2"
6+
id("io.micronaut.application") version "4.4.3"
77
id "jacoco"
88
}
99

10-
version "0.7.0"
10+
version "0.8.7"
1111
group "com.objectcomputing.checkins"
1212

1313
repositories {

server/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
micronautVersion=4.6.2
1+
micronautVersion=4.6.3
22
seleniumVersion=4.24.0

server/src/main/java/com/objectcomputing/checkins/notifications/email/MailJetSender.java

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ public void sendEmail(String fromName, String fromAddress, String subject, Strin
9090
return;
9191
}
9292

93-
List<JSONArray> emailBatches = getEmailBatches(recipients);
94-
List<JSONArray> failedBatches = new ArrayList<>();
9593
JSONObject sender = new JSONObject()
9694
.put("Email", fromAddress)
9795
.put("Name", fromName);
@@ -106,27 +104,33 @@ public void sendEmail(String fromName, String fromAddress, String subject, Strin
106104
final String localEmailFormat = modifiedEmailFormat;
107105
final String localContent = content;
108106

109-
emailBatches.forEach((recipientList) -> {
110-
MailjetRequest request = new MailjetRequest(Emailv31.resource)
111-
.property(Emailv31.MESSAGES, new JSONArray()
112-
.put(new JSONObject()
113-
.put(Emailv31.Message.FROM, sender)
114-
.put(Emailv31.Message.TO, new JSONArray().put(sender))
115-
.put(Emailv31.Message.BCC, recipientList)
116-
.put(Emailv31.Message.SUBJECT, subject)
117-
.put(localEmailFormat, localContent)));
107+
if (recipients.length == 1) {
108+
final JSONArray to = new JSONArray()
109+
.put(new JSONObject().put("Email", recipients[0]));
118110
try {
119-
MailjetResponse response = client.post(request);
120-
LOG.info("Mailjet response status: {}", response.getStatus());
121-
LOG.info("Mailjet response data: {}", response.getData());
111+
send(sender, to, null, subject, localEmailFormat, localContent);
122112
} catch (MailjetException e) {
123-
LOG.error("An unexpected error occurred while sending the upload notification: {}", e.getLocalizedMessage(), e);
124-
failedBatches.add(recipientList);
113+
throw new BadArgException("Failed to send email for " + to);
114+
}
115+
} else {
116+
List<JSONArray> emailBatches = getEmailBatches(recipients);
117+
List<JSONArray> failedBatches = new ArrayList<>();
118+
final JSONArray to =
119+
new JSONArray()
120+
.put(new JSONObject().put("Email", this.fromAddress));
121+
emailBatches.forEach((recipientList) -> {
122+
try {
123+
send(sender, to, recipientList,
124+
subject, localEmailFormat, localContent);
125+
} catch (MailjetException e) {
126+
LOG.error("An unexpected error occurred while sending the upload notification: {}", e.getLocalizedMessage(), e);
127+
failedBatches.add(recipientList);
128+
}
129+
});
130+
131+
if (!failedBatches.isEmpty()) {
132+
throw new BadArgException("Failed to send emails for " + failedBatches);
125133
}
126-
});
127-
128-
if (!failedBatches.isEmpty()) {
129-
throw new BadArgException("Failed to send emails for " + failedBatches);
130134
}
131135
}
132136

@@ -154,4 +158,22 @@ public void setEmailFormat(String format) {
154158
throw new BadArgException(String.format("Email format must be either HTMLPART, MJMLPART or TEXTPART, got %s", format));
155159
}
156160
}
161+
162+
private void send(JSONObject from, JSONArray to, JSONArray bcc,
163+
String subject, String emailFormat, String content) throws MailjetException {
164+
JSONObject values = new JSONObject()
165+
.put(Emailv31.Message.FROM, from)
166+
.put(Emailv31.Message.TO, to)
167+
.put(Emailv31.Message.SUBJECT, subject)
168+
.put(emailFormat, content);
169+
if (bcc != null) {
170+
values.put(Emailv31.Message.BCC, bcc);
171+
}
172+
173+
MailjetRequest request = new MailjetRequest(Emailv31.resource)
174+
.property(Emailv31.MESSAGES, new JSONArray().put(values));
175+
MailjetResponse response = client.post(request);
176+
LOG.info("Mailjet response status: {}", response.getStatus());
177+
LOG.info("Mailjet response data: {}", response.getData());
178+
}
157179
}

0 commit comments

Comments
 (0)