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

Ccxdev 10244 #3

Closed
wants to merge 374 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
374 commits
Select commit Hold shift + click to select a range
a5c09fd
Renamed for better consistency
tisnik Nov 30, 2023
30df405
Noop DVO storage
tisnik Nov 30, 2023
f78642a
Stub for DVO recommendations storage
tisnik Nov 30, 2023
448c303
Renamed for better consistency
tisnik Nov 30, 2023
877e286
Renamed
tisnik Nov 30, 2023
338ff2d
Renamed constructor
tisnik Nov 30, 2023
8e82b57
Fixes
tisnik Nov 30, 2023
2d58df8
Merge pull request #1894 from tisnik/refactoring-ocp-recommendations-…
tisnik Nov 30, 2023
52558ea
Storage backends
tisnik Nov 30, 2023
91f3b22
Common storage interface
tisnik Nov 30, 2023
4587388
Preliminary support for two storages
tisnik Nov 30, 2023
456f6da
Fixed tests
tisnik Nov 30, 2023
219920e
Fixed warnings
tisnik Nov 30, 2023
9615dc5
Code prepared to support DVO storage when needed
tisnik Nov 30, 2023
181596a
Fixed typo
tisnik Nov 30, 2023
e8da9d9
Merge pull request #1895 from tisnik/mutiple-storage-types
tisnik Nov 30, 2023
5502452
Bump github.com/RedHatInsights/insights-operator-utils
dependabot[bot] Dec 1, 2023
b210ee7
Merge pull request #1896 from RedHatInsights/dependabot/go_modules/gi…
tisnik Dec 1, 2023
0fff277
Automatic decompression
tisnik Dec 1, 2023
838d9fb
Unit tests for the new code
tisnik Dec 1, 2023
97d9ebc
Fixed formatting
tisnik Dec 1, 2023
e391e2a
Added missing error checks
tisnik Dec 1, 2023
01671c8
Error checks
tisnik Dec 1, 2023
4342860
Merge pull request #1897 from tisnik/helper-for-decompress-message-au…
tisnik Dec 1, 2023
1cffc81
extend Storage interface to support database migrations in a more gen…
Bee-lee Dec 11, 2023
908c725
split OCP migrations into a separate module to decouple from more gen…
Bee-lee Dec 11, 2023
b5bf065
make migration module more generic, able to work with different storages
Bee-lee Dec 11, 2023
4e2e27f
add DVO migrations module which will contain DVO related migrations
Bee-lee Dec 11, 2023
cff0c2a
aggregator 'migrate' command now supports migrations for OCP and DVO …
Bee-lee Dec 11, 2023
abf90ee
add docstrings; remove unused func
Bee-lee Dec 11, 2023
e770216
lower coverage to 77% temporarily
Bee-lee Dec 11, 2023
8ad9b2b
mention task to support both storages at once (aggregator use case)
Bee-lee Dec 12, 2023
1928085
remove unneccessary var declaration
Bee-lee Dec 12, 2023
86b94eb
fix Redis initialization
Bee-lee Dec 12, 2023
95057db
Support multiple consumer types with configurable processing
epapbak Dec 12, 2023
43b8d41
Use private methods in MessageProcessor interface
epapbak Dec 12, 2023
140b006
allow the same connection for OCP and DVO storages in stage/prod
Bee-lee Dec 13, 2023
3058631
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Dec 13, 2023
9ab5e6b
Bump github.com/RedHatInsights/insights-operator-utils
dependabot[bot] Dec 13, 2023
2c7d027
clowder storage config update must not overwrite existing config fields
Bee-lee Dec 13, 2023
5d1f533
Adding temporary second Kafka lag in stage panel
joselsegura Dec 13, 2023
99b6615
Merge pull request #1908 from joselsegura/stage_dashboards
joselsegura Dec 13, 2023
0e1c221
Merge pull request #1907 from Bee-lee/dbily-dvo-storage-clowder
Bee-lee Dec 15, 2023
fff45b2
[CCXDEV-11589] Add clowdapp for dvo-writer (#1906)
juandspy Dec 18, 2023
bb95564
Add DVO rules consumer
epapbak Dec 12, 2023
2d39dc6
Add DvoMetrics field to incomingMessage
epapbak Dec 12, 2023
36cd97f
Use storage.Storage instead of storage.OCPRecommendationsStorage in K…
epapbak Dec 12, 2023
dbc5260
Implement DVORulesProcessor.deserializeMessage
epapbak Dec 12, 2023
4fb28fd
Move OCP processing-related methods to correct source file
epapbak Dec 12, 2023
8c1759b
More UTs for DVORulesProcessor.deserializeMessage
epapbak Dec 12, 2023
10f0cd0
Basic implementation of DVORulesProcessor.parseMessage
epapbak Dec 12, 2023
74e204d
Basic implementation of DVORulesProcessor.processMessage
epapbak Dec 12, 2023
969c777
use Sentry configuration (#1911)
juandspy Dec 18, 2023
5ecad64
Try to unzip incoming DVO-related messages when deserializing
epapbak Dec 18, 2023
f6ffcfa
Bump golang.org/x/crypto from 0.14.0 to 0.17.0
dependabot[bot] Dec 18, 2023
2849d91
Merge pull request #1915 from RedHatInsights/dependabot/go_modules/go…
tisnik Dec 19, 2023
2295c53
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Dec 19, 2023
88c17e1
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Dec 19, 2023
96eace9
Merge pull request #1901 from Bee-lee/dvo-migrations
Bee-lee Dec 19, 2023
1484397
fix ephemeral deployment (#1917)
juandspy Dec 19, 2023
be675fa
extend migration module to support multiple database schemas
Bee-lee Dec 19, 2023
afc4c31
modify storage module to work with new migration multiple-schema support
Bee-lee Dec 19, 2023
84b87de
support multiple-schema migration changes in main module
Bee-lee Dec 19, 2023
53591b3
add command to install shellcheck in macos (#1919)
juandspy Dec 21, 2023
bddb7c1
Remove references to SQLite3-based mock storage
epapbak Dec 13, 2023
4a36c9c
Remove SQLite database populatiopn script and Makefile target
epapbak Dec 18, 2023
f5cab80
Remove SQLite from storage package
epapbak Dec 18, 2023
c4e66bf
Remove SQLite references from aggregator_test.go
epapbak Dec 19, 2023
827a8dd
Remove SQLite references from conf package
epapbak Dec 20, 2023
39d05ec
Remove SQLite references from migration package
epapbak Dec 20, 2023
cee8cfa
Remove SQLite references after rebase
epapbak Dec 20, 2023
7cc66a2
Remove SQLite references from sql_hooks_test.go
epapbak Dec 20, 2023
753584e
Unify postgres connection variables for local dev and CI
epapbak Dec 20, 2023
2ce1364
Stop using SQLite in REST API tests
epapbak Dec 20, 2023
f57d492
Add basic unit tests for dvo_recommendations_storage to increase cove…
epapbak Dec 21, 2023
41eb551
Tidy go modules after cleanup
epapbak Dec 21, 2023
7c99bf8
Remove unit-sqlite option from make_coverage script
epapbak Dec 21, 2023
a3d9e76
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Dec 22, 2023
a0fa4e0
add #nosec G201 for new SQL strings formatting
Bee-lee Dec 22, 2023
7d715cf
Bump github.com/prometheus/client_golang from 1.17.0 to 1.18.0 (#1920)
dependabot[bot] Jan 2, 2024
ff0e668
Bump github.com/google/uuid from 1.4.0 to 1.5.0
dependabot[bot] Jan 2, 2024
1f39739
Add PG_PARAMS: "sslmode=disable" to test-dvo-writer.yaml (#1921)
juandspy Jan 2, 2024
240a50d
Merge pull request #1904 from RedHatInsights/dependabot/go_modules/gi…
joselsegura Jan 4, 2024
0236952
Update pr_check to deploy dvo-writer too
joselsegura Jan 4, 2024
f081e3e
Bump golang.org/x/sync from 0.5.0 to 0.6.0 (#1923)
dependabot[bot] Jan 5, 2024
5c7428d
Bump github.com/DATA-DOG/go-sqlmock from 1.5.0 to 1.5.2
dependabot[bot] Jan 8, 2024
a413bc2
Merge pull request #1918 from Bee-lee/dvo-migrations
Bee-lee Jan 8, 2024
92705cb
Merge pull request #1924 from RedHatInsights/dependabot/go_modules/gi…
joselsegura Jan 8, 2024
8e8a02f
extend migration module to create schema if not exits
Bee-lee Jan 8, 2024
f097d77
add UT for no single storage specified
Bee-lee Jan 8, 2024
c6996a4
extend 'migrate' and 'start-service' commands to support/create multi…
Bee-lee Jan 8, 2024
e38fdf5
DB writer now uses ocp_recommendations storage use
Bee-lee Jan 8, 2024
999eb76
fix empty schema when GetDBVersion is used without one
Bee-lee Jan 8, 2024
a94e88d
remove default storag backend behavior; remove nil reference
Bee-lee Jan 8, 2024
c9871a4
add metrics section to test config
Bee-lee Jan 8, 2024
36c1a1c
Bump github.com/RedHatInsights/insights-operator-utils (#1926)
dependabot[bot] Jan 10, 2024
e956b2b
Update pr_check.sh - add dvo-extractor too
matysek Jan 11, 2024
6198b19
Store bdd logs as artifacts (#1927)
juandspy Jan 11, 2024
47b0fa1
Update pr_check.sh use REF_ENV ephemeral.
matysek Jan 11, 2024
409b532
Update pr_check.sh - set temporarily ref_env insights-ephemeral
matysek Jan 11, 2024
9bc2f51
join cache-writer and db-writer in the same dashboard with support fo…
juandspy Jan 12, 2024
b32ea94
fix case when only one storage configuration is provided
Bee-lee Jan 15, 2024
c4b697a
add new storage config options to cache-writer and aggregator deploy …
Bee-lee Jan 15, 2024
1b153ce
fix typo
juandspy Jan 16, 2024
64beaa7
Update REF_ENV to stage
joselsegura Jan 16, 2024
dd8db5c
Merge branch 'pr_check_update' of github.com:joselsegura/insights-res…
Bee-lee Jan 16, 2024
327a23d
fix dvo-writer deployment missing OpenAPI spec
Bee-lee Jan 16, 2024
73d95d9
fix DVO writer deployment because OCP storage is needed to start the …
Bee-lee Jan 16, 2024
a7c07a0
use shared DB
juandspy Jan 16, 2024
016ff67
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Jan 16, 2024
9e1fc2e
Merge commit 'a7c07a077b063122f1087e914c4fa8c7be7c9462' of github.com…
Bee-lee Jan 16, 2024
8baebaf
[DVO] Use shared DB (#1930)
juandspy Jan 16, 2024
16e304c
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Jan 16, 2024
d525659
re-add OpenAPI path and OCP storage config to dvo-writer.yaml
Bee-lee Jan 16, 2024
e6fdc11
Don't stop the GH Action if the BDD tests step failed (#1931)
juandspy Jan 16, 2024
620a901
fix dvo-writer missing server port
Bee-lee Jan 17, 2024
79bd407
add the rest of server config options to dvo-writer because of readin…
Bee-lee Jan 17, 2024
63bdc19
add the rest of server config options to dvo-writer because of readin…
Bee-lee Jan 17, 2024
022c4de
Merge pull request #1925 from Bee-lee/dvo-migrations
Bee-lee Jan 17, 2024
6c71392
fix port (#1934)
juandspy Jan 17, 2024
fb7febd
enable sentry for dvo-writer (#1935)
juandspy Jan 18, 2024
b53269a
[CCXDEV-12342] Fix some SQL statements (#1932)
juandspy Jan 18, 2024
6a1e7ca
enable sentry for dvo-writer (main container) (#1936)
juandspy Jan 18, 2024
d6b64d7
check for nil pointers before logging (#1940)
juandspy Jan 19, 2024
000e5af
fix cache-writer not initializing redis storage because it's created …
Bee-lee Jan 19, 2024
38eb298
Merge pull request #1941 from Bee-lee/dvo-migrations
Bee-lee Jan 19, 2024
05d0364
add debug logs for dvo-writer DB prod issue
Bee-lee Jan 25, 2024
c7e7de5
Merge pull request #1943 from Bee-lee/dvo-server
Bee-lee Jan 25, 2024
48991bb
add debug logs for dvo-writer DB prod issue
Bee-lee Jan 25, 2024
1c8ee13
add debug logs for dvo-writer DB prod issue (#1944)
Bee-lee Jan 26, 2024
4c771b8
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Jan 26, 2024
2b26af4
do not initialize last_checked_at map if running as dvo-writer
Bee-lee Jan 26, 2024
8026710
Merge pull request #1945 from Bee-lee/dvo-server
Bee-lee Jan 26, 2024
4372c09
Generalisation of storage
Jan 31, 2024
c7ac2d4
add 1st DVO migration to create dvo.dvo_report table
Bee-lee Feb 1, 2024
d52ab0b
add 2nd DVO migration to create dvo_report related indexes + test all…
Bee-lee Feb 1, 2024
b4146fd
enable DVO migrations 0001 and 0002
Bee-lee Feb 1, 2024
3eea5b0
disable DVO migration test temporarily
Bee-lee Feb 1, 2024
52c688e
Merge pull request #1947 from Jakub007d/storage-generalisation
Jakub007d Feb 1, 2024
8f3b97e
Generalisation of storage
Jan 31, 2024
488bcf3
enable DVO migrations tests
Bee-lee Feb 5, 2024
ea6b5a1
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Feb 5, 2024
b6b92c5
fix typo
Bee-lee Feb 5, 2024
4be65f0
initialize test DVO storage
Bee-lee Feb 5, 2024
b6595de
always init DB schema for test DVO storage
Bee-lee Feb 5, 2024
9c368ea
add DVO db version to /info endpoint (#1949)
juandspy Feb 6, 2024
f707034
Merge remote-tracking branch 'origin/master' into dvo-server
joselsegura Feb 6, 2024
870f85f
Add DVO storage to Server
Feb 6, 2024
1080096
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Feb 6, 2024
674adf8
Merge branch 'dvo-server' of github.com:Bee-lee/insights-results-aggr…
Bee-lee Feb 6, 2024
de2c445
Merge pull request #1948 from Bee-lee/dvo-server
Bee-lee Feb 6, 2024
d5060ad
Merge branch 'RedHatInsights:master' into DVO-Storage
Jakub007d Feb 6, 2024
42ce5e2
Merge pull request #1953 from Jakub007d/DVO-Storage
Jakub007d Feb 6, 2024
e47e2ec
[CCXDEV-12475][dvo-writer] Parse DVO reports (#1954)
juandspy Feb 8, 2024
19a5443
CCXDEV-12474: start DVO consumer when running as dvo-writer
joselsegura Feb 5, 2024
de4c113
Adding a namespace to avoid metric name collisions
joselsegura Feb 5, 2024
46ff209
Force CI
joselsegura Feb 5, 2024
85a1278
Change error message
joselsegura Feb 5, 2024
397cb40
Temporarily decrease coverage threshold
matysek Feb 9, 2024
439aa40
Merge pull request #1952 from joselsegura/ccxdev-12474
matysek Feb 9, 2024
a65b7fb
[CCXDEV-12475] Insert workload recommendation in DB (#1955)
juandspy Feb 12, 2024
4b10cf0
[CCXDEV-12475[debug] Try to find the cause of a parse time error (#1956)
juandspy Feb 13, 2024
bf02fc0
Revert "[CCXDEV-12475[debug] Try to find the cause of a parse time er…
juandspy Feb 13, 2024
18e8427
Fix CCX Writers dashboard panel (#1959)
juandspy Feb 15, 2024
e7e68e1
use prod ref env for dvo-writer (#1960)
juandspy Feb 16, 2024
0b99362
Update cache-writer.yaml with a valid log stream (#1962)
juandspy Feb 16, 2024
766ca40
Support for multiple broker addresses
epapbak Feb 15, 2024
0032611
Make golangci-lint show only new issues
epapbak Feb 15, 2024
4dc6436
Update aggregator base images
joselsegura Feb 19, 2024
196dbe1
[CCXDEV-12529][dvo-writer] Use DELETE -> INSERT instead of upsert (#1…
juandspy Feb 20, 2024
4d9110c
Merge pull request #1964 from joselsegura/update_base_image
joselsegura Feb 20, 2024
a9a15de
Clean up the repeated unit tests execution mess
joselsegura Feb 20, 2024
b620f4e
Update setup-go action
joselsegura Feb 20, 2024
4184e04
Removing consumer tests
joselsegura Feb 20, 2024
09bc21b
Merge pull request #1966 from joselsegura/clean_unit_tests_execution
joselsegura Feb 21, 2024
880843e
Avoid running tests in master, as nobody is able to push directly to it
joselsegura Feb 21, 2024
4c092c8
Update build image to ubi9 (#1968)
joselsegura Feb 21, 2024
1eea9b0
fix DVO details field having a knonw structure (details contain rule …
Bee-lee Feb 25, 2024
3f4d7f6
add DVO-related types
Bee-lee Feb 25, 2024
c1400e0
add DVO-related endpoints
Bee-lee Feb 25, 2024
5ca8558
add handlers for new DVO endpoints
Bee-lee Feb 25, 2024
b0a741f
add storage part for new DVO related endpoints/handlers
Bee-lee Feb 25, 2024
79e9626
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Feb 25, 2024
6abda75
fix merge conflicts
Bee-lee Feb 25, 2024
748cf5d
add proper details section to the message for testing DVO consumer
Bee-lee Feb 25, 2024
3958b74
fix improper details type
Bee-lee Feb 25, 2024
d2f0218
Merge pull request #1969 from Bee-lee/dvo-endpoints-storage
Bee-lee Feb 26, 2024
60490c6
fix organization -> org_id param name
Bee-lee Feb 26, 2024
47dd3f1
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Feb 26, 2024
e5a5519
Merge pull request #1970 from Bee-lee/dvo-endpoints-storage
Bee-lee Feb 26, 2024
475fc1e
allow non-UUID namespace IDs
Bee-lee Feb 26, 2024
91797a5
Merge pull request #1971 from Bee-lee/dvo-endpoints-storage
Bee-lee Feb 27, 2024
e41847f
add debug log for DVO report unmarshalling error
Bee-lee Feb 27, 2024
98edfea
Merge pull request #1972 from Bee-lee/dvo-endpoints-storage
Bee-lee Feb 27, 2024
bce4203
fix wrongly encoded JSON string from the dvo.dvo_report.report column
Bee-lee Feb 27, 2024
77034c2
Merge pull request #1973 from Bee-lee/dvo-endpoints-storage
Bee-lee Feb 27, 2024
157f44d
fix improper JSON structure when retrieving dvo_report.report column
Bee-lee Feb 27, 2024
806581d
fix leftover log
Bee-lee Feb 27, 2024
3e9eb50
Merge pull request #1974 from Bee-lee/dvo-endpoints-storage
Bee-lee Feb 27, 2024
e907187
fix reported_at and last_checked_at mixup
Bee-lee Mar 4, 2024
21d616b
add check to DVO handlers test for non-zero length samples slice
Bee-lee Mar 4, 2024
ae50ab0
fix string -> timestamp type in DVO tests
Bee-lee Mar 4, 2024
2fe1c5f
Merge pull request #1975 from Bee-lee/fix-timetsamps-dvo
Bee-lee Mar 4, 2024
74d49d6
Merge pull request #1967 from joselsegura/remove_new_executions_on_ma…
joselsegura Mar 5, 2024
ea7b735
Bump github.com/google/uuid from 1.5.0 to 1.6.0 (#1942)
dependabot[bot] Mar 5, 2024
f39a8d1
Bump github.com/prometheus/client_model from 0.5.0 to 0.6.0 (#1963)
dependabot[bot] Mar 5, 2024
7b48421
Bump github.com/RedHatInsights/insights-operator-utils (#1958)
dependabot[bot] Mar 5, 2024
8dabc05
Bump github.com/stretchr/testify from 1.8.4 to 1.9.0
dependabot[bot] Mar 5, 2024
910004f
fix a case when we end up with 0 objects after filtering them from DV…
Bee-lee Mar 5, 2024
09ebc24
fix reported_at and last_checked_at mixed up in /dvo/namespaces
Bee-lee Mar 5, 2024
0d43254
Merge pull request #1979 from Bee-lee/fix-zero-workloads-after-filter
Bee-lee Mar 5, 2024
986b228
Update dvo_report table when empty report is received
epapbak Mar 4, 2024
ee0c536
Merge pull request #1980 from Bee-lee/fix-timestamps-dvo-namespaces
Bee-lee Mar 5, 2024
71e08e7
Print content of report received from dvo extractor for debug
epapbak Mar 5, 2024
1fa0d1a
Print the entire content of the report received from dvo extractor fo…
epapbak Mar 6, 2024
9d7ddab
Merge pull request #1978 from RedHatInsights/dependabot/go_modules/gi…
JiriPapousek Mar 6, 2024
ad16e68
fix wrong number of recommendations written by dvo-writer
Bee-lee Mar 6, 2024
99fd4b0
fix whitespace
Bee-lee Mar 6, 2024
f2b22c3
Merge pull request #1983 from Bee-lee/fix-timestamps-dvo-namespaces
Bee-lee Mar 7, 2024
dd0295e
Revert "Print the entire content of the report received from dvo extr…
epapbak Mar 7, 2024
1e3d53f
Revert "Print content of report received from dvo extractor for debug"
epapbak Mar 7, 2024
f67a519
Merge pull request #1984 from epapbak/revert_log_workload_contents
epapbak Mar 7, 2024
4864d5a
fix number of DVO objects per namespace; improve the main loop a bit
Bee-lee Mar 7, 2024
0a2c816
add reproducer for CCXDEV-12608
Bee-lee Mar 7, 2024
f1a69a1
Merge branch 'master' of github.com:RedHatInsights/insights-results-a…
Bee-lee Mar 7, 2024
dac0bda
remove unused vars: golint
Bee-lee Mar 7, 2024
0b4f423
Merge pull request #1985 from Bee-lee/fix-timestamps-dvo-namespaces
Bee-lee Mar 7, 2024
743f0d3
make sure a not found error is returned (#1986)
juandspy Mar 8, 2024
cf42bd4
[CCXDEV-12602] Add migration to delete buggy rows (#1987)
juandspy Mar 12, 2024
ffbd3fa
fix date (#1988)
juandspy Mar 12, 2024
59e6e41
Use go1.20 (#1991)
juandspy Mar 13, 2024
9a070ab
[CCXDEV-12378] Add dependabot-automerge.yml to automerge the dependab…
juandspy Mar 20, 2024
7805f12
Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0
dependabot[bot] Mar 20, 2024
cba56c9
Merge pull request #1977 from RedHatInsights/dependabot/go_modules/gi…
github-actions[bot] Mar 20, 2024
43bac53
Bump google.golang.org/protobuf from 1.32.0 to 1.33.0
dependabot[bot] Mar 20, 2024
b347b40
Merge pull request #1992 from RedHatInsights/dependabot/go_modules/go…
github-actions[bot] Mar 20, 2024
f0966bc
Bump github.com/spf13/viper from 1.16.0 to 1.18.2
dependabot[bot] Mar 20, 2024
dad8766
Merge pull request #1916 from RedHatInsights/dependabot/go_modules/gi…
github-actions[bot] Mar 20, 2024
1ab87a4
Spltting linters CI jobs
Apr 4, 2024
513e43b
Using matrix for ci
Apr 4, 2024
5b57ff8
Change name of ci job
Apr 4, 2024
41072b9
Bugfix
Apr 4, 2024
2eb459b
CI update
Apr 4, 2024
81396b7
Reverting back to steps
Apr 4, 2024
2d2ed1c
Merge pull request #1995 from Jakub007d/ci-update
Jakub007d Apr 4, 2024
4f924ea
Remove info from always expected fields in report
epapbak Apr 9, 2024
5a31a4b
Revert "Remove info from always expected fields in report"
epapbak Apr 9, 2024
bda336e
Remove info from always expected fields in report
epapbak Apr 9, 2024
0b0bb32
Add TestParseProperMessageNoInfoAttribute UT
epapbak Apr 9, 2024
282bfc7
Do not limit select query when retrieving rows already impacted
epapbak Jun 24, 2024
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
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates


version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
47 changes: 47 additions & 0 deletions .github/workflows/bdd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: BDD tests

on:
pull_request:

jobs:
bdd:
runs-on: ubuntu-20.04
strategy:
matrix:
go-version:
- "1.20"
name: BDD for Go ${{ matrix.go-version}}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Build project
run: make build
- name: Retrieve Docker compose file
run: wget -O docker-compose.yml https://raw.githubusercontent.com/RedHatInsights/insights-behavioral-spec/main/docker-compose.yml
- name: Retrieve BDD runner
run: wget -O bdd_runner.sh https://raw.githubusercontent.com/RedHatInsights/insights-behavioral-spec/main/run_in_docker.sh && chmod +x bdd_runner.sh
- name: Run BDD
run: ./bdd_runner.sh aggregator-tests .
- name: Set container ID as env
if: always()
run: echo "BDD_CONTAINER=$(docker ps | grep 'insights-behavioral-spec:latest' | cut -d ' ' -f 1)" >> $GITHUB_ENV
- name: Debug
if: always()
run: docker exec -u root "$BDD_CONTAINER" /bin/bash -c "ls -R /insights-behavioral-spec/logs"
- name: Copy logs from container to host
if: always()
run: docker cp "$BDD_CONTAINER:/insights-behavioral-spec/logs" .
- name: Rename logs
if: always()
# Otherwise the upload-artifact action will complain
run: for filename in logs/insights-results-aggregator/*; do mv -n "$filename" "$(echo "$filename" | sed -e 's/["><:]//g')"; done
- name: Store service logs
if: always()
uses: actions/upload-artifact@v3
with:
name: store-logs
path: |
logs/insights-results-aggregator
37 changes: 37 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Set as automatically merge all the pull requests created by dependabot[bot]
name: Dependabot auto-merge
on: pull_request

# This section adds write permissions to the secrets.GITHUB_TOKEN. Default is just read
permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Github Actions bot approves the PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: InsightsDroid approves the PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.INSIGHTSDROID_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
# We can filter depending on the semver major, minor, or patch updates,
# but let's not do it for now
# if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.18'
go-version: '1.20'
- name: Generate docgo and literate
run: make godoc
- name: Build with Jekyll
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
name: lint
Expand All @@ -31,9 +27,9 @@ jobs:
args: >
--enable=goimports,gosimple,nilerr,prealloc,revive,staticcheck,unconvert,unused,whitespace,zerologlint
--timeout=3m

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
only-new-issues: true

# Optional: if set to true then the action will use pre-installed Go.
# skip-go-installation: true
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/gotests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Go tests

on:
pull_request:

jobs:
gotests:
runs-on: ubuntu-20.04
strategy:
matrix:
go-version:
- "1.20"
- "1.21"
name: Tests for Go ${{ matrix.go-version}}
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: aggregator
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Print env vars
run: env
- name: Unit tests
run: make test
- name: Check code coverage
run: ./check_coverage.sh do-not-run-tests
- name: Display code coverage
run: make coverage
44 changes: 44 additions & 0 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Go linters

on:
pull_request:

jobs:
golint:
runs-on: ubuntu-20.04
strategy:
matrix:
go-version:
- "1.20"
- "1.21"
name: Linters for Go ${{ matrix.go-version}}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Build project
run: go build
- name: GO formatting
run: make fmt
- name: GO lint
run: make lint
- name: GO vet
run: make vet
- name: gocyclo
run: make cyclo
- name: shellcheck
run: make shellcheck
- name: errcheck
run: make errcheck
- name: goconst checker
run: make goconst
- name: gosec checker
run: make gosec
- name: ineffassign checker
run: make ineffassign
- name: ABC metrics checker
run: make abcgo
- name: JSON checker
run: make json-check
12 changes: 12 additions & 0 deletions .github/workflows/shellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Shell check

on:
pull_request:

jobs:
shellcheck:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Shell check
run: ./shellcheck.sh
69 changes: 0 additions & 69 deletions .travis.yml

This file was deleted.

15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM registry.redhat.io/rhel8/go-toolset:1.18.9-8.1675807488 AS builder
FROM registry.redhat.io/ubi9/go-toolset:1.20 AS builder

COPY . .

USER 0

# build the aggregator
RUN umask 0022 && \
make build && \
chmod a+x insights-results-aggregator
RUN umask 0022
ENV GOFLAGS="-buildvcs=false"
RUN make build
RUN chmod a+x insights-results-aggregator

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-1014
FROM registry.access.redhat.com/ubi9/ubi-micro:latest

COPY --from=builder /opt/app-root/src/insights-results-aggregator .
COPY --from=builder /opt/app-root/src/openapi.json /openapi/openapi.json

# copy the certificates from builder image
COPY --from=builder /etc/ssl /etc/ssl
COPY --from=builder /etc/pki /etc/pki

USER 1001

CMD ["/insights-results-aggregator"]
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL := /bin/bash

.PHONY: default clean build fmt lint vet cyclo ineffassign shellcheck errcheck goconst gosec abcgo json-check openapi-check style run test cover integration_tests rest_api_tests sqlite_db license before_commit help godoc install_docgo install_addlicense
.PHONY: default clean build fmt lint vet cyclo ineffassign shellcheck errcheck goconst gosec abcgo json-check openapi-check style run test cover integration_tests rest_api_tests license before_commit help godoc install_docgo install_addlicense

SOURCES:=$(shell find . -name '*.go')
BINARY:=insights-results-aggregator
Expand Down Expand Up @@ -90,10 +90,6 @@ rest_api_tests: ${BINARY} ## Run REST API tests
@echo "Running REST API tests"
@./test.sh rest_api

sqlite_db:
mv aggregator.db aggragator.db.backup
local_storage/create_database_sqlite.sh

license: install_addlicense
addlicense -c "Red Hat, Inc" -l "apache" -v ./

Expand Down
Loading
Loading