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

fix: Updated logging to log all aborted cases #26

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ Unreleased

*

[0.1.5] - 2024-01-25
************************************************

Changed
=======

* Logging aborted runs of the filter


[0.1.4] - 2024-01-22
************************************************

Expand Down
2 changes: 1 addition & 1 deletion skill_tagging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Django app plugin for fetching and verifying tags for xblock skills.
"""

__version__ = '0.1.4'
__version__ = '0.1.5'

# pylint: disable=invalid-name
default_app_config = 'skill_tagging.apps.SkillTaggingConfig'
32 changes: 16 additions & 16 deletions skill_tagging/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ def run_filter(self, block, fragment, context, view): # pylint: disable=argumen

# Check whether we need to run this filter and only call the API.
if not self.should_run_filter():
logger.info(
"[Xblock-Skill-Tagging] Filter aborted for vertical block. Block-ID: %s",
str(block.scope_ids.usage_id.block_id)
)
return {"block": block, "fragment": fragment, "context": context, "view": view}
logger.info(
"[Xblock-Skill-Tagging] Filter run for AddVerticalBlockSkillVerificationSection. Block-ID: %s",
str(block.scope_ids.usage_id.block_id)
)
skills = self.fetch_related_skills(block)
if not skills:
logger.info(
"[Xblock-Skill-Tagging] Skills missing for vertical block. Block-ID: %s",
str(block.scope_ids.usage_id.block_id)
)
return {"block": block, "fragment": fragment, "context": context, "view": view}
logger.info(
"[Xblock-Skill-Tagging] Skills found for AddVerticalBlockSkillVerificationSection. Block-ID: %s",
str(block.scope_ids.usage_id.block_id)
)
usage_id = block.scope_ids.usage_id
data = self.get_skill_context(usage_id, block, skills)
html = resource_string("static/tagging.html")
Expand Down Expand Up @@ -128,19 +128,19 @@ def run_filter(self, block, context): # pylint: disable=arguments-differ
"""Pipeline Step implementing the Filter"""
usage_id = block.scope_ids.usage_id
if usage_id.block_type != "video" or not self.should_run_filter():
logger.info(
"[Xblock-Skill-Tagging] Filter aborted for block. Block-ID: %s",
str(block.scope_ids.usage_id.block_id)
)
# avoid fetching skills for other xblocks
return {"block": block, "context": context}
logger.info(
"[Xblock-Skill-Tagging] Filter run for AddVideoBlockSkillVerificationComponent. Block-ID: %s",
str(block.scope_ids.usage_id.block_id)
)
skills = self.fetch_related_skills(block)
if not skills:
logger.info(
"[Xblock-Skill-Tagging] Skills missing for video. Block-ID: %s",
str(block.scope_ids.usage_id.block_id)
)
return {"block": block, "context": context}
logger.info(
"[Xblock-Skill-Tagging] Skills found for AddVideoBlockSkillVerificationComponent. Block-ID: %s",
str(block.scope_ids.usage_id.block_id)
)
data = self.get_skill_context(usage_id, block, skills)

def wrapper(fn):
Expand Down
Loading