-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update documentation with latest how-to steps
- Loading branch information
1 parent
6cc5849
commit 57ec387
Showing
6 changed files
with
178 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Filter Configurations | ||
##################### | ||
|
||
The :term:`filter configuration` is a dictionary used to configure the pipeline steps for a particular filter. The configuration settings are specific for each :term:`filter type`. The dictionary looks like this: | ||
|
||
.. code-block:: python | ||
OPEN_EDX_FILTERS_CONFIG = { | ||
"FILTER_TYPE": { # Replace with the specific filter type | ||
"fail_silently": True, # Set to True to ignore exceptions and continue the pipeline | ||
"pipeline": [ | ||
"module.path.PipelineStep0", # Replace with the actual module path and class name | ||
"module.path.PipelineStep1", | ||
# Add more steps as needed | ||
"module.path.PipelineStepN", | ||
] | ||
}, | ||
} | ||
Where: | ||
|
||
- ``FILTER_TYPE`` is the :term:`filter type`. | ||
- ``fail_silently`` is a boolean flag indicating whether the pipeline should continue executing the next steps when a runtime exception is raised by a pipeline step. | ||
- If ``True``, when a pipeline step raises a runtime exception (e.g., ``ImportError`` or ``AttributeError``) which are not intentionally raised by the developer during the filter's execution; the exception won't be propagated and the execution will resume, i.e the next steps will be executed. | ||
- If ``False``, the exception will be propagated and the execution will stop returning control to the caller. | ||
- ``pipeline`` is list of paths for each pipeline step. Each path is a string with the following format: ``module.path.PipelineStepClassName``. The module path is the path to the module where the pipeline step class was implemented and the class name is the name of the class that implements the ``run_filter`` method to be executed when the filter is triggered. | ||
|
||
With this configuration: | ||
|
||
.. code-block:: python | ||
OPEN_EDX_FILTERS_CONFIG = { | ||
"FILTER_TYPE": { | ||
"fail_silently": True, | ||
"pipeline": [ | ||
"non_existing_module.PipelineStep", | ||
"existing_module.NonExistingPipelineStep", | ||
"module.path.PipelineStep", | ||
] | ||
}, | ||
} | ||
Triggering the filter will behave as follows: | ||
|
||
- The pipeline tooling will catch the ``ImportError`` exception raised by the first step and continue executing the next steps. | ||
- The pipeline tooling will catch the ``AttributeError`` exception raised by the second step and continue executing the next steps. | ||
- The pipeline tooling will execute the third step successfully and then return the result. | ||
|
||
For more details on the configuration see :doc:`../decisions/0002-hooks-filter-config-location`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters