Skip to content

Commit fae73bf

Browse files
Merge branch 'main' into resolve-dependencies-from-lockfile
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
2 parents 72cef36 + a41f90a commit fae73bf

109 files changed

Lines changed: 10772 additions & 7153 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ local
4747
/.python-version
4848
/.pytest_cache/
4949
/scancodeio.egg-info/
50-
policies.yml
5150
*.rdb
5251
*.aof
5352
.vscode

CHANGELOG.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
Changelog
22
=========
33

4-
v34.6.3 (unreleased)
4+
v34.6.4 (unreleased)
5+
--------------------
6+
7+
- Add all "classify" plugin fields from scancode-toolkit on the CodebaseResource model.
8+
https://github.com/nexB/scancode.io/issues/1275
9+
10+
- Refine the extraction errors reporting to include the resource path for rendering
11+
link to the related resources in the UI.
12+
https://github.com/nexB/scancode.io/issues/1273
13+
14+
- Add a ``flush-projects`` management command, to Delete all project data and their
15+
related work directories created more than a specified number of days ago.
16+
https://github.com/nexB/scancode.io/issues/1289
17+
18+
v34.6.3 (2024-06-21)
519
--------------------
620

721
- Use the ``--option=value`` syntax for args entries in place of ``--option value``
@@ -11,6 +25,9 @@ v34.6.3 (unreleased)
1125
- Fix an issue in the d2d JavaScript mapper.
1226
https://github.com/nexB/scancode.io/pull/1274
1327

28+
- Add support for a ``ignored_vulnerabilities`` field on the Project configuration.
29+
https://github.com/nexB/scancode.io/issues/1271
30+
1431
v34.6.2 (2024-06-18)
1532
--------------------
1633

docs/command-line-interface.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,27 @@ Optional arguments:
298298
- ``--no-input`` Does not prompt the user for input of any kind.
299299

300300

301+
.. _cli_flush_projects:
302+
303+
`$ scanpipe flush-projects`
304+
---------------------------
305+
306+
Delete all project data and their related work directories created more than a
307+
specified number of days ago.
308+
309+
Optional arguments:
310+
311+
- ``---retain-days RETAIN_DAYS`` Specify the number of days to retain data.
312+
All data older than this number of days will be deleted.
313+
**Defaults to 0 (delete all data)**.
314+
315+
For example, to delete all projects created more than one week ago::
316+
317+
scanpipe flush-projects --retain-days 7
318+
319+
- ``--no-input`` Does not prompt the user for input of any kind.
320+
321+
301322
.. _cli_create_user:
302323

303324
`$ scanpipe create-user <username>`

docs/faq.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,32 @@ Note that only the HTTPS type of URL is supported::
249249
A GitHub repository URL example::
250250

251251
https://github.com/username/repository.git
252+
253+
How can I cleanup my ScanCode.io installation, removing all projects and related data?
254+
--------------------------------------------------------------------------------------
255+
256+
You can use the :ref:`cli_flush_projects` command to perform bulk deletion of projects
257+
and their associated data stored on disk::
258+
259+
$ scanpipe flush-projects
260+
261+
**Confirmation will be required before deletion.**
262+
263+
To automate this process, such as running it from a cron job, you can use the
264+
``--no-input`` option to skip confirmation prompts.
265+
266+
Additionally, you can retain specific projects and their data based on their
267+
creation date using the ``--retain-days`` option.
268+
269+
Here's an example of a crontab entry that runs daily and flushes all projects and
270+
data older than 7 days::
271+
272+
@daily scanpipe flush-projects --retain-days 7 --no-input
273+
274+
.. note:: If you are use Docker for running ScanCode.io, you can run the scanpipe
275+
``flush-projects`` command using::
276+
277+
docker compose run --rm web scanpipe flush-projects
278+
279+
See :ref:`command_line_interface` chapter for more information about the scanpipe
280+
command.

docs/project-configuration.rst

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,20 @@ Content of a ``scancode-config.yml`` file:
5252
product_name: My Product Name
5353
product_version: '1.0'
5454
ignored_patterns:
55-
- '*.tmp'
56-
- 'tests/*'
55+
- '*.tmp'
56+
- 'tests/*'
5757
ignored_dependency_scopes:
5858
- package_type: npm
5959
scope: devDependencies
6060
- package_type: pypi
6161
scope: tests
62+
ignored_vulnerabilities:
63+
- VCID-q4q6-yfng-aaag
64+
- CVE-2024-27351
65+
- GHSA-vm8q-m57g-pff3
6266
63-
See the :ref:`project_configuration_settings` section for the details about each
64-
setting.
67+
See the following :ref:`project_configuration_settings` section for the details about
68+
each setting.
6569

6670
.. tip::
6771
You can generate the project configuration file from the
@@ -125,10 +129,10 @@ packages, define the following in your ``scancode-config.yml`` configuration fil
125129
.. code-block:: yaml
126130
127131
ignored_dependency_scopes:
128-
- package_type: npm
129-
scope: devDependencies
130-
- package_type: pypi
131-
scope: tests
132+
- package_type: npm
133+
scope: devDependencies
134+
- package_type: pypi
135+
scope: tests
132136
133137
If you prefer to use the :ref:`user_interface_project_settings` form, list each
134138
ignored scope using the `package_type:scope` syntax, **one per line**, such as:
@@ -141,3 +145,21 @@ ignored scope using the `package_type:scope` syntax, **one per line**, such as:
141145
.. warning::
142146
Be precise when listing scope names to avoid unintended exclusions.
143147
Ensure the scope names are correct and reflect your project requirements.
148+
149+
ignored_vulnerabilities
150+
^^^^^^^^^^^^^^^^^^^^^^^
151+
152+
Provide one or more vulnerability id to be ignored, **one per line**.
153+
154+
You can provide ``VCID`` from VulnerableCode or any aliases such as ``CVE`` or
155+
``GHSA``.
156+
157+
.. code-block:: yaml
158+
159+
ignored_vulnerabilities:
160+
- VCID-q4q6-yfng-aaag
161+
- CVE-2024-27351
162+
- GHSA-vm8q-m57g-pff3
163+
- OSV-2020-871
164+
- BIT-django-2024-24680
165+
- PYSEC-2024-28

docs/scancode-config.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@
99
# - Use ``*`` to match multiple characters.
1010
# - Use ``?`` to match a single character.
1111
#ignored_patterns:
12-
# - '*.tmp'
13-
# - 'tests/*'
12+
# - '*.tmp'
13+
# - 'tests/*'
1414

1515
# Specify certain dependency scopes to be ignored for a given package type.
1616
#ignored_dependency_scopes:
1717
# - package_type: npm
1818
# scope: devDependencies
1919
# - package_type: pypi
2020
# scope: tests
21+
22+
# Specify certain vulnerabilities to be ignored using VCID, CVE, or any aliases.
23+
#ignored_vulnerabilities:
24+
# - VCID-q4q6-yfng-aaag
25+
# - CVE-2024-27351
26+
# - GHSA-vm8q-m57g-pff3

etc/thirdparty/virtualenv.pyz

1.88 MB
Binary file not shown.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
about_resource: virtualenv.pyz
22
name: get-virtualenv
3-
version: 20.25.1
4-
download_url: https://github.com/pypa/get-virtualenv/raw/20.25.1/public/virtualenv.pyz
3+
version: 20.26.3
4+
download_url: https://github.com/pypa/get-virtualenv/raw/20.26.3/public/virtualenv.pyz
55
description: virtualenv is a tool to create isolated Python environments.
66
homepage_url: https://github.com/pypa/virtualenv
77
license_expression: lgpl-2.1-plus AND (bsd-new OR apache-2.0) AND mit AND python AND bsd-new
@@ -10,4 +10,4 @@ copyright: Copyright (c) The Python Software Foundation and others
1010
redistribute: yes
1111
attribute: yes
1212
track_changes: yes
13-
package_url: pkg:github/pypa/get-virtualenv@20.25.1#public/virtualenv.pyz
13+
package_url: pkg:github/pypa/get-virtualenv@20.26.3#public/virtualenv.pyz

scancodeio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import git
3030

31-
VERSION = "34.6.2"
31+
VERSION = "34.6.3"
3232

3333
PROJECT_DIR = Path(__file__).resolve().parent
3434
ROOT_DIR = PROJECT_DIR.parent

scanpipe/api/serializers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ class Meta:
315315
"is_text",
316316
"is_archive",
317317
"is_media",
318+
"is_legal",
319+
"is_manifest",
320+
"is_readme",
321+
"is_top_level",
318322
"is_key_file",
319323
"detected_license_expression",
320324
"detected_license_expression_spdx",

0 commit comments

Comments
 (0)