Ensure the field defaults to `true`, both in Java and the database. During upgrade, migrate all values that are currently `null` to `true`.
Solidify this change by switching `project.active` from `Boolean` to `boolean`. Adjust logic that previously had to check for `null`.
Fixes#4410
Signed-off-by: nscuro <nscuro@protonmail.com>
*Simplify Boolean to boolean in Project and Policy and remove unncessary migration script part
*Move reads into transaction
*remove unnecessary index
*Rename ONLY_FOR_LATEST_PROJECT_VERSION to ONLY_LATEST_PROJECT_VERSION
Signed-off-by: Ralf King <rkg@mm-software.com>
Adds regression test for #3895. The behavior itself does not reproduce on `master`, but does with `4.11.5`.
Wraps the project cloning in a transaction to make it more reliable. Adds MDC variables for `CloneProjectTask` (#3234).
Fixes#3895
Signed-off-by: nscuro <nscuro@protonmail.com>
In order for the UI to distinguish between active or inactive project versions,
we need to include the active boolean field to ProjectVersion model
Signed-off-by: Aravind Parappil <aravindparappil@gmail.com>
When creating a project from json payload and the active field is
not specified it will now default to true instead of null.
This fixes an issue with projects not being assignable as parent projects
because they are "inactive".
Signed-off-by: Willie Nel <4620380+willienel@users.noreply.github.com>
As per CycloneDX specification, `metadata.manufacturer` refers to `metadata.component`, whereas `metadata.supplier` and `metadata.authors` refer to the BOM itself.
Keeping `manufacturer` in `ProjectMetadata` is awkward and confusing.
Signed-off-by: nscuro <nscuro@protonmail.com>
Also fixed:
* services not being cloned, despite `includeServices` being set to `true`.
* ACLs not being enforced for the `/clone` endpoint
And added tests for cloning that were previously missing.
Signed-off-by: nscuro <nscuro@protonmail.com>
* Fix `NullPointerException` in ProjectQueryManager
Fixes the `NullPointerException` which occurs when updating a project
where `project.isActive() == null`
Signed-off-by: RBickert <rbt@mm-software.com>
* Prevent NullPointerException in NotificationRouter
Signed-off-by: RBickert <rbt@mm-software.com>
Signed-off-by: RBickert <rbt@mm-software.com>
* Added ProjectCreationNotification
Signed-off-by: Mark Zeman <zeman@puzzle.ch>
* Added test
Signed-off-by: Mark Zeman <zeman@puzzle.ch>
* Fixed mess after dealing with GitHub
Signed-off-by: Mark Zeman <zeman@puzzle.ch>
* And redo work lost due to that mess
Signed-off-by: Mark Zeman <zeman@puzzle.ch>
* Fixed broken tests
Signed-off-by: Mark Zeman <zeman@puzzle.ch>
* Fixed misunderstanding of createProjectTest
Signed-off-by: Mark Zeman <zeman@puzzle.ch>
Signed-off-by: Mark Zeman <zeman@puzzle.ch>
Closes#2173
* Implement new functionalities for treegrid
A project now serializes his ID and his parent ID into JSON.
It's now possible to get children Projects by tag and by classifier
Signed-off-by: RBickert <rbt@mm-software.com>
* Serialize `parentUuid` instead of `id` and `pid`
Signed-off-by: RBickert <rbt@mm-software.com>
* Add check for setting inactive parent
Signed-off-by: RBickert <rbt@mm-software.com>
* Adjust API for new vue-multiselect in frontend
Signed-off-by: RBickert <rbt@mm-software.com>
* Adjust `ProjectResourceTest` to updated API
Signed-off-by: RBickert <rbt@mm-software.com>
Signed-off-by: RBickert <rbt@mm-software.com>
Closes#84
* Refactor getTags for greater readability
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
* Rename method and clean up formatting
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
* Add docs to ProjectQueryFilterBuilder
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
* Add tests for ProjectQueryFilterBuilder
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
* Simplify method
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
* Simplify getComponents method
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
* Move copying from another alias into VulnerabilityAlias class
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
* Add missing newlines at eof
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
* Add back condition removed in refactoring
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
Fetch plans are now set for queries instead of persistence managers.
Improved project query filter 'withParent' to avoid collisions.
Changed logger from error to debug in 'ProjectResource'.
Checks for access in 'getProjectsWithoutDescendantsOf'.
Signed-off-by: RBickert <rbt@mm-software.com>
- Removed redundant if-clause in `excludeProjectsThatAreChildren()` and
adjusted if-clauses in the case of only showing root projects in
`ProjectQueryManager.java`
- Added logger errors in `ProjectResource.java`
Signed-off-by: RBickert <rbt@mm-software.com>
- Renamed `excludeChildren` to `excludeProjectsThatAreChildren`
- Optimized several conditional clauses which check if a project is
active
- Throw exception instead of just logging if an inactive parent is
selected, if an active parent with active children is updated to
inactive or if a project updates itself to its parent
- Added more information in Swagger-API
- Added ACL-check in `getChildrenProjects`
- Updated API calls to reduce redundant methods and to filter a
project's viable parents in the backend instead of in the backend
Signed-off-by: RBickert <rbt@mm-software.com>