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

[ENH] Allow unrecognized pipeline names and versions in processing status file #401

Merged
merged 23 commits into from
Dec 11, 2024

Conversation

alyssadai
Copy link
Contributor

@alyssadai alyssadai commented Dec 3, 2024

Changes proposed in this pull request:

  • Checks of pipeline names and versions updated so that:
    • If no available pipeline names are recognized, error out, otherwise emit a warning and continue
    • For each recognized pipeline, emit a warning if >=1 versions are unrecognized and continue
      • If no versions of any recognized pipelines are themselves recognized, error out

For reviewer: Sourcery was super verbose on this PR because it seemingly reviewed it twice (I accidentally marked the PR ready for review before I was ready, and then once I converted to draft and then back to ready for review, the old comments stuck around even though several were no longer applicable). Not sure how to make Sourcery auto-resolve old reviews - I attempted to do it using a command but that only triggered yet another review 😬 To make this PR easier to read, I've left only the most recent set of comments unresolved.

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

Summary by Sourcery

Enhance the processing status file handling by allowing unrecognized pipeline names and versions, emitting warnings instead of errors when some are unrecognized, and ensuring at least one recognized pipeline-version combination is present. Update tests to cover these scenarios.

Enhancements:

  • Update pipeline name and version checks to allow unrecognized entries, emitting warnings instead of errors when some are unrecognized.

Tests:

  • Add tests to ensure unrecognized pipelines and versions are excluded from output with warnings, and that errors are raised when no recognized pipeline-version combinations exist.

Summary by Sourcery

Enhance the processing status file handling by allowing unrecognized pipeline names and versions, emitting warnings instead of errors when some are unrecognized, and ensuring at least one recognized pipeline-version combination is present. Update tests to cover these scenarios.

Enhancements:

  • Update pipeline name and version checks to allow unrecognized entries, emitting warnings instead of errors when some are unrecognized.

Tests:

  • Add tests to ensure unrecognized pipelines and versions are excluded from output with warnings, and that errors are raised when no recognized pipeline-version combinations exist.

@alyssadai alyssadai added the pr-patch Incremental feature improvement, will increment patch version when merged (0.0.+1) label Dec 3, 2024
Copy link

sourcery-ai bot commented Dec 3, 2024

Reviewer's Guide by Sourcery

This PR updates the pipeline validation logic to be more flexible by allowing unrecognized pipeline names and versions in the processing status file. Instead of failing immediately when encountering unrecognized entries, the system now emits warnings and continues processing with the recognized pipelines/versions, only erroring out if no valid pipeline-version combinations are found.

Class diagram for updated pipeline validation logic

classDiagram
    class DerivativeUtils {
        +list get_recognized_pipelines(Iterable~str~ pipelines)
        +tuple~list, list~ classify_pipeline_versions(str pipeline, Iterable~str~ versions)
        +void check_at_least_one_pipeline_version_is_recognized(pd.DataFrame status_df)
    }

    class Mappings {
        +dict KNOWN_PIPELINE_URIS
        +dict KNOWN_PIPELINE_VERSIONS
    }

    DerivativeUtils --> Mappings : uses

    class CLI {
        +void derivatives(pd.DataFrame status_df)
    }

    CLI --> DerivativeUtils : uses
Loading

File-Level Changes

Change Details Files
Refactored pipeline validation logic to handle unrecognized entries
  • Split pipeline validation into separate functions for checking names and versions
  • Added function to classify pipeline versions as recognized or unrecognized
  • Added check to ensure at least one valid pipeline-version combination exists
  • Modified pipeline completion check to only process recognized pipeline-version pairs
bagel/utilities/derivative_utils.py
bagel/cli.py
Added comprehensive test coverage for new validation behavior
  • Added test for handling unrecognized pipelines with warnings
  • Added test for error case when no valid pipeline-version combinations exist
  • Updated existing pipeline version tests to use new classification approach
tests/integration/test_cli_derivatives.py
tests/unit/test_derivative_utils.py
tests/data/proc_status_no_recognized_pipelines.tsv
tests/data/proc_status_unrecognized_pipelines.tsv

Assessment against linked issues

Issue Objective Addressed Explanation
#382 Allow derivatives command to proceed when at least one pipeline/version combination is recognized, emitting warnings instead of errors for unrecognized ones

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@alyssadai alyssadai marked this pull request as draft December 3, 2024 19:34
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.56%. Comparing base (8578e4c) to head (5174bc6).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #401      +/-   ##
==========================================
+ Coverage   98.42%   98.56%   +0.14%     
==========================================
  Files          18       18              
  Lines        1016     1116     +100     
==========================================
+ Hits         1000     1100     +100     
  Misses         16       16              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @alyssadai - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 3 issues found
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
tests/unit/test_derivative_utils.py Show resolved Hide resolved
tests/unit/test_derivative_utils.py Show resolved Hide resolved
tests/unit/test_derivative_utils.py Show resolved Hide resolved
bagel/utilities/derivative_utils.py Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
bagel/utilities/derivative_utils.py Show resolved Hide resolved
@alyssadai alyssadai marked this pull request as ready for review December 4, 2024 03:41
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @alyssadai - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 2 issues found
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

tests/unit/test_derivative_utils.py Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Show resolved Hide resolved
bagel/utilities/derivative_utils.py Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Outdated Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
bagel/utilities/derivative_utils.py Show resolved Hide resolved
@alyssadai
Copy link
Contributor Author

@sourcery-ai review

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @alyssadai - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

bagel/utilities/derivative_utils.py Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Outdated Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
@surchs surchs self-requested a review December 4, 2024 17:40
bagel/mappings.py Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
bagel/utilities/derivative_utils.py Outdated Show resolved Hide resolved
bagel/utilities/derivative_utils.py Show resolved Hide resolved
tests/unit/test_derivative_utils.py Show resolved Hide resolved
tests/unit/test_derivative_utils.py Outdated Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Outdated Show resolved Hide resolved
tests/integration/test_cli_derivatives.py Outdated Show resolved Hide resolved
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Thanks @alyssadai for the PR. Looks like sourcery was trying to filibuster your work here - can't let that happen!

I have some clarity points so not approving yet, but they are pretty small. Mainly

  • what's most helpful to show user if they have bad pipeline names or versions
  • make tests easier for human brain

lmk what you think

Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

edit: not sure where this ghost review is from 👀

@alyssadai alyssadai added the release Create a release when this PR is merged label Dec 6, 2024
@alyssadai alyssadai requested a review from surchs December 6, 2024 21:23
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Hey @alyssadai, I don't see any changes since the last review. Have you maybe not pushed your changes yet?

@alyssadai
Copy link
Contributor Author

Hey @surchs, you're totally right, sorry about that! You should be able to see the changes now.

@alyssadai alyssadai requested a review from surchs December 10, 2024 20:26
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Looks great @alyssadai!

🧑‍🍳

@alyssadai alyssadai merged commit f68468a into main Dec 11, 2024
9 checks passed
@alyssadai alyssadai deleted the allow-unrecog-pipelines branch December 11, 2024 01:42
Copy link
Contributor

🚀 PR was released in v0.3.5 🚀

@neurobagel-bot neurobagel-bot bot added the released This issue/pull request has been released. label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-patch Incremental feature improvement, will increment patch version when merged (0.0.+1) release Create a release when this PR is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit warning instead of erroring out when pipeline/version not recognized
2 participants