Skip to content

more verbose logs, and deal with empty spec_components#204

Open
lance-sp wants to merge 2 commits intomasterfrom
feature/spade-edn-runner
Open

more verbose logs, and deal with empty spec_components#204
lance-sp wants to merge 2 commits intomasterfrom
feature/spade-edn-runner

Conversation

@lance-sp
Copy link
Copy Markdown
Contributor

@lance-sp lance-sp commented Jul 1, 2025

No description provided.

@lance-sp lance-sp requested a review from Copilot July 1, 2025 08:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR bumps the project version, adds an empty-list guard in get_spec_component_type, and enhances logging and error handling in get_triple_store_graph.

  • Bump project version from 0.3.1a5 to 0.3.3a1
  • Add a guard clause for empty spec_components
  • Improve parsing logs, error messages, and secrets handling in triple-store graph loading

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pyproject.toml Updated version to 0.3.3a1
mustrd/spec_component.py Added empty-list check in get_spec_component_type
mustrd/mustrd.py Added verbose logging, error handling, and secrets-file support in get_triple_store_graph
Comments suppressed due to low confidence (3)

mustrd/spec_component.py:183

  • [nitpick] The error message is generic. Consider including the function name or more context, e.g., ValueError("get_spec_component_type: 'spec_components' is empty").
        raise ValueError("spec_components list is empty")

mustrd/spec_component.py:182

  • This new guard clause isn’t covered by existing tests. Consider adding a unit test to verify that calling get_spec_component_type([]) raises the expected ValueError.
    if not spec_components:

mustrd/mustrd.py:562

  • Logging raw secrets at INFO level may expose sensitive data. Remove this log or mask the secrets before logging.
        log.info("" + secrets)

Comment thread mustrd/mustrd.py
if secrets:
return Graph().parse(triple_store_graph_path).parse(data=secrets)
log.info("Parsing secrets from provided string (--secrets option)")
log.info("" + secrets)
Copy link

Copilot AI Jul 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The "" + secrets concatenation is redundant. Use log.info(secrets) or an f-string for clarity.

Suggested change
log.info("" + secrets)
log.info(secrets)

Copilot uses AI. Check for mistakes.
Comment thread mustrd/mustrd.py
# Parse the main triple store graph file
try:
graph.parse(triple_store_graph_path)
except Exception as e:
Copy link

Copilot AI Jul 1, 2025

Choose a reason for hiding this comment

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

Catching all Exception can hide unexpected errors. Consider catching more specific exceptions (e.g., a parsing or RDF-specific error).

Suggested change
except Exception as e:
except (BadSyntax, ParseException) as e:

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 1, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  mustrd
  mustrd.py 551-582
  spec_component.py 183
Project Total  

This report was generated by python-coverage-comment-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants