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 docs about creating new filters with pipeline steps #242

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

mariajgrimaldi
Copy link
Member

@mariajgrimaldi mariajgrimaldi commented Dec 25, 2024

Description

Update how-to documents to create and implement pipeline steps considering design suggestions introduced in #240.

Here are the main documents to review:

Testing instructions

You can review the docs here: https://docsopenedxorg--242.org.readthedocs.build/projects/openedx-filters/en/242/how-tos/index.html

Deadline

None

Checklists

Check off if complete or not applicable:

Merge Checklist:

  • All reviewers approved
  • Reviewer tested the code following the testing instructions
  • CI build is green
  • Version bumped
  • Changelog record added with short description of the change and current date
  • Documentation updated (not only docstrings)
  • Code dependencies reviewed
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

Post Merge:

  • Create a tag
  • Create a release on GitHub
  • Check new version is pushed to PyPI after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)
  • Upgrade the package in the Open edX platform requirements (if applicable)

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

openedx-webhooks commented Dec 25, 2024

Thanks for the pull request, @mariajgrimaldi!

This repository is currently maintained by @openedx/hooks-extension-framework.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are 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.


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 mariajgrimaldi changed the title Mjg/create a new filter docs: add docs about creating new filters with pipeline steps Dec 26, 2024
@mariajgrimaldi mariajgrimaldi changed the title docs: add docs about creating new filters with pipeline steps docs: [FC-0074] add docs about creating new filters with pipeline steps Dec 26, 2024
@mariajgrimaldi mariajgrimaldi added the FC Relates to an Axim Funded Contribution project label Dec 26, 2024
@mariajgrimaldi mariajgrimaldi marked this pull request as ready for review December 26, 2024 13:06
@mariajgrimaldi mariajgrimaldi requested a review from a team as a code owner December 26, 2024 13:06

This will mainly make the filters available for your CI/CD pipeline and local development environment. If you are using the Open edX platform, the library should be already be installed in the environment so no need to install it.

Step 4: Create a Pipeline Step
Copy link
Contributor

Choose a reason for hiding this comment

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

This goes from step 2 to step 4!

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 totally missed this. Thank you!

- Limit each step to a single responsibility to make the code easier to maintain and test.
- Keep the pipeline step logic simple and focused on the specific task it needs to perform.
- Consider the performance implications of the pipeline step and avoid adding unnecessary complexity or overhead, considering the pipeline will be executed each time the filter is triggered.
- Implement error handling and logging in the pipeline step to handle exceptions and provide useful information for debugging, considering both development and production environments.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to include an example of logging or verbose error messaging in your simple example above?

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 added some. This suggestion mainly focuses on helping developers understand when the filter is doing what it's supposed to do based on the given conditions. Do you think the example illustrates that?

docs/how-tos/create-a-pipeline-step.rst Show resolved Hide resolved
+-------------------+----------------------------------------------------------------------------------------------------+
| Learning | Allows learners to consume content and perform actions in a learning activity on the platform. |
+-------------------+----------------------------------------------------------------------------------------------------+
| Analytics | Provides insights into learner behavior and course performance. |
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
| Analytics | Provides insights into learner behavior and course performance. |
| Analytics | A look into learner behavior and course performance. |

I don't love this but I think you should avoid using "insights" to not confuse with Insights, the deprecated analytics product.

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 used "visbility" instead of insights, what do you think?

Copy link

@MaferMazu MaferMazu left a comment

Choose a reason for hiding this comment

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

I have one suggestion, but the rest looks good to me.

Thanks @mariajgrimaldi

- You understand the concept of filters or have reviewed the relevant :doc:`/concepts/index` docs.
- You are familiar with the terminology used in the project, such as the terms :term:`Filter Type`. If not, you can review the :doc:`../reference/glossary` docs.
- You have reviewed the :doc:`../decisions/0007-filter-design-practices` ADR.
- You have identified that you need to create a new filter and have a use case for the filter.

Choose a reason for hiding this comment

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

My only comment is that we may want to drop the last assumption because, in this doc, we are talking about pipelines, and you cover the understanding part in Step 1.

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 for the suggestion! I replaced this line with understanding the pipeline step logic to implement instead: 667abe5


Before creating a pipeline step, you should understand your use case for the filter and the specific logic you want to implement in the pipeline step. In our example, we want to prevent users from enrolling in a course if they do not have a valid email address. We will create a pipeline step that checks if the user's email address is valid and raise an exception if it is not.

You should review the list of filters available in the Open edX platform and identify the filter that best fits your use case. In our example, we will use the `CourseEnrollmentStarted filter`_ to implement the logic for our use case. You should review the filter's arguments to understand the data that will be passed to the pipeline step and the expected output. This will help you define the pipeline step's logic and signature.
Copy link

@MaferMazu MaferMazu Jan 7, 2025

Choose a reason for hiding this comment

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

Suggested change
You should review the list of filters available in the Open edX platform and identify the filter that best fits your use case. In our example, we will use the `CourseEnrollmentStarted filter`_ to implement the logic for our use case. You should review the filter's arguments to understand the data that will be passed to the pipeline step and the expected output. This will help you define the pipeline step's logic and signature.
You should review the `list of filters`_ available in the Open edX platform and identify the filter that best fits your use case. In our example, we will use the `CourseEnrollmentStarted filter`_ to implement the logic for our use case. You should review the filter's arguments to understand the data that will be passed to the pipeline step and the expected output. This will help you define the pipeline step's logic and signature.

I added this suggestion because I saw something similar in the openedx-events PR, and it took me to Reference/Events. I didn't know that page existed. I think it should be helpful to be able to redirect the people to the list of filters here: https://docs.openedx.org/projects/openedx-filters/en/latest/reference/filters.html#

Note: In the suggestion, we need to reference the link because I didn't put it.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is pretty useful, thank you! ad4a794

@MaferMazu
Copy link

Thanks for addressing my feedback. This looks good to me ✅

Base automatically changed from MJG/practices-suggestions-adr to main January 14, 2025 09:44
@mariajgrimaldi mariajgrimaldi force-pushed the MJG/create-a-new-filter branch from ad4a794 to de53680 Compare January 14, 2025 09:46
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: Ready for Review
Development

Successfully merging this pull request may close these issues.

4 participants