feat: Add a csv report of xblocks used in courses (redwood) - #794
Merged
samuelallan72 merged 1 commit intoDec 3, 2025
Merged
Conversation
pkulkark
reviewed
Nov 14, 2025
pkulkark
reviewed
Nov 14, 2025
pkulkark
reviewed
Nov 14, 2025
pkulkark
reviewed
Nov 14, 2025
This is added via an lms management command:
```
$ python manage.py lms xblock_list_csv --help
...
usage: manage.py xblock_list_csv [-h] [--exclude-core-xblocks] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color]
[--force-color] [--skip-checks]
filename
Generate a CSV file with all published components used in courses with their xblock type.
positional arguments:
filename Path to the CSV output file. Use '-' to print to stdout.
options:
-h, --help show this help message and exit
--exclude-core-xblocks
Exclude components using core XBlocks: (html, problem, video). Default: false
...
```
Example usage:
```
python manage.py lms xblock_list_csv --exclude-core-xblocks components.csv
```
Private-ref: https://tasks.opencraft.com/browse/BB-10225
samuelallan72
force-pushed
the
samuel/xblock-list-csv-redwood
branch
from
December 2, 2025 06:07
4a9da3f to
70cc7ed
Compare
samuelallan72
marked this pull request as ready for review
December 2, 2025 06:08
pkulkark
approved these changes
Dec 2, 2025
pkulkark
left a comment
Member
There was a problem hiding this comment.
LGTM 👍
- I tested this: I couldn't get my devstack running but verified the generated reports are as expected.
- I read through the code
samuelallan72
merged commit Dec 3, 2025
0d4e82e
into
opencraft-release/redwood.1
16 of 75 checks passed
samuelallan72
added a commit
that referenced
this pull request
Jan 23, 2026
Also add docstring to keep pylint happy and add some type hints. Relates to #794
samuelallan72
added a commit
that referenced
this pull request
Jan 23, 2026
Also add docstring to keep pylint happy and add some type hints. Relates to #794
samuelallan72
added a commit
that referenced
this pull request
Jan 27, 2026
Also add docstring to keep pylint happy and add some type hints. Relates to #794
Agrendalath
pushed a commit
that referenced
this pull request
Jan 27, 2026
Also add docstring to keep pylint happy and add some type hints. Relates to #794
Member
Author
|
@pkulkark do we want this cherry picked to our shared ulmo or verawood release branch? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a management command for generating a csv report of xblocks used in courses.
Usage (with common management command help removed for clarity):
Examples:
Print complete csv to stdout:
Save complete csv to components.csv:
Save csv excluding components using core xblocks to components.csv:
Example csv output files:
components-excluded.csv
components.csv
components-stdout.csv
Supporting information
Private-ref: https://tasks.opencraft.com/browse/BB-10225
Testing instructions
tutor dev exec lms -- bashpython manage.py lms xblock_list_csv -python manage.py lms xblock_list_csv components.csvpython manage.py lms xblock_list_csv - > components-stdout.csvdiff components.csv components-stdout.csvand verify the diff is empty (to verify printing to stdout has the same report as writing to file)python manage.py lms xblock_list_csv --exclude-core-xblocks components-excluded.csvcomponents-excluded.csv, verify there are no rows for the core xblocks (html, problem, video)