Commit Graph

2462 Commits

Author SHA1 Message Date
Ahmed Sayed
949cd8cd8b Feature/speedup quota tests (#1125)
* reduce the number of created entities in tests

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed tests

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* merged master

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* adapted target count

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed RolloutManagementTest

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed flaky test ConcurrentDistributionSetInvalidationTest

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>
2022-02-21 12:58:05 +01:00
Peter Vigier
44a85f20eb Feature/fix sonar warnings (#1226)
* Fixed sonar warnings

- "Cognitive Complexity"
- "Do not use replaceAll when not using a regex"
- java:S5869 - Character classes in regular expressions should not contain the same character twice
- Improved bad name
- Typos
- reduced code duplications
- Replaced hand-made wait-utility with Awaitility
- Log messages
- Duplicate code
- Typos
- Removed Thread.sleep, instead relaxed check condition
- Removed use of deprecated API
- Removed use of deprecated API
- Added supress-warnings as I do not see a better way to write the tests
- Removed Thread.sleep / redundant functionality to Awaitility
- Fixed other warnings (use isZero, isEmpty, hasToString)
- Removed/Reduced duplicate code
- Added generics
- Fixed asserts
- removed: field.setAccessible(true) actually should not be needed for public static fields!
- Too long constructor passes arguments in wrong order - how surprisingly...
- Clean-up use of varargs arguments
- Fixed regex
- Fixed typos and other minor stuff
- Making public constructors protected in abstract classes
- Swapped expected and asserted argument
- volatile not enough for syncing threads
- volatile not enough for syncing threads
- out-commented code
- Made regex not-greedy, added tests for verification
- Avoid exposure of thread-local member var

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Fixed Sonar warnings

* License header fix

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* License header fix #2

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Fixing review findings

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Fixing tests

- Fixed '&' usage in javadoc and typos
- Fixing some warnings

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>
2022-01-31 21:59:46 +01:00
Bondar Bogdan
5443b5df9c Updated migration guide to include deprecated property (#1225)
* updated m7 migration to include spring boot deprecated property

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* fixed hawkbit sandbox link

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2022-01-31 11:40:39 +01:00
Robert Sing
cc3d36e442 set the JpaControllerManagement constructor public (#1227)
Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2022-01-31 11:36:13 +01:00
Natalia Kislicyn
69e6488004 DDI API: /controller/v1/{controllerid}/installedBase/{actionId} (#1220)
* installedBase DDI: initial impl + rest docs

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* refactor installedBase implementation

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* ddi installed base tests

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* restructure root controller rest docs

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix some java docs and formatting

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* don't add action history message when calling /installedBase

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix test after removing action history message

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix review comments

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix review comments

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2022-01-24 18:13:03 +01:00
Natalia Kislicyn
7a1905cf5b add license header for Bosch.IO 2022 (#1221)
Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2022-01-18 11:46:22 +01:00
Natalia Kislicyn
94d9e373b8 fix distribution set tag api doc (#1219)
Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2022-01-13 10:21:39 +01:00
Stefan Klotz
476d1c37ed Make entity object of event optional (#1209)
* explicitly return an optional entity by an event

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* fix assertions in tests

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>
2021-12-08 11:28:01 +01:00
Bondar Bogdan
7cc89d6291 added same origin x-frame-options header security config (#1207)
Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-12-06 10:08:45 +01:00
Bondar Bogdan
146735012a Artifact Encryption plug point (#1202)
* added ArtifactEncryption interface, injected it into SM creation UI module, added encryption metadata key generation upon SM creation, used encryptor during file upload

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* add default artifact encryption implementation based on gcm aes algorithm

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* changed ArtifactEncryptor interface to manage encryption secrets by itself

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* cleaned up stale code, fixed sonar

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* fixed software module encryption within transaction

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added artifact encryption secrets store

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* extended ArtifactEncryption interface to allow decryption, secrets store provides removeSecret, added missing javadocs

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* intriduced DbArtifact interface, use EncryptionAwareDbArtifact for artifact decryption during download

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* introduced ArtifactEncryptionService to minimize duplications and unneccessary dependency injections

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* declared ArtifactEncryptionService as a bean

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added persistant encryption flag to software module

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* further adptations for encryption flag persistence

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added ArtifactEncryptionException, fixed encryption check in UI

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added encryption error handling

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added encrypted flag to DDI/DMF, adapted exception handling

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* adapted rest docs

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* Add test to verify artifact encryption is not given by default

Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>

* Add isEncrypted() to toString() of JpaSoftwareModule, fix typos

Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>

* Fix sql migration scripts

Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>

* Calculate encrypted artifact size by subtract encryption size overhead

Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>

* publish upload failed without waiting for interuption during UI file upload

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* upgraded cron utils to 9.1.6

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

Co-authored-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>
2021-11-18 09:07:05 +01:00
Florian Ruschbaschan
7e28fba104 Use an empty AMQP Message body instead of a null value (#1200) 2021-11-03 13:15:47 +01:00
Natalia Kislicyn
3d35ff5aef mention target type in docu (#1199)
Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-11-03 13:13:37 +01:00
Robert Sing
f6c39a3589 fixed compatibility check bug (#1198)
* fixed compatibility check bug & improved testing

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review finding

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* reduced amount of targets in test

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2021-10-29 14:15:16 +02:00
Michael Gilroy
ae4fb5fe00 Remove mysql_user and update documentation (#1139)
* Remove mysql_user and update documentation

* MG, udpate based on maintainers feedback

* Remove extra comments for password, already in doc
2021-10-28 17:24:42 +02:00
Anand Kumar
70779d1ac7 Feature target type filter (#1197)
* Added Target type filter with drag and drop support

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Removed the unused enums and target type filter button class

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Resolved merge conflicts

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed java doc issue with the method link in the comment

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed the IN query overflow for target Type assignment

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed Review comments

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>
2021-10-27 15:24:09 +02:00
Robert Sing
dea6fa3ce6 Adapt UI for target type compatibility check (#1189)
* Added compatibility calls needed for UI

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* Adapted UI for target type compatibility checks

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* improved exception handling for incompatibility check

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* added & fixed unit tests

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed merged conflicts

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed target type incompatibly specification

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* changed UI behaviour to close assignment popup in case of IncompatibleTargetTypeException

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* added unit test to validate incompatibly specification fix

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review findings

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review findings

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fix potential null pointer

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* Fixed rolloutcopy by adding dsTypeId to ProxyDistributionSetInfo

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* suppressed warning

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2021-10-22 16:23:25 +02:00
Bondar Bogdan
f94b4430e0 added Insufficient Permissions UI error extractor (#1196)
Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-10-21 15:47:31 +02:00
Alexander Dobler
3621015f93 Specification and BaseRepositotyProvider improvements (#1182)
* Introduce custom base repository factory bean

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Simplify ordered DS service call by using specs

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Annotate getBaseRepoType interface as FunctionalInterface

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Use CustomBaseRepositoryFactory instead of static BaseClass

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Fix license headers

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Add ordered specification back

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>
2021-10-21 15:46:13 +02:00
Virginijus Kandrotas
d80d0d6349 Implement target type CRUD UI operations (#1184)
* implement target type CRUD UI operations

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix licenses

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* code clean up

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* code clean up

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* refactor proxy target type

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* refactor proxy target type

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* update class description

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix sonar issue

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix sonar issue

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix sonar issue

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix showing assigned ds types

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* remove unused import

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>
2021-10-21 15:18:39 +02:00
Natalia Kislicyn
d5661d2fe2 Support keywords in queries (#1193)
* support targettype as keyword in target-queries

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* support valid as keyword in distributionset-queries

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* remove targettype.id from filter queries

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* remove targettype.description from filter queries

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-10-20 13:13:24 +02:00
Markus Block
be3dfbf617 Ensure a '.' character is allowed to be used in target filter query for metadata key and attribute name (#1186)
* Adapted code to allow '.' inside of metadata key and attribute names


Signed-off-by: Markus Block <markus.block@bosch-si.com>

* added handling of corner cases

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* Adapted metadata and attribute tests to check that dot is allowed

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed documentation

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* Allow usage of dot in key names for every map attribute, e.g. also for
metadata in distribution set

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed typo

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* adapted test key to ensure a dot can be used

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed typo

Signed-off-by: Markus Block <markus.block@bosch-si.com>
2021-10-18 10:51:04 +02:00
Natalia Kislicyn
998518d8e0 fix api doc tests in regard to type compatibility (#1191)
Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-10-18 10:49:33 +02:00
Natalia Kislicyn
745a0c6a10 Docu for target type endpoints in Target API (#1185)
* add assign/unassign type endpoints to target api docs

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix target type creation for api rest docs test

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix review comments: rename tests

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* adapt test to avoid failing when translated

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-10-15 16:22:20 +02:00
Bondar Bogdan
e5dbbbbc7b Vaadin security upgrade to 8.14.1 (#1188)
Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-10-15 15:48:18 +02:00
Robert Sing
76be812cf1 Feature - TargetType compatibility check (#1180)
* added targettype compatibility check in deployment

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* added targettype compatibility for autssignment

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* added / fixed tests for auto assignment compatibility check

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* adapted rollout creation to use JPA specifications for compatibility checks

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fix unit tests and javadoc

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fix copyright header

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review findings

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review findings

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* replaced validated-DS management calls

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* improved compatibility check in DeploymentManagementTest

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review findings

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2021-10-15 15:39:21 +02:00
Anand Kumar
39ccf65f2e Feature target with target type in UI (#1178)
* Added the target type combo box to add or update Target in UI

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed NPE for empty target type

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added target type option to target bulk upload

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added Target type filter

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added Named entity mapper for target type UI

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed review comments

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed sonar issues for serialization

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed Review comments

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed Bulk upload target type combo box

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>
2021-10-11 15:00:16 +02:00
Natalia Kislicyn
70d0fe879e Feature mass cancel running actions on ds invalidation (#1177)
* Extend DS invalidation dialog to include mass-cancellation of actions

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

add component id for cancelation type radio buttons

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* add infos about ds invalidation to UI documentation;
update UI images; add screenshot about ds invalidation

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix review findings

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* add link property to invalidation docu

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* Put invalidation counts into one object

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* add hint to invalidation dialog, that invalidation is unrepeatable

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* disable invalidate button if insufficient permission

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix auto assignment error with insufficient permission

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* implement permissions check for invalidation dialog

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* add update_target permission to api doc description

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-10-05 14:15:43 +02:00
Enrico Jorns
aaa023732e README.md: Add rauc-hawkbit-updater to the list of clients supporting hawkBit (#1181)
Also add the word 'demo' to the python variant to give a hint to not use
this for real-world applications.

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
2021-10-05 10:41:58 +02:00
Markus Block
56e4066f12 Feature invalidation of distribution sets [UI part] (#1176)
* Visualization of action/button invalidate DistributionSet

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* introduced two dialogs to confirm ds invalidation

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed dialog titles appear centered and added manamgement classes

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* retrieving affected entities from repository

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* considered multiselection for invalidating dist sets

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* adapt style and tooltip of invalid distributions in grid

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* showing errors for actions not allowed for invalidate DS

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* enhanced error message with dist name and version

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* added ids to the labels to be used in tests

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* added support for overwriting entity specific edit behaviour

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* Fixed incorrect label for cancelled action due to invalidation of ds in
a rollout

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* Fixed error notification to not show "please try again" for an invalid
DS

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed typo

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed Sonar findings

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* remove DS of a copied Rollout in case the DS is invalidated

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* changed icon of RolloutActionStatus in case of stopped Rollout because
of invalidation of DS and DS wasn't yet assigned to target. This is to
distinguish from the case of not assigned DS because of duplicate DS
assignemnt

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* Prevent editing Metadata of invalid DS

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* show DS as invalidated in Rollout view

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* incorporated code review remarks

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* invalidated DS should be removed from the list of DS to be invalidated

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed missing code due to merge

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* Fixed compile error due to rebase

Signed-off-by: Markus Block <markus.block@bosch-si.com>
2021-10-01 16:15:05 +02:00
Sebastian Firsching
825cb64448 Introduce basic functionality for invalidation of distributionsets (#1179)
* Basic DS invalidation functionality

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Add checks for valid/complete DS

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Stop rollouts + auto assignments when invalidating a DS

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Add methods to count AAs + rollouts for invalidation

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Small refactoring for DS management

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Add invalidation functionality to REST API

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Fix update stopped rollouts status

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Add various tests

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Introduce countActionsForInvalidation

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Fix event tests with incomplete DS

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Add H2 migration script

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Fix action count method

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Fix REST documentation tests

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Change flyway version number

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Add lock for DS invalidation + adapt tests

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Move concurrency test to own class

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Handle possible InterruptedException

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Fix concurrency test

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Use one transaction for all invalidations

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Add invalidate endpoint to REST docu

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Execute invalidation in transaction when actions are cancelled

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Check that distribution set is valid when editing/creating metadata

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Remove all changes in UI

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Add DB migration files for all databases

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Implement review findings

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Move DS invalidation to own class to check permissions for single steps

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Move invalidation count methods to management classes

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>

* Fix failing tests

Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>
2021-09-30 15:26:36 +02:00
Diego Rondini
b25e118e6c README: add mention to Hara and hara-ddiclient (#1173)
Add a mention to the Eclipse Hara project and the hara-ddiclient library
that has been pushed recently to the Eclipse Foundation repositories.
Rework a bit the text to reflect this change.

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
2021-09-16 17:31:40 +02:00
Natalia Kislicyn
ec8b4b27b3 Test: max DS Types per TargetType (#1175)
* add dsTypes in targetType quota test

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix review findings

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-09-13 13:27:39 +02:00
Natalia Kislicyn
b5fcb48ab1 Colour property in Mgmt API response for DS/SM type (#1174)
* Update name SP to hawkbit in api guide adocs

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix javadoc class descriptions of existing resource/api classes

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* Add color property to api response of ds/sw type

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* Add color property to sw type test data & adapt rest docu

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* Add missing property description for "colour" and "deleted"

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix review findings

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-09-02 10:09:17 +02:00
Bondar Bogdan
42b1fc9439 fix null pointer exception in rsql target field validation test (#1172)
Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-08-30 20:17:52 +02:00
Bondar Bogdan
87199937c4 Dependency upgrades (#1170)
* Increase jsoup version

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* bumped vaadin/guava/common-io to newest versions

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* substituted deprecated guava create temp dir method

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-08-30 15:39:23 +02:00
Bondar Bogdan
20388e48f8 Fix sonar/repository for target type (#1169)
* fix sonar/repository for target type changes

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* review finding

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-08-25 14:43:10 +02:00
Anand Kumar
3fa1dd1be4 Feature target type entity (#1162)
* Added Target Type model

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added Target Type JPA model

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added Target Type repository model classes

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Removed the name entity from Target Type

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Refactored the Target Type models

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added the DB migration script and updated the Target Type models

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added target type in target Mapper

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Changed the target type ID to Long

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added MYSQL DB migration script and removed the deleted column for target type

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Updated the DB migration script for target table

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added manyToMany reltation between target type and Ds type

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added POSTGRESQL DB migration script

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added MSSQL SERVER DB migration script

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added DB2 DB migration script

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added missing license header and java docs

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added on delete cascade in DB migration script

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added Target Type specification

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Removed the delete cascade and Added type API
Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* fixed API doc build

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added target type management test

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added target type events test

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added target type update and unassign to target

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added API tests for assigning target type to target

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added missing license header

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added missing docs

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed sonar issues

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed license header build issue

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Updated the attribute name to target type

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed the review comments

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Removed unused error status variable

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added target API to assign target type

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Added the tests for assigning target type to target

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed the review comments for null check

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>
2021-08-25 12:13:27 +02:00
Robert Sing
2574581b2c Feature/enforce hash validation for uploads (#1158)
* moved artifact duplication check after hash check

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* added unit tests

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed copyright header

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review finding

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2021-08-05 14:53:36 +02:00
Alexander Dobler
101401a6a8 Align target queries to only use specifications (#1148)
* Add additional specifications to cover use cases of queries

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Replace reading target queries by spec, use empty spec in default repo calls

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Use correct NonNull annotation

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Added default exists based on spec count to TargetRepository

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>
2021-08-04 17:47:23 +02:00
Alexander Dobler
8c0bd2ffd2 Replace NoCountPagingRepository by interface with dedicated findAllWithoutCount (#1146)
* Replace NoCountPagingRepository by enhanced BaseRepository

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Add missed withoutcount call in distributionsettype find all

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Add missing overrides to NoCountRepository implementation

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Remove need of repository by referencing base class directly in configuration

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>
2021-08-04 17:46:31 +02:00
Florian Ruschbaschan
df84047e5d Set key of DistributionSetType and SoftwareModuleType required (#1140)
Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>
2021-08-02 17:49:57 +02:00
Bondar Bogdan
98535c96b4 Optional controller attributes for THING_CREATED (#1154)
* added optional attributes payload to THING_CREATED DMF message

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added optional attributes unit test for THING_CREATED message handler

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* extended Target interface with getControllerAttributes method, extended DMF message handler integration tests

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* updated hawkbit docs

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* fixed review findings

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-08-02 17:45:48 +02:00
Bondar Bogdan
ace2f00742 View-scoped event listeners (#1134)
* added UI EntityNotFound error details extractor

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* changed Target count label to not rely on grid data change events but rather on EntityModified UI events to decide how to react dependand on the event type

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added current view check on entity modified events

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* unsubscribe/resubscribe event listeners on view leave/enter, reselect grid entities on view enter

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* fixed target grid count reset on initial load and after view change

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* re-evaluate filters on Deployment View enter

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added on view enter logic for rest of the views

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* introduced event listener aware layout and view, adapted code accordingly

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* fixed bulk upload

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added missing docs

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* adapted software module deselection upon master entity change

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* fixed npe in case master support is not present (Artifact View)

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* restructured amqp assignDistributionSetMultipleTimes test

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added waiting for the messages to be dispached by test

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-07-22 11:00:05 +02:00
Stefan Behl
1a285849e6 Make RSQL visitor pluggable via a managed bean (#1145)
* Add a managed bean for a RsqlVisitorFactory

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>

* Fix failing unit tests

* Fix Sonar findings

* Fix PR review findings
2021-07-22 09:41:06 +02:00
Shruthi Manavalli Ramanna
c37c615ea6 Feature/handle amqp fatal errors (#1111)
* Adding support to handle lengthy error msgs more precisely

Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>

* Added check at conditionalHandler level and changes assertions in test class

Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>

* Fixed sonar lint issues

Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>

* Reverted the change on making class final

Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>

* To trigger the circle-ci build and check

Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>

* Addressed last set of PR comments

Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>

* Fixe sonar issue for nullpointer dereference

Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>

* Handling null case explicitly

Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>
2021-07-20 09:59:10 +02:00
Stefan Behl
a8f7f50cf9 Support case-insensitive RSQL expressions /target filters (#1137)
* Interpret /parse RSQL expressions case insensitive

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>

* Add unit test verifying that RSQL expressions are case insensitive

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>
2021-07-05 18:05:10 +02:00
Bogdan Bondar
4d5b2b3f71 suppressed functional interface sonar issue for MgmtBasicAuthRestApi
Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-07-02 19:57:51 +02:00
Michael Herdt
2bdab157cf Publish target assign event (#1136)
* Throw the TargetAssignDistributionSetEvent even if there are actions in CANCELING state present. Filter the actions on the receiver side. In this case at the DMF.

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Fix deploymentManagementTest

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Add debug logs and fix tests to verify correct DMF message behaviour

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Extend test case for the DMF in case the cancel is confirmed by the device

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Remove unsued import

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Fix review findings by filtering the list of targets first before querying the database for distribution set and software module.

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* flip list verification logic

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Refactor amqp tests

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
2021-07-02 19:50:04 +02:00
Anand Kumar
a71ab68330 Added userinfo endpoint to validate basic auth (#1131)
* Added userinfo endpoint to validate basic auth
* Fixed the bean exception for failing tests
* Added tests for userinfo endpoint with basic auth
* Added the missing license header

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>
2021-07-02 16:53:46 +02:00
Stefan Behl
2af4e850b8 Consider Target Fields when validating RSQL filters (#1121)
* Removed unnecessary DB queries when editing/validating RSQL query in Target Filter Management (#1023)

Added valid TargetFields to RSQL validation when editing Target Filter.

Signed-off-by: Sergey Gerasimov <sergey.gerasimov@devolo.de>

* Corrected visit OrNode implementation.

Changed isValid to receive FieldNameProvider as parameter

Reduced code duplication by moving commonly used utility methods to AbstractFieldNameRSQLVisitor from ValidationRSQLVisitor abd JpqQueryRSQLVisitor

Refactored and extended Unit Tests.

Minor corrections and typos.

Signed-off-by: Sergey Gerasimov <sergey.gerasimov@devolo.de>

* Added Maven entry for devolo 2020 copyright header.

Signed-off-by: Sergey Gerasimov <sergey.gerasimov@devolo.de>

* Fix failing unit tests

* # WARNING: head commit changed in the meantime

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>

* Fix Sonar findings.

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>

* Cleanup

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>

* Fix PR review findings

* Fix invalid queries in unit tests

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>

* Added test case to create filter with invalid query via Mgmt REST API

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>

Co-authored-by: Sergey Gerasimov <sergey.gerasimov@devolo.de>
2021-07-02 09:25:12 +02:00