Skip to content

Commit

Permalink
refactor(journal): Rename from activitlog to journal
Browse files Browse the repository at this point in the history
Signed-off-by: Rodney Osodo <[email protected]>
  • Loading branch information
rodneyosodo committed Jun 26, 2024
1 parent 7d2060a commit 3f86fff
Show file tree
Hide file tree
Showing 44 changed files with 932 additions and 933 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- "consumers/notifiers/api/**"
- "http/api/**"
- "invitations/api/**"
- "journal/api/**"
- "provision/api/**"
- "readers/api/**"
- "things/api/**"
Expand Down Expand Up @@ -44,7 +45,7 @@ env:
TIMESCALE_READER_URL: http://localhost:9011
SMPP_NOTIFIER_URL: http://localhost:9014
SMTP_NOTIFIER_URL: http://localhost:9015
ACTIVITY_LOG_URL: http://localhost:9021
JOURNAL_URL: http://localhost:9021

jobs:
api-test:
Expand Down Expand Up @@ -79,10 +80,10 @@ jobs:
id: changes
with:
filters: |
activitylog:
journal:
- ".github/workflows/api-tests.yml"
- "api/openapi/activitylog.yml"
- "activitylog/api/**"
- "api/openapi/journal.yml"
- "journal/api/**"
auth:
- ".github/workflows/api-tests.yml"
Expand Down Expand Up @@ -189,12 +190,12 @@ jobs:
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'

- name: Run Activity Log API tests
if: steps.changes.outputs.activitylog == 'true'
- name: Run Journal API tests
if: steps.changes.outputs.journal == 'true'
uses: schemathesis/action@v1
with:
schema: api/openapi/activitylog.yml
base-url: ${{ env.ACTIVITY_LOG_URL }}
schema: api/openapi/journal.yml
base-url: ${{ env.JOURNAL_URL }}
checks: all
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/check-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- "twins/twins.go"
- "twins/states.go"
- "twins/service.go"
- "activitylog/activity.go"
- "journal/journal.go"
- name: Set up protoc
if: steps.changes.outputs.proto == 'true'
Expand Down Expand Up @@ -158,8 +158,8 @@ jobs:
mv ./twins/mocks/states.go ./twins/mocks/states.go.tmp
mv ./twins/mocks/repository.go ./twins/mocks/repository.go.tmp
mv ./twins/mocks/cache.go ./twins/mocks/cache.go.tmp
mv ./activitylog/mocks/repository.go ./activitylog/mocks/repository.go.tmp
mv ./activitylog/mocks/service.go ./activitylog/mocks/service.go.tmp
mv ./journal/mocks/repository.go ./journal/mocks/repository.go.tmp
mv ./journal/mocks/service.go ./journal/mocks/service.go.tmp
make mocks
Expand Down Expand Up @@ -211,5 +211,5 @@ jobs:
check_mock_changes ./twins/mocks/states.go "Twins States ./twins/mocks/states.go"
check_mock_changes ./twins/mocks/repository.go "Twins Repository ./twins/mocks/repository.go"
check_mock_changes ./twins/mocks/cache.go "Twins Cache ./twins/mocks/cache.go"
check_mock_changes ./activitylog/mocks/repository.go "Activity Log Repository ./activitylog/mocks/repository.go"
check_mock_changes ./activitylog/mocks/service.go "Activity Log Service ./activitylog/mocks/service.go"
check_mock_changes ./journal/mocks/repository.go "Journal Repository ./journal/mocks/repository.go"
check_mock_changes ./journal/mocks/service.go "Journal Service ./journal/mocks/service.go"
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ jobs:
- "pkg/uuid/**"
- "pkg/messaging/**"
activitylog:
- "activitylog/**"
- "cmd/activitylog/**"
journal:
- "journal/**"
- "cmd/journal/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "auth/**"
Expand Down Expand Up @@ -276,10 +276,10 @@ jobs:
run: |
mkdir coverage
- name: Run Activity log tests
if: steps.changes.outputs.activitylog == 'true' || steps.changes.outputs.workflow == 'true'
- name: Run Journal tests
if: steps.changes.outputs.journal == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/activitylog.out ./activitylog/...
go test --race -v -count=1 -coverprofile=coverage/journal.out ./journal/...
- name: Run auth tests
if: steps.changes.outputs.auth == 'true' || steps.changes.outputs.workflow == 'true'
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ MG_DOCKER_IMAGE_NAME_PREFIX ?= magistrala
BUILD_DIR = build
SERVICES = auth users things http coap ws lora influxdb-writer influxdb-reader mongodb-writer \
mongodb-reader cassandra-writer cassandra-reader postgres-writer postgres-reader timescale-writer timescale-reader cli \
bootstrap opcua twins mqtt provision certs smtp-notifier smpp-notifier invitations activitylog
TEST_API_SERVICES = activitylog auth bootstrap certs http invitations notifiers provision readers things twins users
bootstrap opcua twins mqtt provision certs smtp-notifier smpp-notifier invitations journal
TEST_API_SERVICES = journal auth bootstrap certs http invitations notifiers provision readers things twins users
TEST_API = $(addprefix test_api_,$(TEST_API_SERVICES))
DOCKERS = $(addprefix docker_,$(SERVICES))
DOCKERS_DEV = $(addprefix docker_dev_,$(SERVICES))
Expand Down Expand Up @@ -73,7 +73,7 @@ endef
ADDON_SERVICES = bootstrap cassandra-reader cassandra-writer certs \
influxdb-reader influxdb-writer lora-adapter mongodb-reader mongodb-writer \
opcua-adapter postgres-reader postgres-writer provision smpp-notifier smtp-notifier \
timescale-reader timescale-writer twins activitylog
timescale-reader timescale-writer twins journal

EXTERNAL_SERVICES = vault prometheus

Expand Down Expand Up @@ -177,7 +177,7 @@ test_api_twins: TEST_API_URL := http://localhost:9018
test_api_provision: TEST_API_URL := http://localhost:9016
test_api_readers: TEST_API_URL := http://localhost:9009 # This can be the URL of any reader service.
test_api_notifiers: TEST_API_URL := http://localhost:9014 # This can be the URL of any notifier service.
test_api_activitylog: TEST_API_URL := http://localhost:9021
test_api_journal: TEST_API_URL := http://localhost:9021

$(TEST_API):
$(call test_api_service,$(@),$(TEST_API_URL))
Expand Down
176 changes: 0 additions & 176 deletions activitylog/postgres/activity.go

This file was deleted.

Loading

0 comments on commit 3f86fff

Please sign in to comment.