Skip to content

Commit d414a30

Browse files
committed
Ignore linkcheck for dummy URLs
Signed-off-by: Keshav Priyadarshi <[email protected]>
1 parent f51c542 commit d414a30

File tree

4 files changed

+36
-29
lines changed

4 files changed

+36
-29
lines changed

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"https://anongit.gentoo.org/git/data/glsa.git", # Git only link
3636
"https://www.softwaretestinghelp.com/how-to-write-good-bug-report/", # Cloudflare protection
3737
"https://www.openssl.org/news/vulnerabilities.xml", # OpenSSL legacy advisory URL, not longer available
38+
"https://example.org/api/non-existent-packages",
3839
]
3940

4041
# Add any Sphinx extension module names here, as strings. They can be

docs/source/contributing.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ For more established contributors, you can contribute to the codebase in several
5454
- Create a `new issue <https://github.com/aboutcode-org/vulnerablecode/issues>`_ to request a
5555
feature, submit a feedback, or ask a question.
5656

57-
* Want to add support for a new importer pipeline? See the detailed tutorial here: :ref:`tutorial_add_importer_pipeline`.
58-
* Interested adding a new improver pipeline? Check out the tutorial here: :ref:`tutorial_add_improver_pipeline`.
57+
* Want to add support for a new importer pipeline? See the detailed tutorial here:
58+
:ref:`tutorial_add_importer_pipeline`.
59+
* Interested adding a new improver pipeline? Check out the tutorial here:
60+
:ref:`tutorial_add_improver_pipeline`.
5961

6062
.. note::
6163
Make sure to check existing `issues <https://github.com/aboutcode-org/vulnerablecode/issues>`_,

docs/source/tutorial_add_importer_pipeline.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@ Pipeline
2323
We use `aboutcode.pipeline <https://github.com/aboutcode-org/scancode.io/tree/main/aboutcode/pipeline>`_
2424
for importing and improving data. At a very high level, a working pipeline contains classmethod
2525
``steps`` that defines what steps to run and in what order. These steps are essentially just
26-
functions. Pipeline provides an easy and effective way to log events inside these steps (it
27-
automatically handles rendering and dissemination for these logs.)
26+
functions. Pipeline provides an easy and effective way to log events inside these steps (it
27+
automatically handles rendering and dissemination for these logs.)
2828

2929
It also includes built-in progress indicator, which is essential since some of the jobs we run
3030
in the pipeline are long-running tasks that require proper progress indicators. Pipeline provides
3131
way to seamlessly records the progress (it automatically takes care of rendering and dissemination
3232
of these progress).
3333

3434
Additionally, the pipeline offers a consistent structure, making it easy to run these pipeline steps
35-
with message queue like RQ and store all events related to a particular pipeline for
35+
with message queue like RQ and store all events related to a particular pipeline for
3636
debugging/improvements.
3737

3838
This tutorial contains all the things one should know to quickly implement an importer pipeline.
39-
Many internal details about importer pipeline can be found inside the `vulnerabilities/pipelines/__init__.py
39+
Many internal details about importer pipeline can be found inside the
40+
`vulnerabilities/pipelines/__init__.py
4041
<https://github.com/aboutcode-org/vulnerablecode/blob/main/vulnerabilities/pipelines/__init__.py>`_ file.
4142

4243

@@ -95,13 +96,13 @@ Create file for the new importer pipeline
9596
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9697

9798
All pipelines, including the importer pipeline, are located in the
98-
`vulnerabilities/pipelines/
99+
`vulnerabilities/pipelines/
99100
<https://github.com/aboutcode-org/vulnerablecode/tree/main/vulnerabilities/pipelines>`_ directory.
100101

101102
The importer pipeline is implemented by subclassing **VulnerableCodeBaseImporterPipeline**
102103
and implementing the unimplemented methods. Since most tasks, such as inserting **AdvisoryData**
103104
into the database and creating package-vulnerability relationships, are the same regardless of
104-
the source of the advisory, these tasks are already taken care of in the base importer pipeline,
105+
the source of the advisory, these tasks are already taken care of in the base importer pipeline,
105106
i.e., **VulnerableCodeBaseImporterPipeline**. You can simply focus on collecting the raw data and
106107
parsing it to create proper **AdvisoryData** objects.
107108

@@ -134,7 +135,7 @@ and that's it.
134135
In some cases, it could be difficult to get the exact total number of advisories that would
135136
be collected without actually processing the advisories. In such case returning the best
136137
estimate will also work.
137-
138+
138139
**advisories_count** is used to enable a proper progress indicator and is not used beyond that.
139140
If it is impossible (a super rare case) to compute the total advisory count beforehand,
140141
just return ``0``.
@@ -174,7 +175,7 @@ At this point, an example importer will look like this:
174175
175176
def advisories_count(self) -> int:
176177
raise NotImplementedError
177-
178+
178179
def collect_advisories(self) -> Iterable[AdvisoryData]:
179180
raise NotImplementedError
180181
@@ -291,7 +292,7 @@ version management from `univers <https://github.com/aboutcode-org/univers>`_.
291292
.. important::
292293
Steps should include ``collect_and_store_advisories`` and ``import_new_advisories``
293294
in the order shown above. They are defined in **VulnerableCodeBaseImporterPipeline**.
294-
295+
295296
It is the **collect_and_store_advisories** that is responsible for making calls to
296297
**collect_advisories** and **advisories_count**, and hence **collect_advisories** and
297298
**advisories_count** should never be directly added in steps.
@@ -307,7 +308,7 @@ Register the Importer Pipeline
307308
------------------------------
308309

309310
Finally, register your pipeline in the importer registry at
310-
`vulnerabilities/importers/__init__.py
311+
`vulnerabilities/importers/__init__.py
311312
<https://github.com/aboutcode-org/vulnerablecode/blob/main/vulnerabilities/importers/__init__.py>`_
312313

313314
.. code-block:: python
@@ -363,4 +364,4 @@ Now, run the importer.
363364
INFO 2024-10-16 10:15:10.563 Pipeline completed in 0 seconds
364365
365366
366-
See :ref:`command_line_interface` for command line usage instructions.
367+
See :ref:`command_line_interface` for command line usage instructions.

docs/source/tutorial_add_improver_pipeline.rst

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ Pipeline
2020
We use `aboutcode.pipeline <https://github.com/aboutcode-org/scancode.io/tree/main/aboutcode/pipeline>`_
2121
for importing and improving data. At a very high level, a working pipeline contains classmethod
2222
``steps`` that defines what steps to run and in what order. These steps are essentially just
23-
functions. Pipeline provides an easy and effective way to log events inside these steps (it
24-
automatically handles rendering and dissemination for these logs.)
23+
functions. Pipeline provides an easy and effective way to log events inside these steps (it
24+
automatically handles rendering and dissemination for these logs.)
2525

2626
It also includes built-in progress indicator, which is essential since some of the jobs we run
2727
in the pipeline are long-running tasks that require proper progress indicators. Pipeline provides
2828
way to seamlessly records the progress (it automatically takes care of rendering and dissemination
2929
of these progress).
3030

3131
Additionally, the pipeline offers a consistent structure, making it easy to run these pipeline steps
32-
with message queue like RQ and store all events related to a particular pipeline for
32+
with message queue like RQ and store all events related to a particular pipeline for
3333
debugging/improvements.
3434

3535
This tutorial contains all the things one should know to quickly implement an improver pipeline.
@@ -42,10 +42,10 @@ The new improver design lets you do all sorts of cool improvements and enhanceme
4242
Some of those are:
4343

4444
* Let's suppose you have a certain number of packages and vulnerabilities in your database,
45-
and you want to make sure that the packages being shown in VulnerableCode do indeed exist upstream.
46-
Oftentimes, we come across advisory data that contains made-up package versions. We can write
47-
(well, we already have) a pipeline that iterates through all the packages in VulnerableCode and
48-
labels them as ghost packages if they don't exist upstream.
45+
and you want to make sure that the packages being shown in VulnerableCode do indeed exist
46+
upstream. Oftentimes, we come across advisory data that contains made-up package versions.
47+
We can write (well, we already have) a pipeline that iterates through all the packages in
48+
VulnerableCode and labels them as ghost packages if they don't exist upstream.
4949

5050

5151
- A basic security advisory only contains CVE/aliases, summary, fixed/affected version, and
@@ -64,17 +64,20 @@ be absolutely sure of what you're doing and should have robust tests for these p
6464
Writing an Improver Pipeline
6565
-----------------------------
6666

67-
**Scenario:** Suppose we come around a source that curates and stores the list of packages that don't
68-
exist upstream and makes it available through the REST API endpoint https://example.org/api/non-existent-packages,
69-
which gives a JSON response with a list of non-existent packages.
70-
Let's write a pipeline that will use this source to flag these non-existent package as ghost package.
67+
**Scenario:** Suppose we come around a source that curates and stores the list of packages that
68+
don't exist upstream and makes it available through the REST API endpoint
69+
https://example.org/api/non-existent-packages, which gives a JSON response with a list of
70+
non-existent packages.
71+
72+
Let's write a pipeline that will use this source to flag these non-existent package as
73+
ghost package.
7174

7275

7376
Create file for the new improver pipeline
7477
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7578

7679
All pipelines, including the improver pipeline, are located in the
77-
`vulnerabilities/pipelines/
80+
`vulnerabilities/pipelines/
7881
<https://github.com/aboutcode-org/vulnerablecode/tree/main/vulnerabilities/pipelines>`_ directory.
7982

8083
The improver pipeline is implemented by subclassing `VulnerableCodePipeline`.
@@ -124,7 +127,7 @@ At this point improver will look like this:
124127
125128
def fetch_response(self):
126129
raise NotImplementedError
127-
130+
128131
def flag_ghost_packages(self):
129132
raise NotImplementedError
130133
@@ -194,7 +197,7 @@ Register the Improver Pipeline
194197
------------------------------
195198

196199
Finally, register your improver in the improver registry at
197-
`vulnerabilities/improvers/__init__.py
200+
`vulnerabilities/improvers/__init__.py
198201
<https://github.com/aboutcode-org/vulnerablecode/blob/main/vulnerabilities/improvers/__init__.py>`_
199202

200203

@@ -253,8 +256,8 @@ See :ref:`command_line_interface` for command line usage instructions.
253256

254257
.. tip::
255258

256-
If you need to improve package vulnerability relations created using a certain pipeline,
257-
simply use the **pipeline_id** to filter out only those items. For example, if you want
259+
If you need to improve package vulnerability relations created using a certain pipeline,
260+
simply use the **pipeline_id** to filter out only those items. For example, if you want
258261
to improve only those **AffectedByPackageRelatedVulnerability** entries that were created
259262
by npm_importer pipeline, you can do so with the following query:
260263

0 commit comments

Comments
 (0)