Skip to content

Commit 91b2cb9

Browse files
Ads (Java) fix (#36)
* test ads-java * fix cross origins * update lockfile * update template * allow all cors for ads-java * remove hardcoded env vars
1 parent 35d79ab commit 91b2cb9

File tree

5 files changed

+16
-33
lines changed

5 files changed

+16
-33
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
## Description
2+
Provide a short description of what your changes entail and what services are affected.
23

3-
Please, provide here a short description.
4-
Consider including things like:
5-
- An overview of why the work is taking place (with any relevant links); don’t assume familiarity with the history.
6-
- Major changes made and a high-level idea of the chosen approach.
7-
- All the compromises made (in _performance, readability, maintainability etc._)
8-
to achieve the expected result if any
9-
10-
## Checklist
11-
12-
Before you move on, make sure that:
13-
14-
- [ ] No unintended changes are included
15-
- [ ] Spelling is correct
16-
- [ ] There are tests covering new/changed functionality
17-
- [ ] Commits have meaningful names and changes. _CR remarks_-like commits are squashed.
18-
- [ ] Proper labels assigned. Use `WIP` label to indicate that state
4+
## How to test
5+
Provide the steps needed to test and verify your changes.

deploy/docker-compose/docker-compose.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
networks:
4545
- storedog-net
4646
web:
47-
image: public.ecr.aws/x2b9z2t7/storedog/backend:1.0.8
47+
image: public.ecr.aws/x2b9z2t7/storedog/backend:latest
4848
depends_on:
4949
- 'postgres'
5050
- 'redis'
@@ -58,7 +58,7 @@ services:
5858
networks:
5959
- storedog-net
6060
worker:
61-
image: public.ecr.aws/x2b9z2t7/storedog/backend:1.0.8
61+
image: public.ecr.aws/x2b9z2t7/storedog/backend:latest
6262
command: bundle exec sidekiq -C config/sidekiq.yml
6363
depends_on:
6464
- 'postgres'
@@ -71,24 +71,16 @@ services:
7171
DISABLE_SPRING: 1
7272
networks:
7373
- storedog-net
74-
ads:
75-
image: public.ecr.aws/x2b9z2t7/storedog/ads:1.0.8
76-
command: flask run --port=${ADS_PORT} --host=0.0.0.0
77-
depends_on:
78-
- postgres
74+
ads-java:
75+
image: public.ecr.aws/x2b9z2t7/storedog/ads-java:1.0.8
7976
environment:
80-
- FLASK_APP=ads.py
81-
- FLASK_DEBUG=1
82-
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
83-
- POSTGRES_USER=${POSTGRES_USER}
84-
- POSTGRES_HOST=postgres
85-
- DD_SERVICE=ads
77+
- DD_SERVICE=ads-java
8678
- DD_AGENT_HOST=dd-agent
8779
- DD_LOGS_INJECTION=true
8880
- DD_TRACE_ANALYTICS_ENABLED=true
8981
- DD_PROFILING_ENABLED=true
9082
ports:
91-
- "${ADS_PORT}:${ADS_PORT}"
83+
- "3030:8080"
9284
networks:
9385
- storedog-net
9486
discounts:

services/ads/java/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ COPY --from=TEMP_BUILD_IMAGE $APP_HOME/build/libs/$ARTIFACT_NAME .
2323

2424
RUN wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer'
2525

26-
ENTRYPOINT exec java -javaagent:/usr/app/dd-java-agent.jar -Ddd.logs.injection=true -Ddd.service=ads-java -Ddd.env=dev -jar ${ARTIFACT_NAME}
26+
ENTRYPOINT exec java -javaagent:/usr/app/dd-java-agent.jar -jar ${ARTIFACT_NAME}

services/ads/java/src/main/java/adsjava/AdsJavaApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@RestController
1919
public class AdsJavaApplication {
2020

21-
@CrossOrigin(origins = "http://localhost:3000")
21+
@CrossOrigin(origins = {"*"})
2222
@RequestMapping(
2323
value = "/banners/{id}",
2424
produces = MediaType.IMAGE_JPEG_VALUE
@@ -36,7 +36,7 @@ public String home() {
3636
return "Hello from Advertisements (Java)";
3737
}
3838

39-
@CrossOrigin(origins = "http://localhost:3000")
39+
@CrossOrigin(origins = {"*"})
4040
@RequestMapping(
4141
value = "/ads",
4242
produces = MediaType.APPLICATION_JSON_VALUE

services/backend/Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ GEM
189189
devise (>= 2.1.0)
190190
diff-lcs (1.5.0)
191191
docile (1.4.0)
192+
dogstatsd-ruby (5.5.0)
192193
doorkeeper (5.5.4)
193194
railties (>= 5)
194195
dotenv (2.7.6)
@@ -245,6 +246,7 @@ GEM
245246
globalid (1.0.0)
246247
activesupport (>= 5.0)
247248
glyphicons (1.0.2)
249+
google-protobuf (3.22.0)
248250
hashdiff (1.0.1)
249251
highline (2.0.3)
250252
hotwire-rails (0.1.3)
@@ -671,8 +673,10 @@ DEPENDENCIES
671673
bootsnap
672674
dalli
673675
ddtrace
676+
dogstatsd-ruby
674677
dotenv-rails (~> 2.1, >= 2.1.1)
675678
font_assets
679+
google-protobuf (~> 3.0)
676680
letter_opener
677681
listen
678682
oj

0 commit comments

Comments
 (0)