Commit Graph

193 Commits

Author SHA1 Message Date
Ales Raszka
f326b6f664 Use PotentialNamespace in ancestry
If PotentialNamespace is available for given feature it is used instead
of detector namespace. Detector is empty in such a case.
2019-03-14 17:29:41 +01:00
Sida Chen
2d1ac2c4d5 update 2019-03-12 22:23:30 -04:00
Sida Chen
0731df972c pgsql: Remove unused test code
- Tests in complex_test.go are now in corresponding test files.
- Pgsql_test is partially moved to testutil/testdb.go
2019-03-12 22:23:30 -04:00
Sida Chen
dfa07f6d86 pgsql: Move notification to its module 2019-03-12 22:23:30 -04:00
Sida Chen
921acb26fe pgsql: Split vulnerability.go to files in vulnerability module 2019-03-12 22:23:30 -04:00
Sida Chen
7cc83ccbc5 pgsql: Split ancestry.go to files in ancestry module 2019-03-12 22:23:30 -04:00
Sida Chen
497b79a293 pgsql: Add test for migrations 2019-03-12 22:23:30 -04:00
Sida Chen
ea418cffd4 pgsql: Split layer.go to files in layer module 2019-03-12 22:23:30 -04:00
Sida Chen
176c69e59d pgsql: Move namespace to its module 2019-03-12 22:23:30 -04:00
Sida Chen
98e81ff5f1 pgsql: Move keyvalue to keyvalue module 2019-03-12 22:23:30 -04:00
Sida Chen
ba50d7c626 pgsql: Move lock to lock module 2019-03-12 22:23:30 -04:00
Sida Chen
0b32b36cf7 pgsql: Move detector to pgsql/detector module 2019-03-12 22:23:30 -04:00
Sida Chen
c50a2339b7 pgsql: Split feature.go to table based files in feature module 2019-03-12 22:23:30 -04:00
Sida Chen
43f3ea87d8 pgsql: Move batch queries to corresponding modules 2019-03-12 22:23:30 -04:00
Sida Chen
a33050637b pgsql: Move extra logic in pgsql.go to util folder
- pgsql/util/error.go contains error handling logic
- pgsql/page/page.go contains the page struct
- pgsql/monitoring contains the prometheus logic
- pgsql/pgsession contains the pgsession struct
2019-03-12 22:23:30 -04:00
Sida Chen
8bebea3643 pgsql: Split testutil.go into multiple files
- assertion.go assertions used in pgsql tests
- data.go contains go representation of data.sql
- testdb.go contains test db/tx creation logic
- testutil.go contains misc other things
2019-03-12 22:23:30 -04:00
Sida Chen
3fafb73c4f database: Split models.go into different files each contains one model 2019-03-12 21:55:26 -04:00
Ales Raszka
d77dc0f0ae Use struct as a map key instead of string
String was used when Feature contains PotentialNamespace. Since it was
moved to LayerFeature we can use struct as map key instead of string.
2019-03-08 09:51:40 +01:00
Ales Raszka
a8a91379d9 Add test for potential namespace
Test verifies that potential namespace is stored in database and it can
be loaded back to structure.

The commit also fixes few typos and bugs.
2019-03-08 09:51:19 +01:00
Ales Raszka
60b0bd27fa Add namespace_id as constraints to layer_feature
If layer contains more than one potential namespace, features will be
created for each namespace. Layer_feature table now has to contains one
more constrains (namespace_id).
2019-03-07 11:22:54 +01:00
Ales Raszka
60ef726677 Move PotentialNamespace to LayerFeature
PotentialNamespace should be in LayerFeature instead of Feature struct.
Feature extractors were updated to return LayerFeature instead of
Feature.
2019-03-07 11:22:54 +01:00
Ales Raszka
44c4a6f3ce Store PotentialNamespace in database
PotentialNamespace is part of layer_feature table and it is also stored
in namespace table.
2019-03-07 11:22:32 +01:00
Ales Raszka
34c2d96b36 featurefmt: Extract PotentialNamespace
PotentialNamespace is feature namespace extracted while detecting
features in layer. It will server for special feature detector. The
current detectors return empty namespace.
2019-03-07 11:22:32 +01:00
Sida Chen
b3fe95e152
Merge pull request #724 from KeyboardNerd/ref
database: move db logic to dbutil
2019-03-06 15:25:04 -05:00
Sida Chen
1b9ed99646 database: Move db logic to dbutil
Move all transaction related logic to dbutil to simplify and later unify
the db interface.
2019-03-06 15:22:21 -05:00
Sida Chen
b03f1bc3a6 pgsql: Fix failed tests 2019-03-06 13:44:23 -05:00
Sida Chen
ed9c6baf4f pgsql: Fix pgsql test 2019-03-06 11:32:25 -05:00
Sida Chen
046b0e49d1 Add missing licenses 2019-03-05 11:42:59 -05:00
Jimmy Zelinskie
4fa03d1c78
Merge pull request #723 from jzelinskie/lock-tx
database: make locks SOI & add Extend method
2019-02-28 15:59:58 -05:00
Jimmy Zelinskie
961c7d4680 database: add test for lock expiration 2019-02-28 15:54:57 -05:00
Jimmy Zelinskie
a4e7873d14 database: make locks SOI & add Extend method 2019-02-28 15:46:31 -05:00
Sida Chen
f7e54c1a28
Merge pull request #695 from saromanov/fix-unchecked-error
pgsql: fix unchecked error
2019-02-27 13:05:52 -05:00
Sida Chen
5bf8365f7b pgsql: Prevent inserting invalid entry to database 2019-02-26 10:26:49 -05:00
Sida Chen
8aae73f1c8 pgsql: Remove unnecessary logs 2019-02-26 10:26:49 -05:00
Sida Chen
5b2376498b clair: Use builder pattern for constructing ancestry
- Add Ancestry builder
- Change RPC to use the ancestry builder
2019-02-26 10:26:49 -05:00
Sida Chen
73bc2bc36b
Merge pull request #672 from KeyboardNerd/source_package/feature_type
Implement Feature types
2019-02-20 15:58:50 -05:00
Sida Chen
5a94499fdb update according to comments 2019-02-19 17:57:38 -05:00
Sida Chen
79af05e67d pgsql: Fix postgres queries for feature_type 2019-02-19 16:48:42 -05:00
Sida Chen
5fa1ac89b9 database: Add StorageError type 2019-02-19 16:48:42 -05:00
Sida Chen
073c685c5b pgsql: Add proper tests for database migration 2019-02-19 16:48:42 -05:00
Sida Chen
f61675355e database: Update feature model
Remove source name/version fields
Add Type field to indicate if it's binary package or source package
2019-02-19 16:48:42 -05:00
Sida Chen
7dd989c0f2 database: Rename affected Type to feature type 2019-02-19 16:48:42 -05:00
Sida Chen
00eed77b45 database: Add feature_type database model 2019-02-19 16:48:42 -05:00
Sida Chen
c6c8fce39a pgsql: Add feature_type to initial schema
feature_type is for differentiating the binary packages and source
packages.
2019-02-19 16:43:35 -05:00
Jimmy Zelinskie
cafe0976a4
Merge pull request #685 from jzelinskie/updater-cleanup
updater: remove FindLock(), use errgroup to avoid races
2019-02-14 14:57:59 -05:00
Jimmy Zelinskie
dd91597f19 database: remove FindLock from mock 2019-02-14 14:27:29 -05:00
Sergey
a57d806717
pgsql: fix unchecked error 2019-01-21 17:57:52 +05:00
Ales Raszka
015a79fd5a Layer: replace arrays with slices
The current code is much cleaner because it doesn't use indexes + it
should be more memory efficient.
2019-01-16 09:12:34 +01:00
Ales Raszka
90f5592095 Feature: replace arrays with slices
The current code is much cleaner because it doesn't use indexes + it
should be more memory efficient.
2019-01-16 09:12:33 +01:00
Jimmy Zelinskie
399deab100 database: remove FindLock() 2019-01-10 13:50:46 -05:00