Skip to content

Conversation

@wgu-taylor-payne
Copy link
Contributor

@wgu-taylor-payne wgu-taylor-payne commented May 30, 2025

Description

The UpstreamSyncMixin (introduced in #34925) which is added as a XBlock mixin, currently contains four fields - upstream, upstream_version, upstream_version_declined, and upstream_display_name. These fields are coming through in the course advanced settings API endpoint (/api/contentstore/v0/advanced_settings/{course_id}), and subsequently show up in the Advanced Settings view in the frontend-app-authoring MFE.

Here is a JSON snippet showing one of those fields coming through in the API response:

    "upstream_display_name": {
        "value": null,
        "display_name": "upstream_display_name",
        "help": "The value of display_name on the linked upstream block/container.",
        "deprecated": false,
        "hide_on_enabled_publisher": false
    },

As can be seen in openedx/frontend-app-authoring#2018, these fields are showing up in the Advanced Settings view for a course, when they shouldn't be.

This PR resolves this issue by adding the fields from the UpstreamSyncMixin into the FIELDS_EXCLUDE_LIST of the CourseMetadata class. Unless the API is called with fetch_all=1 (the authoring MFE uses fetch_all=0), then these fields will be filtered out.

Once this PR is merged in, the upstream fields will no longer show by default in the Advanced Settings view in the cms.

Supporting information

Resolves openedx/frontend-app-authoring#2018.

Testing instructions

  1. Open a course in the Studio
  2. On the top bar choose Settings and then Advanced Settings
  3. No settings starting with "Upstream" should appear

Other information

This issue appears to be in Teak:
https://github.com/openedx/edx-platform/blob/release/teak/cms/djangoapps/models/settings/course_metadata.py#L41
https://github.com/openedx/edx-platform/blob/release/teak/cms/lib/xblock/upstream_sync.py#L289

You can see the fields appear here in this Teak sandbox, for example.

This issue appears to be in Sumac:
https://github.com/openedx/edx-platform/blob/open-release/sumac.master/cms/lib/xblock/upstream_sync.py#L379
https://github.com/openedx/edx-platform/blob/open-release/sumac.master/cms/djangoapps/models/settings/course_metadata.py#L41

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label May 30, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @wgu-taylor-payne!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

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.

Details
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.

@wgu-taylor-payne wgu-taylor-payne self-assigned this May 30, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions May 30, 2025
@wgu-taylor-payne wgu-taylor-payne added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label May 30, 2025
@wgu-taylor-payne wgu-taylor-payne requested a review from a team May 30, 2025 22:44
@kdmccormick kdmccormick requested review from kdmccormick and removed request for a team June 2, 2025 18:53
@dwong2708
Copy link
Contributor

@wgu-taylor-payne It would be great to have a unit test for this. What do you think?

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jun 3, 2025
Copy link
Member

@kdmccormick kdmccormick 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! Thanks for the fix.

@dwong2708 it would be fine to add a new unit test for this, but the general mechanism of excluding fields from the advanced settings page is already being tested, and this is just a straightfoward usage of that existing mechanism, so I do not see a new test as necessary.

@wgu-taylor-payne If you'd like to add a new test, go ahead, otherwise I'm happy to merge this as-is. Let me know.

@kdmccormick kdmccormick moved this from Ready for Review to Ready to Merge in Contributions Jun 4, 2025
@wgu-taylor-payne
Copy link
Contributor Author

@kdmccormick Since the general mechanism is already being tested, and I haven't started writing any additional tests yet, you can go ahead an merge this in. Thank you!

@kdmccormick kdmccormick merged commit 3e83efa into openedx:master Jun 4, 2025
49 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Merge to Done in Contributions Jun 4, 2025
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

marlonkeating pushed a commit that referenced this pull request Jul 15, 2025
…36831)

The UpstreamSyncMixin introduced in [1] which is added as a XBlock mixin,
currently contains four fields - `upstream`, `upstream_version`,
`upstream_version_declined`, and `upstream_display_name`. These fields are
coming through in the course advanced settings API endpoint
(`/api/contentstore/v0/advanced_settings/{course_id}`), and subsequently show
up in the Advanced Settings view in the frontend-app-authoring MFE, which they
shouldn't.

This PR resolves this issue by adding the fields from the `UpstreamSyncMixin`
into the FIELDS_EXCLUDE_LIST [2] of the `CourseMetadata` class. Unless the API is
called with `fetch_all=1` (the authoring MFE uses `fetch_all=0`), then these
fields will be filtered out.

[1] https://github.com/openedx/edx-platform/blob/master/cms/lib/xblock/upstream_sync.py#L289
[2] https://github.com/openedx/edx-platform/blob/master/cms/djangoapps/models/settings/course_metadata.py#L41

Fixes: openedx/frontend-app-authoring#2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

"Upstream" settings should not appear in course advanced settings

5 participants