Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Enhance Analaytics module to fetch Ontology visits, User visits, and the Most visited pages in the month #17

Merged
merged 84 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
8535b30
remove forgot variables
syphax-bouazzouni Dec 5, 2022
f7aa1be
fix for #61
alexskr Dec 22, 2022
d1f8aa7
Merge pull request #59 from ontoportal-lirmm/pr/feature/add-ontology-…
alexskr Jan 9, 2023
f03b2aa
Restore branch specifier to develop
alexskr Jan 9, 2023
e383b54
Optimization - remove repeated query
alexskr Jan 14, 2023
c496e7e
Merge pull request #62 from ncbo/fix_contact_in_ontology_import_script
alexskr Jan 17, 2023
a0297f2
Gemfile.lock update
mdorf Jan 31, 2023
99f389c
Gemfile.lock update
mdorf Jan 31, 2023
2dfd9da
Gemfile.lock update
mdorf Jan 31, 2023
7f0589e
Gemfile.lock update
mdorf Feb 1, 2023
6d0b1c8
Merge staging for release
mdorf Feb 1, 2023
6db9916
Gemfile had references to develop branch
mdorf Feb 1, 2023
f47a07b
implemented #64 - ability to generate labels independently of RDF pro…
mdorf Feb 10, 2023
dbd4060
Gemfile.lock update
mdorf Feb 10, 2023
5c6cf91
fixed a bug in #64
mdorf Feb 14, 2023
c09d76e
Relocate docker-compose file and update default configs
alexskr Feb 15, 2023
9317cbd
Merge branch 'master' into develop
alexskr Feb 15, 2023
6c6a5c8
Add GH workflow for publishing docker images
alexskr Feb 15, 2023
1988608
use ruby native method for listing files instead of a git function
alexskr Mar 28, 2023
ed26123
remove comment
alexskr Mar 29, 2023
a366805
capitalize argument in order to be consistent with other scripts
alexskr Mar 29, 2023
6ec1174
add arm/64 platform
alexskr Mar 29, 2023
a461322
additional error handling for SPAM deletion script, #60
mdorf Apr 6, 2023
3b9fdb0
additional error handling for SPAM deletion script, #60
mdorf Apr 6, 2023
030930c
implemented #67 - improved corrupt data and error handling
mdorf Apr 11, 2023
3308da0
Gemfile.lock update
mdorf Apr 11, 2023
cd659f3
Gemfile.lock update
mdorf Apr 11, 2023
873d829
exclude test/data/dictionary.txt from git commits
alexskr May 5, 2023
419c518
update version of solr-ut
alexskr May 5, 2023
94eed8d
Gemfile.lock update
alexskr May 5, 2023
68dea92
Restore branch specifier to master
alexskr May 5, 2023
07a1d65
fixed configuration for the analytics module
mdorf May 9, 2023
84a7781
Merge branch 'develop' of https://github.com/ncbo/ncbo_cron into develop
mdorf May 9, 2023
8e11202
Gemfile.lock update
mdorf May 9, 2023
0b9b785
implemented #69 - scheduled annotator dictionary file generation shou…
mdorf Jun 22, 2023
139494e
Gemfile.lock update
mdorf Jun 22, 2023
23794ff
gem update
alexskr Jun 23, 2023
943a4ef
Merge branch 'develop'
alexskr Jun 23, 2023
44dec8c
create new rake taks for updating purls for all ontologies
alexskr Jul 10, 2023
f5399c5
initial implementation of #70 - Google Analytics v4 Update Compatibil…
mdorf Jul 13, 2023
496107a
Gemfile.lock update
mdorf Jul 13, 2023
6bb0c23
added the /data folder to ignore
mdorf Jul 13, 2023
8c8ddb6
update gems
alexskr Jul 20, 2023
dad8832
Gemfile.lock update
mdorf Jul 26, 2023
cd6d354
Merge branch 'develop' of https://github.com/ncbo/ncbo_cron into develop
mdorf Jul 26, 2023
29dc761
Gemfile.lock update
mdorf Jul 26, 2023
20394e6
Merge branch 'develop'
alexskr Jul 26, 2023
758f199
Gemfile.lock update
jvendetti Jul 31, 2023
5e6a8f4
use patched version of agraph v7.3.1
alexskr Aug 1, 2023
1f81bdb
unpin faraday gem
alexskr Aug 1, 2023
79104ab
A chnage to reference Analytics Redis from LinkedData block
mdorf Aug 7, 2023
9a57e53
Gemfile.lock update
mdorf Aug 7, 2023
656b3ac
Gemfile.lock update
alexskr Aug 8, 2023
ed14911
Gemfile.lock update
mdorf Sep 7, 2023
e1e0bf7
Merge staging for release
mdorf Sep 7, 2023
55ac1ca
Gemfile.lock update
mdorf Sep 8, 2023
020ca5d
Gemfile.lock update
alexskr Sep 13, 2023
3fef501
Merge branch 'develop'
alexskr Sep 13, 2023
ac798aa
use assert_operator instead of assert
alexskr Sep 13, 2023
04a6282
Merge remote-tracking branch 'upstream/master' into merge-to-upstream…
syphax-bouazzouni Oct 9, 2023
c626d5c
use local solr to pass the tests
syphax-bouazzouni Oct 10, 2023
4b45481
Merge branch 'development' into merge-to-upstream-v5.26.0
syphax-bouazzouni Oct 10, 2023
88e8399
fixed ncbo_ontology_archive_old_submissions error output
mdorf Nov 1, 2023
2861ee8
Gemfile.lock update
mdorf Nov 1, 2023
33cc9b4
Gemfile.lock update
mdorf Nov 2, 2023
7429289
Gemfile.lock update
mdorf Nov 2, 2023
bb93561
Gemfile update
alexskr Nov 8, 2023
a208272
Gemfile update
alexskr Nov 8, 2023
e8fa020
fixes to the analytics script and a new script to generate UA analyti…
mdorf Nov 14, 2023
6317dc4
Gemfile.lock update
mdorf Nov 14, 2023
c2a72db
Gemfile.lock update
mdorf Dec 10, 2023
ab43cdc
Gemfile.lock update
mdorf Dec 10, 2023
a659415
implemented the first pass at bmir-radx/radx-project#37
mdorf Dec 17, 2023
ad283a2
Gemfile.lock update
mdorf Dec 17, 2023
2331631
implemented the first pass at bmir-radx/radx-project#37
mdorf Dec 17, 2023
07107b1
set bundler version to be comptatible with ruby 2.7
alexskr Dec 19, 2023
9e5ea99
Merge remote-tracking branch 'upstream/master' into merge-to-upstream…
syphax-bouazzouni Dec 25, 2023
f314da7
Merge remote-tracking branch 'upstream/develop' into merge-to-upstrea…
syphax-bouazzouni Dec 25, 2023
bada7d2
refactor ontologies analytics job to handle the new google analytics …
syphax-bouazzouni Dec 27, 2023
08f5e42
add user analytics fetching the monthly user visits count
syphax-bouazzouni Dec 27, 2023
6f21df6
add page visits analytics fetching last month most visited pages
syphax-bouazzouni Dec 27, 2023
524abca
Merge branch 'development' into merge-to-upstream-v5.26.0
syphax-bouazzouni Dec 27, 2023
080629e
extract google analytics UA import code to a script to make current c…
syphax-bouazzouni Dec 27, 2023
1154c7c
add option to force submission archiving even if already archived
syphax-bouazzouni Dec 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Git
#.git
.git
.github
.gitignore
# Logs
log/*
Expand All @@ -8,3 +9,9 @@ tmp/*
# Editor temp files
*.swp
*.swo
coverage
create_permissions.log
# Ignore generated test data
test/data/dictionary.txt
test/data/ontology_files/repo/**/*
test/data/tmp/*
42 changes: 42 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker Image CI

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: bioportal/ncbo_cron

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
RUBY_VERSION=2.7
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
5 changes: 2 additions & 3 deletions .github/workflows/ruby-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ on:
jobs:
test:
strategy:
fail-fast: false
matrix:
backend: ['ruby'] # ruby runs tests with 4store backend and ruby-agraph runs with AllegroGraph backend
backend: ['ncbo_cron'] # ruby runs tests with 4store backend and ruby-agraph runs with AllegroGraph backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: copy config.rb file from template
run: cp config/config.rb.sample config/config.rb
- name: Build docker-compose
working-directory: ./test
run: docker-compose build
- name: Run unit tests
working-directory: ./test
run: |
ci_env=`bash <(curl -s https://codecov.io/env)`
docker-compose run $ci_env -e CI --rm ${{ matrix.backend }} bundle exec rake test TESTOPTS='-v'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ config/config.rb
config/appliance.rb
config/config_*.rb
config/*.p12
config/*.json
data/
projectFilesBackup/
.ruby-version
repo*
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ COPY Gemfile* *.gemspec /srv/ontoportal/ncbo_cron/

WORKDIR /srv/ontoportal/ncbo_cron

# set rubygem and bundler to the last version supported by ruby 2.7
# remove version after ruby v3 upgrade
RUN gem update --system '3.4.22'
RUN gem install bundler -v '2.4.22'
RUN gem update --system
RUN gem install bundler
ENV BUNDLE_PATH=/srv/ontoportal/bundle
RUN bundle install

COPY . /srv/ontoportal/ncbo_cron
RUN cp /srv/ontoportal/ncbo_cron/config/config.rb.sample /srv/ontoportal/ncbo_cron/config/config.rb

CMD ["/bin/bash"]
15 changes: 10 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ source 'https://rubygems.org'

gemspec

gem 'faraday', '~> 1.9'
gem 'ffi'

# This is needed temporarily to pull the Google Universal Analytics (UA)
# data and store it in a file. See (bin/import_google_ua_analytics_data)
# The ability to pull this data from Google will cease on July 1, 2024
gem "google-apis-analytics_v3"

gem 'google-analytics-data'
gem 'mail', '2.6.6'
gem 'minitest', '< 5.0'
gem 'multi_json'
gem 'oj', '~> 2.0'
gem 'oj', '~> 3.0'
gem 'parseconfig'
gem 'pony'
gem 'pry'
Expand All @@ -21,13 +25,14 @@ gem 'request_store'
# Monitoring
gem 'cube-ruby', require: 'cube'

gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development'
gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'master'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'master'
gem 'ontologies_linked_data', github: 'ontoportal-lirmm/ontologies_linked_data', branch: 'development'
gem 'ontologies_linked_data', github: 'ontoportal-lirmm/ontologies_linked_data', branch: 'master'
gem 'ncbo_annotator', github: 'ontoportal-lirmm/ncbo_annotator', branch: 'master'
# Testing
group :test do
gem 'email_spec'
gem 'minitest', '< 5.0'
gem 'simplecov'
gem 'simplecov-cobertura' # for codecov.io
gem 'test-unit-minitest'
Expand Down
87 changes: 50 additions & 37 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: 9aa0ccacc9d76bff096218e6d48edc5b0bffd54f
branch: development
revision: 03da25b671d2ffa515b5dce51c6bd35980ae60c7
branch: master
specs:
goo (0.0.2)
addressable (~> 2.8)
Expand All @@ -26,8 +26,8 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git
revision: 1cfaf4482b7bf8c9001f0ff309f2a0ff06f683b5
branch: development
revision: e98b884999e5ce917a8be5fdc37f7b4797a1559e
branch: master
specs:
ontologies_linked_data (0.0.1)
activesupport
Expand Down Expand Up @@ -60,7 +60,7 @@ PATH
ncbo_cron (0.0.1)
dante
goo
google-apis-analytics_v3
google-analytics-data
mlanett-redis-lock
multi_json
ncbo_annotator
Expand All @@ -76,7 +76,9 @@ GEM
multi_json (~> 1.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.2.0)
bcrypt (3.1.20)
bigdecimal (3.1.5)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
builder (3.2.4)
Expand All @@ -85,38 +87,36 @@ GEM
connection_pool (2.4.1)
cube-ruby (0.0.3)
dante (0.2.0)
debug_inspector (1.1.0)
debug_inspector (1.2.0)
declarative (0.0.20)
docile (1.4.0)
domain_name (0.6.20231109)
email_spec (2.1.1)
htmlentities (~> 4.3.3)
launchy (~> 2.1)
mail (~> 2.6)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday-net_http (3.0.2)
faraday-retry (2.2.0)
faraday (~> 2.0)
ffi (1.16.3)
gapic-common (0.21.1)
faraday (>= 1.9, < 3.a)
faraday-retry (>= 1.0, < 3.a)
google-protobuf (~> 3.18)
googleapis-common-protos (>= 1.4.0, < 2.a)
googleapis-common-protos-types (>= 1.11.0, < 2.a)
googleauth (~> 1.9)
grpc (~> 1.59)
google-analytics-data (0.4.0)
google-analytics-data-v1beta (>= 0.7, < 2.a)
google-cloud-core (~> 1.6)
google-analytics-data-v1beta (0.10.0)
gapic-common (>= 0.20.0, < 2.a)
google-cloud-errors (~> 1.0)
google-apis-analytics_v3 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.2)
Expand All @@ -128,15 +128,29 @@ GEM
retriable (>= 2.0, < 4.a)
rexml
webrick
google-cloud-env (2.0.1)
google-cloud-core (1.6.1)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (2.1.0)
faraday (>= 1.0, < 3.a)
googleauth (1.9.0)
google-cloud-errors (1.3.1)
google-protobuf (3.25.1-x86_64-darwin)
googleapis-common-protos (1.4.0)
google-protobuf (~> 3.14)
googleapis-common-protos-types (~> 1.2)
grpc (~> 1.27)
googleapis-common-protos-types (1.11.0)
google-protobuf (~> 3.18)
googleauth (1.9.1)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.0, >= 2.0.1)
google-cloud-env (~> 2.1)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.60.0-x86_64-darwin)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
htmlentities (4.3.4)
http-accept (1.7.0)
http-cookie (1.0.5)
Expand Down Expand Up @@ -164,10 +178,10 @@ GEM
mlanett-redis-lock (0.2.7)
redis
multi_json (1.15.0)
multipart-post (2.3.0)
net-http-persistent (2.9.4)
netrc (0.11.0)
oj (2.18.5)
oj (3.16.3)
bigdecimal (>= 3.0)
omni_logger (0.1.4)
logger
os (1.1.4)
Expand All @@ -186,7 +200,7 @@ GEM
addressable (>= 2.2)
redis (5.0.8)
redis-client (>= 0.17.0)
redis-client (0.19.0)
redis-client (0.19.1)
connection_pool
representable (3.2.0)
declarative (< 0.1.0)
Expand Down Expand Up @@ -238,22 +252,21 @@ GEM

PLATFORMS
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
binding_of_caller (~> 1.0)
cube-ruby
email_spec
faraday (~> 1.9)
ffi
goo!
google-analytics-data
google-apis-analytics_v3
mail (= 2.6.6)
minitest (< 5.0)
multi_json
ncbo_annotator!
ncbo_cron!
oj (~> 2.0)
oj (~> 3.0)
ontologies_linked_data!
parseconfig
pony
Expand Down
Loading