Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: [FC-0074] add more detailed docs on filters #222

Merged
merged 15 commits into from
Nov 26, 2024

Conversation

mariajgrimaldi
Copy link
Member

@mariajgrimaldi mariajgrimaldi commented Oct 15, 2024

Description

This PR improves the concept section of the documentation by adding a new document dedicated only to Open edX Filters.

Initially, I also added two additional modifications:

  1. Update references in the Hooks Extension Framework document and explain why the framework should be adopted.
  2. Adding a new document comparing Open edX Events vs Filters to ease adoption.

Which I later dropped in favor of centralizing shared documentation docs.openedx.org and avoiding duplication across repos: So I'll be moving those docs to docs.openedx.org, Here's the PR for the implementation: openedx/docs.openedx.org#599

For more details on the decision, please see this thread.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 15, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Oct 15, 2024

Thanks for the pull request, @mariajgrimaldi!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/hooks-extension-framework. Tag them in a comment and let them know that your changes are ready for review.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@mariajgrimaldi
Copy link
Member Author

@sarina @Apgomeznext: here's the WIP I've been working on for the 1.1 Improve Definitions and Update Outdated References in the Framework project feature.

I discussed with AnaP having feedback loops within the maintenance team about the documents' content. She'd get involved to review the document structure once she has the capacity for the project. So, early feedback is welcome.

@mariajgrimaldi mariajgrimaldi changed the title docs: add more detailed documentation under the concepts section docs: [FC-0074] add more detailed documentation under the concepts section Oct 28, 2024
@mariajgrimaldi mariajgrimaldi changed the title docs: [FC-0074] add more detailed documentation under the concepts section docs: [FC-0074] add more detailed docs under the concepts section Oct 28, 2024
@sarina
Copy link
Contributor

sarina commented Oct 30, 2024

@mariajgrimaldi thanks for sharing. I did a quick skim, it looks like it's off to a good start. Regarding duplicating documentation, I would strongly recommend against this. I would make a centralized document, and link to that as needed.

@mariajgrimaldi
Copy link
Member Author

mariajgrimaldi commented Oct 31, 2024

Thank you, @sarina. I agree we should solve this duplication of documents, so I moved some of these documents to a subsection of Concepts and Guides in the docs.openedx.org docs: openedx/edx-platform#35733. That PR references documents from each event and filters repos. My only concern is that leaving the docs there suggests the framework is edx-platform scoped when it's not. Would a single repo for the shared definitions of the framework be possible?

@sarina
Copy link
Contributor

sarina commented Oct 31, 2024

@mariajgrimaldi why not put the shared docs in https://github.com/openedx/docs.openedx.org ?

@mariajgrimaldi
Copy link
Member Author

mariajgrimaldi commented Nov 4, 2024

@sarina -- I thought about adding it here. It would have been something like OEP-50 Overview. We wouldn't have the misconception that the framework is edx-platform scoped, but it felt randomly placed.

So now that you mentioned it, I tried digging more into the docs sections and found this: https://docs.openedx.org/en/latest/developers/references/developer_guide/extending_platform/index.html. However, the extensions listed there are more content-focused, not like those listed here: https://docs.openedx.org/projects/edx-platform/en/latest/concepts/extension_points.html, where folder where I'm currently adding the documents. This is entirely out of this project's scope, but should we move those extension points to docs.openedx.org?

For the time being, I'll move the hooks docs from edx-platform to the Extending the Open edX Platform section.

@sarina
Copy link
Contributor

sarina commented Nov 4, 2024

@mariajgrimaldi the Developers Guide on the docs site isn't in Diataxis format, so I wouldn't add more to it. I think adding a Concept doc makes sense. You could link to the Concept doc in the Developer's Guide as well, but I think it'll be more visible/easier to find as a Concept guide.

@mariajgrimaldi mariajgrimaldi marked this pull request as ready for review November 4, 2024 12:56
@mariajgrimaldi mariajgrimaldi requested a review from a team as a code owner November 4, 2024 12:56
@mariajgrimaldi mariajgrimaldi added the FC Relates to an Axim Funded Contribution project label Nov 4, 2024
@mariajgrimaldi mariajgrimaldi changed the title docs: [FC-0074] add more detailed docs under the concepts section docs: [FC-0074] add more detailed docs on filters Nov 4, 2024
@mariajgrimaldi
Copy link
Member Author

@sarina: I'll be following your suggestions from openedx/openedx-events#406 here as well! Thank you :)

Copy link
Contributor

@sarina sarina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!


#. The tooling then executes each function in the pipeline sequentially, starting with :math:`f_0`, which processes the input arguments ``args`` and applies the developer's operations, returning potentially modified arguments.

#. The next function :math:`f_0` receives the potentially modified arguments and applies further operations, returning another modified set of arguments. This process continues through the list of functions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#. The next function :math:`f_0` receives the potentially modified arguments and applies further operations, returning another modified set of arguments. This process continues through the list of functions.
#. The next function (if there are more than one) :math:`f_1` receives the potentially modified arguments and applies further operations, returning another modified set of arguments. This process continues through the list of functions.

I think this is what you mean?

Copy link
Member Author

@mariajgrimaldi mariajgrimaldi Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Thank you :)

370616d


#. The next function :math:`f_0` receives the potentially modified arguments and applies further operations, returning another modified set of arguments. This process continues through the list of functions.

#. Each subsequent function :math:`f_{i+1}` receives the output from the previous function and returns its modified output until all functions have been executed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#. Each subsequent function :math:`f_{i+1}` receives the output from the previous function and returns its modified output until all functions have been executed.
#. Each subsequent function :math:`f_{n+1}` receives the output from the previous function and returns its modified output until all functions have been executed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using f_{i+1} it'd be even more confusing, so I removed it completely.


#. The ``run_filter`` method calls the pipeline tooling under the hood, which manages the execution of the filter's pipeline.

#. The filter's tooling retrieves the configuration from ``OPEN_EDX_FILTERS_CONFIG``, which defines a list of N functions :math:`f_0, f_1, \ldots, f_{n-1}` that will be executed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#. The filter's tooling retrieves the configuration from ``OPEN_EDX_FILTERS_CONFIG``, which defines a list of N functions :math:`f_0, f_1, \ldots, f_{n-1}` that will be executed.
#. The filter's tooling retrieves the configuration from ``OPEN_EDX_FILTERS_CONFIG``, which defines a list of N functions :math:`f_0, f_1, \ldots, f_{n}` that will be executed.

I think I might just use n because n-1 I would assume there's a final n step

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good suggestion. So we'll start counting from 1 instead, then, if that's more straightforward.

How are Open edX Filters used?
------------------------------

Developers can implement functions in an `Open edX Django plugin`_, configure them for a particular filter in the ``OPEN_EDX_FILTERS_CONFIG`` setting, modifying the application flow when a the filter in question is invoked by the process in execution. These functions can the application's behavior by altering data, adding new data, or stopping execution by raising exceptions. For example, a filter can stop a student's enrollment if certain conditions, such as business rules, are not met.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Developers can implement functions in an `Open edX Django plugin`_, configure them for a particular filter in the ``OPEN_EDX_FILTERS_CONFIG`` setting, modifying the application flow when a the filter in question is invoked by the process in execution. These functions can the application's behavior by altering data, adding new data, or stopping execution by raising exceptions. For example, a filter can stop a student's enrollment if certain conditions, such as business rules, are not met.
Developers can implement functions in an `Open edX Django plugin`_, configure them for a particular filter in the ``OPEN_EDX_FILTERS_CONFIG`` setting, and modify the application flow when a the filter in question is invoked by the process in execution. These functions can the application's behavior by altering data, adding new data, or stopping execution by raising exceptions. For example, a filter can stop a student's enrollment if certain conditions, such as business rules, are not met.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mariajgrimaldi mariajgrimaldi linked an issue Nov 22, 2024 that may be closed by this pull request
@mariajgrimaldi
Copy link
Member Author

Hey, @openedx/hooks-extension-framework, can some of you help me review this PR from a technical perspective so we can ensure we didn't miss anything?

Thank you!

Copy link
Contributor

@Ian2012 Ian2012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mariajgrimaldi mariajgrimaldi merged commit 7f6d2c9 into main Nov 26, 2024
8 checks passed
@mariajgrimaldi mariajgrimaldi deleted the MJG/improve-concepts-docs branch November 26, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

How Open edX filters work
4 participants