Commit graph

80 commits

Author SHA1 Message Date
Niklas
9b015c3e28
Merge pull request #4415 from nscuro/issue-4410 2024-11-28 18:18:26 +01:00
nscuro
42b91e887a
Fix project.active being nullable
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>
2024-11-27 22:10:16 +01:00
nscuro
297b192f91
Fix NPE when cloning projects with broken dependency graph
Fixes #4413

Signed-off-by: nscuro <nscuro@protonmail.com>
2024-11-27 19:51:50 +01:00
Ralf King
229a3265eb Fixed cloning not properly respecting latest flag. Add regression test for it.
Signed-off-by: Ralf King <rkg@mm-software.com>
2024-09-29 01:30:27 +02:00
Ralf King
fe36568e36 Handle Review comments:
*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>
2024-09-28 23:59:04 +02:00
Ralf King
3b4af92404 Introduce isLatest flag for projects. Support this for different endpoints which allow creation or modification of projects.
Signed-off-by: Ralf King <rkg@mm-software.com>
2024-09-28 23:33:55 +02:00
nscuro
3eac1d664f
Fix directDependencies of cloned projects referring to original component UUIDs
Fixes #4153

Signed-off-by: nscuro <nscuro@protonmail.com>
2024-09-24 22:39:50 +02:00
nscuro
68e615a1b9
Support tagging of notification rules
Supersedes #3506

Co-authored-by: Sebastien Delcoigne <sebastien.delcoigne@gmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
2024-08-31 22:45:00 +02:00
Ross Murphy
385bf6eacc
replace author with authors for DT model
Signed-off-by: Ross Murphy <RossMurphy@ibm.com>
2024-07-24 15:53:11 +01:00
Ross Murphy
0a2550e798
Merge branch 'master' into issue-3936
Signed-off-by: Ross Murphy <77832827+2000rosser@users.noreply.github.com>
2024-07-16 17:47:35 +01:00
nscuro
164847a87a
Ensure no unique constraint violation for ProjectMetadata
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>
2024-07-15 20:54:27 +02:00
Ross Murphy
f1d14d53e9
add support for authors field
Signed-off-by: Ross Murphy <RossMurphy@ibm.com>
2024-07-11 11:55:02 +01:00
nscuro
c41717f515
Add REST endpoints for bulk tagging & un-tagging of projects
Signed-off-by: nscuro <nscuro@protonmail.com>
2024-06-30 13:01:13 +02:00
Niklas
3346907d70
Merge pull request #3711 from DependencyTrack/feature-alpine-2.2.6
Bump Alpine to `2.2.6-SNAPSHOT`
2024-05-15 19:46:48 +02:00
nscuro
d82d32a06c
Replace manual transaction commits with callInTransaction
This is to properly support nested transactions as introduced in https://github.com/stevespringett/Alpine/pull/552.

Signed-off-by: nscuro <nscuro@protonmail.com>
2024-05-10 21:47:34 +02:00
Aravind Parappil
49350358f8 Add active Field To Project Versions
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>
2024-05-09 20:52:17 -04:00
nscuro
c5eda9271e
Transfer copyright from Steve Springett to OWASP Foundation
Signed-off-by: nscuro <nscuro@protonmail.com>
2024-03-20 18:39:35 +01:00
Sebastien Delcoigne
d1a44a6f92 Adds possibility to enter an attribution date value when adding a vulnerability to a project, used in cloning operation.
Fixes #3464

Signed-off-by: Sebastien Delcoigne <sebastien.delcoigne@gmail.com>
2024-02-22 22:57:13 +11:00
Niklas
43a1e38d1e
Merge pull request #3248 from mge-mm/dependency-track-1732
Project cloning logic for cloning policy violations and Violationanalysis
2024-01-15 20:39:37 +01:00
Ralf King
3f97987d85 Implement #1732
Signed-off-by: Ralf King <rkg@mm-software.com>
2023-12-10 02:43:38 +01:00
Ralf King
e379766844 reuse existing projects endpoint instead of creating a new one
Signed-off-by: Ralf King <rkg@mm-software.com>
2023-12-04 02:02:54 +01:00
Ralf King
763492f42f Portfolio Access Control : Add a team group to project should only list projects that are not already added.
Signed-off-by: Ralf King <rkg@mm-software.com>
2023-12-03 21:30:53 +01:00
Niklas
065e483a98
Merge pull request #3179 from nscuro/supplier-manufacturer-corrections
Supplier and manufacturer corrections
2023-11-28 23:42:30 +01:00
Willie Nel
7ead801fea Added a default value for 'active' if it is null
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>
2023-11-28 20:28:55 +01:00
nscuro
b5a0bbf5fe
Move manufacturer from ProjectMetadata to Project
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>
2023-11-27 21:47:02 +01:00
nscuro
b6952ca22f
Remove unused ProjectQueryManager#updateProject method
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-11-27 20:09:50 +01:00
nscuro
609c4f8092
Ensure project.supplier can be PATCHed
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-11-27 20:07:51 +01:00
nscuro
91c1040f77
Include metadata when cloning projects
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-11-27 19:44:53 +01:00
nscuro
785f1e485e
Handle supplier in update, patch, and clone operations of components and projects
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-11-27 19:44:53 +01:00
nscuro
a6230de487
Object passed to IndexEvent no longer need detaching
They are converted to non-managed `SearchDocument` implementations in `IndexEvent`'s constructor.

Signed-off-by: nscuro <nscuro@protonmail.com>
2023-10-22 22:41:58 +02:00
nscuro
5534d3aace
Fix NPE in doesProjectExist when project version is null
Regression introduced in #2966

Signed-off-by: nscuro <nscuro@protonmail.com>
2023-10-02 23:09:22 +02:00
nscuro
741de8ce16
Fix project cloning allowing for duplicate versions
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>
2023-08-21 22:57:29 +02:00
Walter de Boer
8580c05d89 Use projections / result class to determine ProjectVersions
Co-authored-by: Niklas <nscuro@protonmail.com>
Signed-off-by: Walter de Boer <walterdeboer@dbso.nl>
2023-06-27 23:02:45 +02:00
Walter de Boer
c02fe38e7b Added transient List of ProjectVersions and set Metrics in Project to minimize the number of round trips a client needs to make
Signed-off-by: Walter de Boer <walterdeboer@dbso.nl>
2023-04-28 07:34:48 +02:00
Florian Heubeck
fea0adef2c
Issue #2695: Add externalReferences to PATCH project
Signed-off-by: Florian Heubeck <heubeck@mediamarktsaturn.com>
2023-04-20 17:13:24 +02:00
nscuro
ca74c2682d
Fix invalid query filter assembly
Fixes #2583

Signed-off-by: nscuro <nscuro@protonmail.com>
2023-03-09 11:58:29 +01:00
syalioune
4fd762474e Fix: Cloning ACL when cloning project
See #2493 for details

Signed-off-by: syalioune <sy_alioune@yahoo.fr>
2023-03-02 15:02:40 +01:00
nscuro
50b6c89987
Add checkstyle plugin to enforce import style
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-02-05 17:43:14 +01:00
rbt-mm
a160bd5590
Fix NullPointerException when updating a project (#2319)
* 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>
2022-12-21 10:55:06 +01:00
Mvld3r
61b63d54b1
Make project search by tags case insensitive (#1723)
Signed-off-by: ege-dw <enora.germond@deveryware.com>

Signed-off-by: ege-dw <enora.germond@deveryware.com>
Co-authored-by: ege-dw <enora.germond@deveryware.com>

Closes #1717
2022-12-14 16:16:29 +01:00
KramNamez
a2cbecca89
Added ProjectCreationNotification (#2176)
* 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
2022-12-14 12:41:09 +01:00
rbt-mm
48688fa958
Implement treegrid to display parent-child-relationship in project list (#2152)
* 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
2022-12-02 18:21:49 +01:00
Stephan Spindler
65a86f6d5a
Refactoring in persistence (#2121)
* 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>
2022-11-15 11:34:27 +01:00
valentijnscholten
1d4dd162d8 Use ArrayList to satisfy Lift
Co-authored-by: sonatype-lift[bot] <37194012+sonatype-lift[bot]@users.noreply.github.com>
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
2022-11-06 20:44:57 +01:00
Valentijn Scholten
9abffde4c1 clone-acl: remove comment
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
2022-11-06 19:51:21 +01:00
Valentijn Scholten
a5ff479c9a Allow cloning of ACL during Project cloning
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
2022-11-05 16:09:33 +01:00
RBickert
378a2501a0 Improve backend for hierarchical view
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>
2022-10-18 09:41:11 +02:00
rbt-mm
2610187937 Improvements to backend methods
- 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>
2022-10-04 16:48:19 +02:00
RBickert
538bdb1116 Optimizations and fixes for hierarchical view
- 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>
2022-10-04 16:48:19 +02:00
RBickert
bb2a0ee6c0 Fix switching parent to inactive
A parent project cannot be set to inactive if any of his children are
set to active

Signed-off-by: RBickert <rbt@mm-software.com>
2022-10-04 16:48:19 +02:00